From 65bf72f131c4df01350c00e08a6ff71a0dde359a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 11 Jul 2019 23:07:20 +0000 Subject: [PATCH] style: Set the property restrictions flags from the centralized list. Differential Revision: https://phabricator.services.mozilla.com/D37721 --- .../properties/longhands/background.mako.rs | 11 +----- .../style/properties/longhands/border.mako.rs | 10 +---- .../style/properties/longhands/box.mako.rs | 5 --- .../properties/longhands/counters.mako.rs | 1 - .../properties/longhands/effects.mako.rs | 4 +- .../style/properties/longhands/font.mako.rs | 19 ---------- .../longhands/inherited_box.mako.rs | 2 - .../longhands/inherited_text.mako.rs | 16 +------- .../style/properties/longhands/margin.mako.rs | 2 +- .../properties/longhands/outline.mako.rs | 3 -- .../properties/longhands/padding.mako.rs | 2 +- .../style/properties/longhands/text.mako.rs | 6 --- .../style/properties/properties.mako.rs | 38 +++++++++++-------- 13 files changed, 29 insertions(+), 90 deletions(-) diff --git a/components/style/properties/longhands/background.mako.rs b/components/style/properties/longhands/background.mako.rs index cc416bc3af0..7422c4b474a 100644 --- a/components/style/properties/longhands/background.mako.rs +++ b/components/style/properties/longhands/background.mako.rs @@ -15,8 +15,7 @@ ${helpers.predefined_type( animation_value_type="AnimatedColor", ignored_when_colors_disabled=True, allow_quirks="Yes", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER \ - CAN_ANIMATE_ON_COMPOSITOR", + flags="CAN_ANIMATE_ON_COMPOSITOR", )} ${helpers.predefined_type( @@ -28,7 +27,6 @@ ${helpers.predefined_type( vector="True", animation_value_type="discrete", ignored_when_colors_disabled="True", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", )} % for (axis, direction, initial) in [("x", "Horizontal", "left"), ("y", "Vertical", "top")]: @@ -41,7 +39,6 @@ ${helpers.predefined_type( animation_value_type="ComputedValue", vector=True, vector_animation_type="repeatable_list", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", )} % endfor @@ -53,7 +50,6 @@ ${helpers.predefined_type( animation_value_type="discrete", vector=True, spec="https://drafts.csswg.org/css-backgrounds/#the-background-repeat", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", )} ${helpers.single_keyword( @@ -63,7 +59,6 @@ ${helpers.single_keyword( gecko_enum_prefix="StyleImageLayerAttachment", spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", )} ${helpers.single_keyword( @@ -75,7 +70,6 @@ ${helpers.single_keyword( gecko_inexhaustive=True, spec="https://drafts.csswg.org/css-backgrounds/#the-background-clip", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", )} ${helpers.single_keyword( @@ -86,7 +80,6 @@ ${helpers.single_keyword( gecko_inexhaustive=True, spec="https://drafts.csswg.org/css-backgrounds/#the-background-origin", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER" )} ${helpers.predefined_type( @@ -98,7 +91,6 @@ ${helpers.predefined_type( vector=True, vector_animation_type="repeatable_list", animation_value_type="BackgroundSizeList", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", extra_prefixes="webkit")} // https://drafts.fxtf.org/compositing/#background-blend-mode @@ -110,5 +102,4 @@ ${helpers.single_keyword( gecko_constant_prefix="NS_STYLE_BLEND", vector=True, products="gecko", animation_value_type="discrete", spec="https://drafts.fxtf.org/compositing/#background-blend-mode", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", )} diff --git a/components/style/properties/longhands/border.mako.rs b/components/style/properties/longhands/border.mako.rs index 66544a44858..87de168d534 100644 --- a/components/style/properties/longhands/border.mako.rs +++ b/components/style/properties/longhands/border.mako.rs @@ -29,7 +29,6 @@ logical=is_logical, logical_group="border-color", allow_quirks="No" if is_logical else "Yes", - flags="APPLIES_TO_FIRST_LETTER", ignored_when_colors_disabled=True, )} @@ -38,7 +37,6 @@ "specified::BorderStyle::None", alias=maybe_moz_logical_alias(product, side, "-moz-border-%s-style"), spec=maybe_logical_spec(side, "style"), - flags="APPLIES_TO_FIRST_LETTER", animation_value_type="discrete" if not is_logical else "none", logical=is_logical, logical_group="border-style", @@ -55,7 +53,7 @@ animation_value_type="NonNegativeLength", logical=is_logical, logical_group="border-width", - flags="APPLIES_TO_FIRST_LETTER GETCS_NEEDS_LAYOUT_FLUSH", + flags="GETCS_NEEDS_LAYOUT_FLUSH", allow_quirks="No" if is_logical else "Yes", servo_restyle_damage="reflow rebuild_and_reflow_inline" )} @@ -78,7 +76,6 @@ extra_prefixes=prefixes, spec=maybe_logical_spec(corner, "radius"), boxed=True, - flags="APPLIES_TO_FIRST_LETTER", animation_value_type="BorderCornerRadius", logical_group="border-radius", logical=is_logical, @@ -112,7 +109,6 @@ ${helpers.predefined_type( spec="https://drafts.csswg.org/css-backgrounds/#the-background-image", vector=False, animation_value_type="discrete", - flags="APPLIES_TO_FIRST_LETTER", boxed=product == "servo", ignored_when_colors_disabled=True )} @@ -124,7 +120,6 @@ ${helpers.predefined_type( initial_specified_value="generics::rect::Rect::all(specified::NonNegativeLengthOrNumber::zero())", spec="https://drafts.csswg.org/css-backgrounds/#border-image-outset", animation_value_type="discrete", - flags="APPLIES_TO_FIRST_LETTER", boxed=True, )} @@ -135,7 +130,6 @@ ${helpers.predefined_type( initial_specified_value="specified::BorderImageRepeat::stretch()", animation_value_type="discrete", spec="https://drafts.csswg.org/css-backgrounds/#the-border-image-repeat", - flags="APPLIES_TO_FIRST_LETTER", )} ${helpers.predefined_type( @@ -145,7 +139,6 @@ ${helpers.predefined_type( initial_specified_value="specified::BorderImageWidth::all(specified::BorderImageSideWidth::one())", spec="https://drafts.csswg.org/css-backgrounds/#border-image-width", animation_value_type="discrete", - flags="APPLIES_TO_FIRST_LETTER", boxed=True, )} @@ -156,6 +149,5 @@ ${helpers.predefined_type( initial_specified_value="specified::BorderImageSlice::hundred_percent()", spec="https://drafts.csswg.org/css-backgrounds/#border-image-slice", animation_value_type="discrete", - flags="APPLIES_TO_FIRST_LETTER", boxed=True, )} diff --git a/components/style/properties/longhands/box.mako.rs b/components/style/properties/longhands/box.mako.rs index fd4e248534c..718ceaa3419 100644 --- a/components/style/properties/longhands/box.mako.rs +++ b/components/style/properties/longhands/box.mako.rs @@ -59,7 +59,6 @@ ${helpers.predefined_type( spec="https://drafts.csswg.org/css-box/#propdef-float", animation_value_type="discrete", needs_context=False, - flags="APPLIES_TO_FIRST_LETTER", servo_restyle_damage="rebuild_and_reflow", gecko_ffi_name="mFloat", )} @@ -80,7 +79,6 @@ ${helpers.predefined_type( "VerticalAlign", "computed::VerticalAlign::baseline()", animation_value_type="ComputedValue", - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align", servo_restyle_damage = "reflow", )} @@ -607,7 +605,6 @@ ${helpers.predefined_type( "shape-image-threshold", "Opacity", "0.0", products="gecko", animation_value_type="ComputedValue", - flags="APPLIES_TO_FIRST_LETTER", spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property", )} @@ -617,7 +614,6 @@ ${helpers.predefined_type( "computed::NonNegativeLengthPercentage::zero()", products="gecko", animation_value_type="NonNegativeLengthPercentage", - flags="APPLIES_TO_FIRST_LETTER", spec="https://drafts.csswg.org/css-shapes/#shape-margin-property", )} @@ -627,7 +623,6 @@ ${helpers.predefined_type( "generics::basic_shape::ShapeSource::None", products="gecko", animation_value_type="basic_shape::FloatAreaShape", - flags="APPLIES_TO_FIRST_LETTER", spec="https://drafts.csswg.org/css-shapes/#shape-outside-property", )} diff --git a/components/style/properties/longhands/counters.mako.rs b/components/style/properties/longhands/counters.mako.rs index fce23f3a1ea..f8971315603 100644 --- a/components/style/properties/longhands/counters.mako.rs +++ b/components/style/properties/longhands/counters.mako.rs @@ -13,7 +13,6 @@ ${helpers.predefined_type( initial_specified_value="specified::Content::normal()", animation_value_type="discrete", spec="https://drafts.csswg.org/css-content/#propdef-content", - flags="APPLIES_TO_MARKER", servo_restyle_damage="rebuild_and_reflow", )} diff --git a/components/style/properties/longhands/effects.mako.rs b/components/style/properties/longhands/effects.mako.rs index ac2b92cbe52..85bf5d9a829 100644 --- a/components/style/properties/longhands/effects.mako.rs +++ b/components/style/properties/longhands/effects.mako.rs @@ -12,8 +12,7 @@ ${helpers.predefined_type( "Opacity", "1.0", animation_value_type="ComputedValue", - flags="APPLIES_TO_CUE CREATES_STACKING_CONTEXT APPLIES_TO_PLACEHOLDER \ - CAN_ANIMATE_ON_COMPOSITOR", + flags="CREATES_STACKING_CONTEXT CAN_ANIMATE_ON_COMPOSITOR", spec="https://drafts.csswg.org/css-color/#opacity", servo_restyle_damage = "reflow_out_of_flow", )} @@ -28,7 +27,6 @@ ${helpers.predefined_type( vector_animation_type="with_zero", extra_prefixes="webkit", ignored_when_colors_disabled=True, - flags="APPLIES_TO_FIRST_LETTER", spec="https://drafts.csswg.org/css-backgrounds/#box-shadow", )} diff --git a/components/style/properties/longhands/font.mako.rs b/components/style/properties/longhands/font.mako.rs index df3e5e93354..5b1d9f3a501 100644 --- a/components/style/properties/longhands/font.mako.rs +++ b/components/style/properties/longhands/font.mako.rs @@ -12,7 +12,6 @@ ${helpers.predefined_type( "FontFamily", initial_value="computed::FontFamily::serif()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-family", servo_restyle_damage="rebuild_and_reflow", )} @@ -23,7 +22,6 @@ ${helpers.predefined_type( initial_value="computed::FontStyle::normal()", initial_specified_value="specified::FontStyle::normal()", animation_value_type="FontStyle", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-style", servo_restyle_damage="rebuild_and_reflow", )} @@ -42,7 +40,6 @@ ${helpers.single_keyword_system( gecko_ffi_name="mFont.variantCaps", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps", custom_consts=font_variant_caps_custom_consts, - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", animation_value_type="discrete", servo_restyle_damage="rebuild_and_reflow", )} @@ -53,7 +50,6 @@ ${helpers.predefined_type( initial_value="computed::FontWeight::normal()", initial_specified_value="specified::FontWeight::normal()", animation_value_type="Number", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight", servo_restyle_damage="rebuild_and_reflow", )} @@ -65,7 +61,6 @@ ${helpers.predefined_type( initial_specified_value="specified::FontSize::medium()", animation_value_type="NonNegativeLength", allow_quirks="Yes", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-size", servo_restyle_damage="rebuild_and_reflow", )} @@ -77,7 +72,6 @@ ${helpers.predefined_type( initial_value="computed::FontSizeAdjust::none()", initial_specified_value="specified::FontSizeAdjust::none()", animation_value_type="ComputedValue", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-size-adjust", )} @@ -87,7 +81,6 @@ ${helpers.predefined_type( products="gecko", initial_value="specified::FontSynthesis::get_initial_value()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis", )} @@ -97,7 +90,6 @@ ${helpers.predefined_type( initial_value="computed::FontStretch::hundred()", initial_specified_value="specified::FontStretch::normal()", animation_value_type="Percentage", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-stretch", servo_restyle_damage="rebuild_and_reflow", )} @@ -109,7 +101,6 @@ ${helpers.single_keyword_system( gecko_ffi_name="mFont.kerning", gecko_constant_prefix="NS_FONT_KERNING", spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", animation_value_type="discrete", )} @@ -120,7 +111,6 @@ ${helpers.predefined_type( initial_value="computed::FontVariantAlternates::get_initial_value()", initial_specified_value="specified::FontVariantAlternates::get_initial_specified_value()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-alternates", )} @@ -131,7 +121,6 @@ ${helpers.predefined_type( initial_value="computed::FontVariantEastAsian::empty()", initial_specified_value="specified::FontVariantEastAsian::empty()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-east-asian", )} @@ -142,7 +131,6 @@ ${helpers.predefined_type( initial_value="computed::FontVariantLigatures::empty()", initial_specified_value="specified::FontVariantLigatures::empty()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-ligatures", )} @@ -153,7 +141,6 @@ ${helpers.predefined_type( initial_value="computed::FontVariantNumeric::empty()", initial_specified_value="specified::FontVariantNumeric::empty()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-numeric", )} @@ -164,7 +151,6 @@ ${helpers.single_keyword_system( gecko_ffi_name="mFont.variantPosition", gecko_constant_prefix="NS_FONT_VARIANT_POSITION", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", animation_value_type="discrete", )} @@ -176,7 +162,6 @@ ${helpers.predefined_type( initial_specified_value="specified::FontFeatureSettings::normal()", extra_prefixes="moz:layout.css.prefixes.font-features", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts/#propdef-font-feature-settings", )} @@ -189,7 +174,6 @@ ${helpers.predefined_type( initial_value="computed::FontVariationSettings::normal()", initial_specified_value="specified::FontVariationSettings::normal()", animation_value_type="ComputedValue", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts-4/#propdef-font-variation-settings" )} @@ -201,7 +185,6 @@ ${helpers.predefined_type( initial_specified_value="specified::FontLanguageOverride::normal()", animation_value_type="discrete", extra_prefixes="moz:layout.css.prefixes.font-features", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override", )} @@ -214,7 +197,6 @@ ${helpers.single_keyword_system( gecko_ffi_name="mFont.opticalSizing", gecko_constant_prefix="NS_FONT_OPTICAL_SIZING", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", spec="https://www.w3.org/TR/css-fonts-4/#font-optical-sizing-def", )} @@ -510,7 +492,6 @@ ${helpers.single_keyword( has_effect_on_gecko_scrollbars=False, products="gecko", spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", animation_value_type="discrete", )} diff --git a/components/style/properties/longhands/inherited_box.mako.rs b/components/style/properties/longhands/inherited_box.mako.rs index 94ed265defa..0e3799f6c46 100644 --- a/components/style/properties/longhands/inherited_box.mako.rs +++ b/components/style/properties/longhands/inherited_box.mako.rs @@ -14,7 +14,6 @@ ${helpers.single_keyword( gecko_ffi_name="mVisible", animation_value_type="ComputedValue", spec="https://drafts.csswg.org/css-box/#propdef-visibility", - flags="APPLIES_TO_CUE", )} // CSS Writing Modes Level 3 @@ -38,7 +37,6 @@ ${helpers.single_keyword( animation_value_type="none", spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction", needs_conversion=True, - flags="APPLIES_TO_MARKER", servo_restyle_damage="rebuild_and_reflow", )} diff --git a/components/style/properties/longhands/inherited_text.mako.rs b/components/style/properties/longhands/inherited_text.mako.rs index 8a1c604c703..07f2bb3f9c2 100644 --- a/components/style/properties/longhands/inherited_text.mako.rs +++ b/components/style/properties/longhands/inherited_text.mako.rs @@ -11,7 +11,6 @@ ${helpers.predefined_type( "ColorPropertyValue", "::cssparser::RGBA::new(0, 0, 0, 255)", animation_value_type="AnimatedRGBA", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER", ignored_when_colors_disabled="True", spec="https://drafts.csswg.org/css-color/#color", )} @@ -21,8 +20,7 @@ ${helpers.predefined_type( "LineHeight", "computed::LineHeight::normal()", animation_value_type="LineHeight", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE \ - APPLIES_TO_PLACEHOLDER GETCS_NEEDS_LAYOUT_FLUSH", + flags="GETCS_NEEDS_LAYOUT_FLUSH", spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height", servo_restyle_damage="reflow" )} @@ -34,7 +32,6 @@ ${helpers.predefined_type( "TextTransform", "computed::TextTransform::none()", animation_value_type="discrete", - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text/#propdef-text-transform", servo_restyle_damage="rebuild_and_reflow", )} @@ -103,7 +100,6 @@ ${helpers.predefined_type( animation_value_type="discrete" gecko_pref="layout.css.text-justify.enabled" has_effect_on_gecko_scrollbars="False" - flags="APPLIES_TO_PLACEHOLDER" spec="https://drafts.csswg.org/css-text/#propdef-text-justify" servo_restyle_damage="rebuild_and_reflow" > @@ -149,7 +145,6 @@ ${helpers.predefined_type( "TextAlign", "computed::TextAlign::Start", animation_value_type="discrete", - flags="APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text/#propdef-text-align", servo_restyle_damage = "reflow", )} @@ -159,7 +154,6 @@ ${helpers.predefined_type( "LetterSpacing", "computed::LetterSpacing::normal()", animation_value_type="ComputedValue", - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing", servo_restyle_damage="rebuild_and_reflow", )} @@ -169,7 +163,6 @@ ${helpers.predefined_type( "WordSpacing", "computed::WordSpacing::zero()", animation_value_type="ComputedValue", - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text/#propdef-word-spacing", servo_restyle_damage="rebuild_and_reflow", )} @@ -181,7 +174,6 @@ ${helpers.predefined_type( gecko_enum_prefix="StyleWhiteSpace" needs_conversion="True" animation_value_type="discrete" - flags="APPLIES_TO_CUE APPLIES_TO_PLACEHOLDER" spec="https://drafts.csswg.org/css-text/#propdef-white-space" servo_restyle_damage="rebuild_and_reflow" > @@ -229,7 +221,6 @@ ${helpers.predefined_type( animation_value_type="AnimatedTextShadowList", ignored_when_colors_disabled=True, simple_vector_bindings=True, - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text-decor-3/#text-shadow-property", )} @@ -293,7 +284,6 @@ ${helpers.predefined_type( products="gecko", animation_value_type="AnimatedColor", ignored_when_colors_disabled=True, - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://compat.spec.whatwg.org/#the-webkit-text-fill-color", )} @@ -305,7 +295,6 @@ ${helpers.predefined_type( products="gecko", animation_value_type="AnimatedColor", ignored_when_colors_disabled=True, - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-color", )} @@ -316,7 +305,6 @@ ${helpers.predefined_type( initial_specified_value="specified::BorderSideWidth::zero()", computed_type="crate::values::computed::NonNegativeLength", products="gecko", - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://compat.spec.whatwg.org/#the-webkit-text-stroke-width", animation_value_type="discrete", )} @@ -337,7 +325,6 @@ ${helpers.single_keyword( products="gecko", animation_value_type="discrete", spec="https://drafts.csswg.org/css-ruby/#ruby-position-property", - flags="APPLIES_TO_CUE", )} // CSS Writing Modes Module Level 3 @@ -349,7 +336,6 @@ ${helpers.single_keyword( products="gecko", animation_value_type="discrete", spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright", - flags="APPLIES_TO_CUE APPLIES_TO_MARKER", )} // SVG 1.1: Section 11 - Painting: Filling, Stroking and Marker Symbols diff --git a/components/style/properties/longhands/margin.mako.rs b/components/style/properties/longhands/margin.mako.rs index effd355dffc..db98f8778f4 100644 --- a/components/style/properties/longhands/margin.mako.rs +++ b/components/style/properties/longhands/margin.mako.rs @@ -22,7 +22,7 @@ logical=side[1], logical_group="margin", spec=spec, - flags="APPLIES_TO_FIRST_LETTER GETCS_NEEDS_LAYOUT_FLUSH", + flags="GETCS_NEEDS_LAYOUT_FLUSH", allowed_in_page_rule=True, servo_restyle_damage="reflow" )} diff --git a/components/style/properties/longhands/outline.mako.rs b/components/style/properties/longhands/outline.mako.rs index ec765e631b8..8d0d326180b 100644 --- a/components/style/properties/longhands/outline.mako.rs +++ b/components/style/properties/longhands/outline.mako.rs @@ -18,7 +18,6 @@ ${helpers.predefined_type( animation_value_type="AnimatedColor", ignored_when_colors_disabled=True, spec="https://drafts.csswg.org/css-ui/#propdef-outline-color", - flags="APPLIES_TO_CUE", )} ${helpers.predefined_type( @@ -28,7 +27,6 @@ ${helpers.predefined_type( initial_specified_value="specified::OutlineStyle::none()", animation_value_type="discrete", spec="https://drafts.csswg.org/css-ui/#propdef-outline-style", - flags="APPLIES_TO_CUE", )} ${helpers.predefined_type( @@ -39,7 +37,6 @@ ${helpers.predefined_type( computed_type="crate::values::computed::NonNegativeLength", animation_value_type="NonNegativeLength", spec="https://drafts.csswg.org/css-ui/#propdef-outline-width", - flags="APPLIES_TO_CUE", )} // The -moz-outline-radius-* properties are non-standard and not on a standards track. diff --git a/components/style/properties/longhands/padding.mako.rs b/components/style/properties/longhands/padding.mako.rs index 09de317f0ac..5f00b0b2546 100644 --- a/components/style/properties/longhands/padding.mako.rs +++ b/components/style/properties/longhands/padding.mako.rs @@ -21,7 +21,7 @@ logical=side[1], logical_group="padding", spec=spec, - flags="APPLIES_TO_FIRST_LETTER GETCS_NEEDS_LAYOUT_FLUSH", + flags="GETCS_NEEDS_LAYOUT_FLUSH", allow_quirks="No" if side[1] else "Yes", servo_restyle_damage="reflow rebuild_and_reflow_inline" )} diff --git a/components/style/properties/longhands/text.mako.rs b/components/style/properties/longhands/text.mako.rs index 44adc21766d..0e741774837 100644 --- a/components/style/properties/longhands/text.mako.rs +++ b/components/style/properties/longhands/text.mako.rs @@ -13,7 +13,6 @@ ${helpers.predefined_type( "computed::TextOverflow::get_initial_value()", animation_value_type="discrete", boxed=True, - flags="APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow", servo_restyle_damage="rebuild_and_reflow", )} @@ -23,7 +22,6 @@ ${helpers.single_keyword( "normal embed isolate bidi-override isolate-override plaintext", animation_value_type="none", spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi", - flags="APPLIES_TO_MARKER", servo_restyle_damage="rebuild_and_reflow", )} @@ -33,7 +31,6 @@ ${helpers.predefined_type( "specified::TextDecorationLine::none()", initial_specified_value="specified::TextDecorationLine::none()", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line", servo_restyle_damage="rebuild_and_reflow", )} @@ -43,7 +40,6 @@ ${helpers.single_keyword( "solid double dotted dashed wavy -moz-none", products="gecko", animation_value_type="discrete", - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style", )} @@ -55,7 +51,6 @@ ${helpers.predefined_type( products="gecko", animation_value_type="AnimatedColor", ignored_when_colors_disabled=True, - flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-color", )} @@ -66,7 +61,6 @@ ${helpers.predefined_type( initial_specified_value="specified::InitialLetter::normal()", animation_value_type="discrete", products="gecko", - flags="APPLIES_TO_FIRST_LETTER", gecko_pref="layout.css.initial-letter.enabled", spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials", )} diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 013299ed048..76c9cd722af 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -1003,6 +1003,28 @@ bitflags! { if logical_count * 2 != len(props): raise RuntimeError("Logical group {} has ".format(group) + "unbalanced logical / physical properties") + + FIRST_LINE_RESTRICTIONS = PropertyRestrictions.first_line(data) + FIRST_LETTER_RESTRICTIONS = PropertyRestrictions.first_letter(data) + MARKER_RESTRICTIONS = PropertyRestrictions.marker(data) + PLACEHOLDER_RESTRICTIONS = PropertyRestrictions.placeholder(data) + CUE_RESTRICTIONS = PropertyRestrictions.cue(data) + + def restriction_flags(property): + name = property.name + flags = [] + if name in FIRST_LINE_RESTRICTIONS: + flags.append("APPLIES_TO_FIRST_LINE") + if name in FIRST_LETTER_RESTRICTIONS: + flags.append("APPLIES_TO_FIRST_LETTER") + if name in PLACEHOLDER_RESTRICTIONS: + flags.append("APPLIES_TO_PLACEHOLDER") + if name in MARKER_RESTRICTIONS: + flags.append("APPLIES_TO_MARKER") + if name in CUE_RESTRICTIONS: + flags.append("APPLIES_TO_CUE") + return flags + %> /// A group for properties which may override each other @@ -1206,7 +1228,7 @@ impl LonghandId { // constant expression support. const FLAGS: [u16; ${len(data.longhands)}] = [ % for property in data.longhands: - % for flag in property.flags: + % for flag in property.flags + restriction_flags(property): PropertyFlags::${flag}.bits | % endfor 0, @@ -3884,17 +3906,3 @@ macro_rules! longhand_properties_idents { } % endfor % endif - -<% -for (restricted_properties, flag) in [ - (PropertyRestrictions.cue(data), "APPLIES_TO_CUE"), - (PropertyRestrictions.placeholder(data), "APPLIES_TO_PLACEHOLDER"), - (PropertyRestrictions.first_line(data), "APPLIES_TO_FIRST_LINE"), - (PropertyRestrictions.first_letter(data), "APPLIES_TO_FIRST_LETTER"), - (PropertyRestrictions.marker(data), "APPLIES_TO_MARKER"), -]: - for property in data.longhands: - applies = property.name in restricted_properties - should_apply = flag in property.flags - assert applies == should_apply, "Should %s %s?" % (property.name, flag) -%>