Auto-generate color glue

This commit is contained in:
Ravi Shankar 2016-10-22 12:24:50 +05:30
parent caa745cb81
commit b446f0e28a
3 changed files with 5 additions and 17 deletions

View file

@ -732,7 +732,7 @@ fn static_assert() {
</%self:impl_trait>
<% skip_outline_longhands = " ".join("outline-color outline-style outline-width".split() +
<% skip_outline_longhands = " ".join("outline-style outline-width".split() +
["-moz-outline-radius-{0}".format(x.ident.replace("_", ""))
for x in CORNERS]) %>
<%self:impl_trait style_struct_name="Outline"
@ -741,8 +741,6 @@ fn static_assert() {
<% impl_keyword("outline_style", "mOutlineStyle", border_style_keyword, need_clone=True) %>
<% impl_color("outline_color", "mOutlineColor", need_clone=True) %>
<% impl_app_units("outline_width", "mActualOutlineWidth", need_clone=True,
round_to_pixels=True) %>
@ -1451,7 +1449,7 @@ fn static_assert() {
// TODO: Gecko accepts lists in most background-related properties. We just use
// the first element (which is the common case), but at some point we want to
// add support for parsing these lists in servo and pushing to nsTArray's.
<% skip_background_longhands = """background-color background-repeat
<% skip_background_longhands = """background-repeat
background-image background-clip
background-origin background-attachment
background-size background-position""" %>
@ -1459,8 +1457,6 @@ fn static_assert() {
skip_longhands="${skip_background_longhands}"
skip_additionals="*">
<% impl_color("background_color", "mBackgroundColor", need_clone=True, complex_color=False) %>
<% impl_common_image_layer_properties("background") %>
<%self:simple_image_array_property name="attachment" shorthand="background" field_name="mAttachment">
@ -1686,11 +1682,9 @@ fn static_assert() {
</%self:impl_trait>
<%self:impl_trait style_struct_name="Text"
skip_longhands="text-decoration-color text-decoration-line text-overflow"
skip_longhands="text-decoration-line text-overflow"
skip_additionals="*">
${impl_color("text_decoration_color", "mTextDecorationColor", need_clone=True)}
pub fn set_text_decoration_line(&mut self, v: longhands::text_decoration_line::computed_value::T) {
let mut bits: u8 = 0;
if v.underline {
@ -1780,7 +1774,6 @@ fn static_assert() {
</%self:impl_trait>
<% skip_svg_longhands = """
flood-color lighting-color stop-color
mask-mode mask-repeat mask-clip mask-origin mask-composite mask-position mask-size mask-image
clip-path
"""
@ -1789,12 +1782,6 @@ clip-path
skip_longhands="${skip_svg_longhands}"
skip_additionals="*">
<% impl_color("flood_color", "mFloodColor", complex_color=False) %>
<% impl_color("lighting_color", "mLightingColor", complex_color=False) %>
<% impl_color("stop_color", "mStopColor", complex_color=False) %>
<% impl_common_image_layer_properties("mask") %>
<%self:simple_image_array_property name="mode" shorthand="mask" field_name="mMaskMode">

View file

@ -11,7 +11,7 @@
// TODO(pcwalton): `invert`
${helpers.predefined_type("outline-color", "CSSColor", "::cssparser::Color::CurrentColor",
animatable=True)}
animatable=True, complex_color=True, need_clone=True)}
<%helpers:longhand name="outline-style" need_clone="True" animatable="False">
pub use values::specified::BorderStyle as SpecifiedValue;

View file

@ -209,5 +209,6 @@ ${helpers.single_keyword("text-decoration-style",
${helpers.predefined_type(
"text-decoration-color", "CSSColor",
"CSSParserColor::RGBA(RGBA { red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0 })",
complex_color=True,
products="gecko",
animatable=True)}