Autogenerate compute_damage (fixes #10622)

This commit is contained in:
Manish Goregaokar 2018-02-08 15:42:07 -08:00
parent cd663ea332
commit 8c2b7b41ef
19 changed files with 177 additions and 170 deletions

View file

@ -116,13 +116,12 @@ pub mod selector_map;
pub mod selector_parser; pub mod selector_parser;
pub mod shared_lock; pub mod shared_lock;
pub mod sharing; pub mod sharing;
pub mod style_resolver;
pub mod stylist;
#[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod servo;
pub mod str; pub mod str;
pub mod style_adjuster; pub mod style_adjuster;
pub mod style_resolver;
pub mod stylesheet_set; pub mod stylesheet_set;
pub mod stylesheets; pub mod stylesheets;
pub mod stylist;
pub mod thread_state; pub mod thread_state;
pub mod timer; pub mod timer;
pub mod traversal; pub mod traversal;
@ -154,6 +153,9 @@ pub mod properties {
include!(concat!(env!("OUT_DIR"), "/properties.rs")); include!(concat!(env!("OUT_DIR"), "/properties.rs"));
} }
// uses a macro from properties
#[cfg(feature = "servo")] #[allow(unsafe_code)] pub mod servo;
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
#[allow(unsafe_code, missing_docs)] #[allow(unsafe_code, missing_docs)]
pub mod gecko_properties { pub mod gecko_properties {

View file

@ -152,7 +152,7 @@ class Longhand(object):
allowed_in_keyframe_block=True, cast_type='u8', allowed_in_keyframe_block=True, cast_type='u8',
logical=False, alias=None, extra_prefixes=None, boxed=False, logical=False, alias=None, extra_prefixes=None, boxed=False,
flags=None, allowed_in_page_rule=False, allow_quirks=False, ignored_when_colors_disabled=False, flags=None, allowed_in_page_rule=False, allow_quirks=False, ignored_when_colors_disabled=False,
vector=False, need_animatable=False): vector=False, need_animatable=False, servo_restyle_damage="repaint"):
self.name = name self.name = name
if not spec: if not spec:
raise TypeError("Spec should be specified for %s" % name) raise TypeError("Spec should be specified for %s" % name)
@ -211,6 +211,9 @@ class Longhand(object):
self.transitionable = False self.transitionable = False
self.animation_type = None self.animation_type = None
# See compute_damage for the various values this can take
self.servo_restyle_damage = servo_restyle_damage
def experimental(self, product): def experimental(self, product):
if product == "gecko": if product == "gecko":
return bool(self.gecko_pref) return bool(self.gecko_pref)

View file

@ -52,7 +52,8 @@
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
logical=is_logical, logical=is_logical,
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
allow_quirks=not is_logical)} allow_quirks=not is_logical,
servo_restyle_damage = "reflow rebuild_and_reflow_inline")}
% endfor % endfor
${helpers.gecko_keyword_conversion(Keyword('border-style', ${helpers.gecko_keyword_conversion(Keyword('border-style',

View file

@ -22,6 +22,7 @@ ${helpers.predefined_type(
needs_context=False, needs_context=False,
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-display/#propdef-display", spec="https://drafts.csswg.org/css-display/#propdef-display",
servo_restyle_damage="rebuild_and_reflow"
)} )}
// FIXME(emilio): Listing all the display values here is very unfortunate, we should teach C++ to use the // FIXME(emilio): Listing all the display values here is very unfortunate, we should teach C++ to use the
@ -52,7 +53,8 @@ ${helpers.single_keyword("-moz-top-layer", "none top",
${helpers.single_keyword("position", "static absolute relative fixed sticky", ${helpers.single_keyword("position", "static absolute relative fixed sticky",
animation_value_type="discrete", animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT ABSPOS_CB", flags="CREATES_STACKING_CONTEXT ABSPOS_CB",
spec="https://drafts.csswg.org/css-position/#position-property")} spec="https://drafts.csswg.org/css-position/#position-property",
servo_restyle_damage="rebuild_and_reflow")}
<%helpers:single_keyword <%helpers:single_keyword
name="float" name="float"
@ -66,6 +68,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed sticky",
gecko_ffi_name="mFloat" gecko_ffi_name="mFloat"
flags="APPLIES_TO_FIRST_LETTER" flags="APPLIES_TO_FIRST_LETTER"
spec="https://drafts.csswg.org/css-box/#propdef-float" spec="https://drafts.csswg.org/css-box/#propdef-float"
servo_restyle_damage="rebuild_and_reflow"
> >
impl ToComputedValue for SpecifiedValue { impl ToComputedValue for SpecifiedValue {
type ComputedValue = computed_value::T; type ComputedValue = computed_value::T;
@ -120,6 +123,7 @@ ${helpers.single_keyword("position", "static absolute relative fixed sticky",
gecko_enum_prefix="StyleClear" gecko_enum_prefix="StyleClear"
gecko_ffi_name="mBreakType" gecko_ffi_name="mBreakType"
spec="https://drafts.csswg.org/css-box/#propdef-clear" spec="https://drafts.csswg.org/css-box/#propdef-clear"
servo_restyle_damage="rebuild_and_reflow"
> >
impl ToComputedValue for SpecifiedValue { impl ToComputedValue for SpecifiedValue {
type ComputedValue = computed_value::T; type ComputedValue = computed_value::T;
@ -392,7 +396,8 @@ ${helpers.predefined_type("transform", "Transform",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
gecko_ffi_name="mSpecifiedTransform", gecko_ffi_name="mSpecifiedTransform",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
spec="https://drafts.csswg.org/css-transforms/#propdef-transform")} spec="https://drafts.csswg.org/css-transforms/#propdef-transform",
servo_restyle_damage = "reflow_out_of_flow")}
${helpers.predefined_type("rotate", "Rotate", ${helpers.predefined_type("rotate", "Rotate",
"generics::transform::Rotate::None", "generics::transform::Rotate::None",
@ -505,7 +510,8 @@ ${helpers.predefined_type("perspective",
spec="https://drafts.csswg.org/css-transforms/#perspective", spec="https://drafts.csswg.org/css-transforms/#perspective",
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
animation_value_type="ComputedValue")} animation_value_type="ComputedValue",
servo_restyle_damage = "reflow_out_of_flow")}
${helpers.predefined_type("perspective-origin", ${helpers.predefined_type("perspective-origin",
"position::Position", "position::Position",
@ -513,7 +519,8 @@ ${helpers.predefined_type("perspective-origin",
boxed=True, boxed=True,
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
spec="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property", spec="https://drafts.csswg.org/css-transforms-2/#perspective-origin-property",
animation_value_type="ComputedValue")} animation_value_type="ComputedValue",
servo_restyle_damage = "reflow_out_of_flow")}
${helpers.single_keyword("backface-visibility", ${helpers.single_keyword("backface-visibility",
"visible hidden", "visible hidden",
@ -539,6 +546,7 @@ ${helpers.predefined_type(
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
flags="CREATES_STACKING_CONTEXT FIXPOS_CB", flags="CREATES_STACKING_CONTEXT FIXPOS_CB",
animation_value_type="discrete", animation_value_type="discrete",
servo_restyle_damage = "reflow_out_of_flow",
)} )}
${helpers.predefined_type("transform-origin", ${helpers.predefined_type("transform-origin",
@ -548,7 +556,8 @@ ${helpers.predefined_type("transform-origin",
extra_prefixes="moz webkit", extra_prefixes="moz webkit",
gecko_ffi_name="mTransformOrigin", gecko_ffi_name="mTransformOrigin",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-transforms/#transform-origin-property")} spec="https://drafts.csswg.org/css-transforms/#transform-origin-property",
servo_restyle_damage = "reflow_out_of_flow")}
${helpers.predefined_type("contain", ${helpers.predefined_type("contain",
"Contain", "Contain",

View file

@ -13,7 +13,8 @@ ${helpers.predefined_type("column-width",
extra_prefixes="moz", extra_prefixes="moz",
animation_value_type="NonNegativeLengthOrAuto", animation_value_type="NonNegativeLengthOrAuto",
servo_pref="layout.column-width.enabled", servo_pref="layout.column-width.enabled",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-width")} spec="https://drafts.csswg.org/css-multicol/#propdef-column-width",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("column-count", ${helpers.predefined_type("column-count",
@ -23,7 +24,8 @@ ${helpers.predefined_type("column-count",
servo_pref="layout.column-count.enabled", servo_pref="layout.column-count.enabled",
animation_value_type="PositiveIntegerOrAuto", animation_value_type="PositiveIntegerOrAuto",
extra_prefixes="moz", extra_prefixes="moz",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-count")} spec="https://drafts.csswg.org/css-multicol/#propdef-column-count",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("column-gap", ${helpers.predefined_type("column-gap",
"length::NonNegativeLengthOrNormal", "length::NonNegativeLengthOrNormal",
@ -31,7 +33,8 @@ ${helpers.predefined_type("column-gap",
extra_prefixes="moz", extra_prefixes="moz",
servo_pref="layout.column-gap.enabled", servo_pref="layout.column-gap.enabled",
animation_value_type="NonNegativeLengthOrNormal", animation_value_type="NonNegativeLengthOrNormal",
spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap")} spec="https://drafts.csswg.org/css-multicol/#propdef-column-gap",
servo_restyle_damage = "reflow")}
${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz", ${helpers.single_keyword("column-fill", "balance auto", extra_prefixes="moz",
products="gecko", animation_value_type="discrete", products="gecko", animation_value_type="discrete",

View file

@ -11,7 +11,8 @@ ${helpers.predefined_type("content",
"computed::Content::normal()", "computed::Content::normal()",
initial_specified_value="specified::Content::normal()", initial_specified_value="specified::Content::normal()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-content/#propdef-content")} spec="https://drafts.csswg.org/css-content/#propdef-content",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type( ${helpers.predefined_type(
"counter-increment", "counter-increment",
@ -19,6 +20,7 @@ ${helpers.predefined_type(
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment", spec="https://drafts.csswg.org/css-lists/#propdef-counter-increment",
servo_restyle_damage="rebuild_and_reflow"
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
@ -27,4 +29,5 @@ ${helpers.predefined_type(
initial_value="Default::default()", initial_value="Default::default()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset", spec="https://drafts.csswg.org/css-lists-3/#propdef-counter-reset",
servo_restyle_damage="rebuild_and_reflow"
)} )}

View file

@ -12,7 +12,8 @@ ${helpers.predefined_type("opacity",
"1.0", "1.0",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="CREATES_STACKING_CONTEXT APPLIES_TO_PLACEHOLDER", flags="CREATES_STACKING_CONTEXT APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-color/#opacity")} spec="https://drafts.csswg.org/css-color/#opacity",
servo_restyle_damage = "reflow_out_of_flow")}
${helpers.predefined_type( ${helpers.predefined_type(
"box-shadow", "box-shadow",

View file

@ -12,7 +12,8 @@ ${helpers.predefined_type("font-family",
initial_value="computed::FontFamily::serif()", initial_value="computed::FontFamily::serif()",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family")} spec="https://drafts.csswg.org/css-fonts/#propdef-font-family",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword_system("font-style", ${helpers.single_keyword_system("font-style",
"normal italic oblique", "normal italic oblique",
@ -20,7 +21,8 @@ ${helpers.single_keyword_system("font-style",
gecko_ffi_name="mFont.style", gecko_ffi_name="mFont.style",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-style", spec="https://drafts.csswg.org/css-fonts/#propdef-font-style",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage="rebuild_and_reflow")}
<% font_variant_caps_custom_consts= { "small-caps": "SMALLCAPS", <% font_variant_caps_custom_consts= { "small-caps": "SMALLCAPS",
@ -37,7 +39,8 @@ ${helpers.single_keyword_system("font-variant-caps",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps", spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps",
custom_consts=font_variant_caps_custom_consts, custom_consts=font_variant_caps_custom_consts,
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("font-weight", ${helpers.predefined_type("font-weight",
"FontWeight", "FontWeight",
@ -45,7 +48,8 @@ ${helpers.predefined_type("font-weight",
initial_specified_value="specified::FontWeight::Normal", initial_specified_value="specified::FontWeight::Normal",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight")} spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("font-size", ${helpers.predefined_type("font-size",
"FontSize", "FontSize",
@ -54,7 +58,8 @@ ${helpers.predefined_type("font-size",
animation_value_type="NonNegativeLength", animation_value_type="NonNegativeLength",
allow_quirks=True, allow_quirks=True,
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size")} spec="https://drafts.csswg.org/css-fonts/#propdef-font-size",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("font-size-adjust", ${helpers.predefined_type("font-size-adjust",
"FontSizeAdjust", "FontSizeAdjust",
@ -82,7 +87,8 @@ ${helpers.single_keyword_system("font-stretch",
cast_type='i16', cast_type='i16',
spec="https://drafts.csswg.org/css-fonts/#propdef-font-stretch", spec="https://drafts.csswg.org/css-fonts/#propdef-font-stretch",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
animation_value_type="ComputedValue")} animation_value_type="ComputedValue",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword_system("font-kerning", ${helpers.single_keyword_system("font-kerning",
"auto none normal", "auto none normal",

View file

@ -24,11 +24,13 @@ ${helpers.single_keyword("writing-mode",
tb=vertical-rl tb-rl=vertical-rl", tb=vertical-rl tb-rl=vertical-rl",
servo_pref="layout.writing-mode.enabled", servo_pref="layout.writing-mode.enabled",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode")} spec="https://drafts.csswg.org/css-writing-modes/#propdef-writing-mode",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword("direction", "ltr rtl", animation_value_type="discrete", ${helpers.single_keyword("direction", "ltr rtl", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction", spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
needs_conversion=True)} needs_conversion=True,
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword("text-orientation", ${helpers.single_keyword("text-orientation",
"mixed upright sideways", "mixed upright sideways",

View file

@ -9,20 +9,24 @@
${helpers.single_keyword("border-collapse", "separate collapse", ${helpers.single_keyword("border-collapse", "separate collapse",
gecko_constant_prefix="NS_STYLE_BORDER", gecko_constant_prefix="NS_STYLE_BORDER",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse")} spec="https://drafts.csswg.org/css-tables/#propdef-border-collapse",
servo_restyle_damage = "reflow")}
${helpers.single_keyword("empty-cells", "show hide", ${helpers.single_keyword("empty-cells", "show hide",
gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS", gecko_constant_prefix="NS_STYLE_TABLE_EMPTY_CELLS",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells")} spec="https://drafts.csswg.org/css-tables/#propdef-empty-cells",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword("caption-side", "top bottom", ${helpers.single_keyword("caption-side", "top bottom",
extra_gecko_values="right left top-outside bottom-outside", extra_gecko_values="right left top-outside bottom-outside",
needs_conversion="True", needs_conversion="True",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-caption-side")} spec="https://drafts.csswg.org/css-tables/#propdef-caption-side",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("border-spacing", ${helpers.predefined_type("border-spacing",
"BorderSpacing", "BorderSpacing",
"computed::BorderSpacing::zero()", "computed::BorderSpacing::zero()",
animation_value_type="BorderSpacing", animation_value_type="BorderSpacing",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing")} spec="https://drafts.csswg.org/css-tables/#propdef-border-spacing",
servo_restyle_damage = "reflow")}

View file

@ -11,7 +11,8 @@ ${helpers.predefined_type("line-height",
"computed::LineHeight::normal()", "computed::LineHeight::normal()",
animation_value_type="LineHeight", animation_value_type="LineHeight",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height")} spec="https://drafts.csswg.org/css2/visudet.html#propdef-line-height",
servo_restyle_damage = "reflow")}
// CSS Text Module Level 3 // CSS Text Module Level 3
@ -21,7 +22,8 @@ ${helpers.single_keyword("text-transform",
extra_gecko_values="full-width", extra_gecko_values="full-width",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-text-transform")} spec="https://drafts.csswg.org/css-text/#propdef-text-transform",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword("hyphens", "manual none auto", ${helpers.single_keyword("hyphens", "manual none auto",
gecko_enum_prefix="StyleHyphens", gecko_enum_prefix="StyleHyphens",
@ -41,7 +43,7 @@ ${helpers.predefined_type("text-indent",
"computed::LengthOrPercentage::Length(computed::Length::new(0.))", "computed::LengthOrPercentage::Length(computed::Length::new(0.))",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-text/#propdef-text-indent", spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
allow_quirks=True)} allow_quirks=True, servo_restyle_damage = "reflow")}
// Also known as "word-wrap" (which is more popular because of IE), but this is the preferred // Also known as "word-wrap" (which is more popular because of IE), but this is the preferred
// name per CSS-TEXT 6.2. // name per CSS-TEXT 6.2.
@ -50,14 +52,16 @@ ${helpers.single_keyword("overflow-wrap",
gecko_constant_prefix="NS_STYLE_OVERFLOWWRAP", gecko_constant_prefix="NS_STYLE_OVERFLOWWRAP",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap", spec="https://drafts.csswg.org/css-text/#propdef-overflow-wrap",
alias="word-wrap")} alias="word-wrap",
servo_restyle_damage="rebuild_and_reflow")}
// TODO(pcwalton): Support `word-break: keep-all` once we have better CJK support. // TODO(pcwalton): Support `word-break: keep-all` once we have better CJK support.
${helpers.single_keyword("word-break", ${helpers.single_keyword("word-break",
"normal break-all keep-all", "normal break-all keep-all",
gecko_constant_prefix="NS_STYLE_WORDBREAK", gecko_constant_prefix="NS_STYLE_WORDBREAK",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-text/#propdef-word-break")} spec="https://drafts.csswg.org/css-text/#propdef-word-break",
servo_restyle_damage="rebuild_and_reflow")}
// TODO(pcwalton): Support `text-justify: distribute`. // TODO(pcwalton): Support `text-justify: distribute`.
<%helpers:single_keyword <%helpers:single_keyword
@ -70,6 +74,7 @@ ${helpers.single_keyword("word-break",
gecko_pref="layout.css.text-justify.enabled" gecko_pref="layout.css.text-justify.enabled"
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-text-justify" spec="https://drafts.csswg.org/css-text/#propdef-text-justify"
servo_restyle_damage="rebuild_and_reflow"
> >
% if product == 'gecko': % if product == 'gecko':
impl ToComputedValue for SpecifiedValue { impl ToComputedValue for SpecifiedValue {
@ -113,21 +118,24 @@ ${helpers.predefined_type("text-align",
"computed::TextAlign::start()", "computed::TextAlign::start()",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-text-align")} spec="https://drafts.csswg.org/css-text/#propdef-text-align",
servo_restyle_damage = "reflow")}
${helpers.predefined_type("letter-spacing", ${helpers.predefined_type("letter-spacing",
"LetterSpacing", "LetterSpacing",
"computed::LetterSpacing::normal()", "computed::LetterSpacing::normal()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing")} spec="https://drafts.csswg.org/css-text/#propdef-letter-spacing",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("word-spacing", ${helpers.predefined_type("word-spacing",
"WordSpacing", "WordSpacing",
"computed::WordSpacing::normal()", "computed::WordSpacing::normal()",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text/#propdef-word-spacing")} spec="https://drafts.csswg.org/css-text/#propdef-word-spacing",
servo_restyle_damage="rebuild_and_reflow")}
<%helpers:single_keyword <%helpers:single_keyword
name="white-space" name="white-space"
@ -139,6 +147,7 @@ ${helpers.predefined_type("word-spacing",
// Only allowed for UA sheets, which set it !important. // Only allowed for UA sheets, which set it !important.
flags="APPLIES_TO_PLACEHOLDER" flags="APPLIES_TO_PLACEHOLDER"
spec="https://drafts.csswg.org/css-text/#propdef-white-space" spec="https://drafts.csswg.org/css-text/#propdef-white-space"
servo_restyle_damage="rebuild_and_reflow"
> >
% if product != "gecko": % if product != "gecko":
impl SpecifiedValue { impl SpecifiedValue {
@ -544,7 +553,8 @@ ${helpers.single_keyword("text-combine-upright", "none all",
${helpers.single_keyword("text-rendering", ${helpers.single_keyword("text-rendering",
"auto optimizespeed optimizelegibility geometricprecision", "auto optimizespeed optimizelegibility geometricprecision",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty")} spec="https://www.w3.org/TR/SVG11/painting.html#TextRenderingProperty",
servo_restyle_damage="rebuild_and_reflow")}
// FIXME Firefox expects the initial value of this property to change depending // FIXME Firefox expects the initial value of this property to change depending
// on the value of the layout.css.control-characters.visible pref. // on the value of the layout.css.control-characters.visible pref.

View file

@ -28,7 +28,8 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
malayalam mongolian myanmar oriya persian telugu thai tibetan cjk-earthly-branch malayalam mongolian myanmar oriya persian telugu thai tibetan cjk-earthly-branch
cjk-heavenly-stem lower-greek hiragana hiragana-iroha katakana katakana-iroha""", cjk-heavenly-stem lower-greek hiragana hiragana-iroha katakana katakana-iroha""",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type")} spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type",
servo_restyle_damage="rebuild_and_reflow")}
% else: % else:
${helpers.predefined_type("list-style-type", ${helpers.predefined_type("list-style-type",
"ListStyleType", "ListStyleType",
@ -36,7 +37,8 @@ ${helpers.single_keyword("list-style-position", "outside inside", animation_valu
initial_specified_value="specified::ListStyleType::disc()", initial_specified_value="specified::ListStyleType::disc()",
animation_value_type="discrete", animation_value_type="discrete",
boxed=True, boxed=True,
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type")} spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type",
servo_restyle_damage="rebuild_and_reflow")}
% endif % endif
${helpers.predefined_type("list-style-image", ${helpers.predefined_type("list-style-image",
@ -51,7 +53,8 @@ ${helpers.predefined_type("quotes",
"Quotes", "Quotes",
"computed::Quotes::get_initial_value()", "computed::Quotes::get_initial_value()",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-content/#propdef-quotes")} spec="https://drafts.csswg.org/css-content/#propdef-quotes",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("-moz-image-region", ${helpers.predefined_type("-moz-image-region",
"ClipRectOrAuto", "ClipRectOrAuto",

View file

@ -18,5 +18,6 @@
allow_quirks=not side[1], allow_quirks=not side[1],
animation_value_type="ComputedValue", logical = side[1], spec = spec, animation_value_type="ComputedValue", logical = side[1], spec = spec,
flags="APPLIES_TO_FIRST_LETTER", flags="APPLIES_TO_FIRST_LETTER",
allowed_in_page_rule=True)} allowed_in_page_rule=True,
servo_restyle_damage = "reflow")}
% endfor % endfor

View file

@ -21,5 +21,6 @@
logical = side[1], logical = side[1],
spec = spec, spec = spec,
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_PLACEHOLDER",
allow_quirks=not side[1])} allow_quirks=not side[1],
servo_restyle_damage = "reflow rebuild_and_reflow_inline")}
% endfor % endfor

View file

@ -14,7 +14,7 @@
"computed::LengthOrPercentageOrAuto::Auto", "computed::LengthOrPercentageOrAuto::Auto",
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side, spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
allow_quirks=True)} allow_quirks=True, servo_restyle_damage = "reflow_out_of_flow")}
% endfor % endfor
// offset-* logical properties, map to "top" / "left" / "bottom" / "right" // offset-* logical properties, map to "top" / "left" / "bottom" / "right"
% for side in LOGICAL_SIDES: % for side in LOGICAL_SIDES:
@ -55,25 +55,29 @@ ${helpers.predefined_type("z-index", "IntegerOrAuto",
// Flex container properties // Flex container properties
${helpers.single_keyword("flex-direction", "row row-reverse column column-reverse", ${helpers.single_keyword("flex-direction", "row row-reverse column column-reverse",
spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property", spec="https://drafts.csswg.org/css-flexbox/#flex-direction-property",
extra_prefixes="webkit", animation_value_type="discrete")} extra_prefixes="webkit", animation_value_type="discrete",
servo_restyle_damage = "reflow")}
${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse", ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property", spec="https://drafts.csswg.org/css-flexbox/#flex-wrap-property",
extra_prefixes="webkit", animation_value_type="discrete")} extra_prefixes="webkit", animation_value_type="discrete",
servo_restyle_damage = "reflow")}
% if product == "servo": % if product == "servo":
// FIXME: Update Servo to support the same Syntax as Gecko. // FIXME: Update Servo to support the same Syntax as Gecko.
${helpers.single_keyword("justify-content", "flex-start stretch flex-end center space-between space-around", ${helpers.single_keyword("justify-content", "flex-start stretch flex-end center space-between space-around",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-justify-content", spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
% else: % else:
${helpers.predefined_type(name="justify-content", ${helpers.predefined_type(name="justify-content",
type="JustifyContent", type="JustifyContent",
initial_value="specified::JustifyContent(specified::ContentDistribution::normal())", initial_value="specified::JustifyContent(specified::ContentDistribution::normal())",
spec="https://drafts.csswg.org/css-align/#propdef-justify-content", spec="https://drafts.csswg.org/css-align/#propdef-justify-content",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
% endif % endif
% if product == "servo": % if product == "servo":
@ -81,27 +85,31 @@ ${helpers.single_keyword("flex-wrap", "nowrap wrap wrap-reverse",
${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around", ${helpers.single_keyword("align-content", "stretch flex-start flex-end center space-between space-around",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-align/#propdef-align-content", spec="https://drafts.csswg.org/css-align/#propdef-align-content",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
${helpers.single_keyword("align-items", ${helpers.single_keyword("align-items",
"stretch flex-start flex-end center baseline", "stretch flex-start flex-end center baseline",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#align-items-property", spec="https://drafts.csswg.org/css-flexbox/#align-items-property",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
% else: % else:
${helpers.predefined_type(name="align-content", ${helpers.predefined_type(name="align-content",
type="AlignContent", type="AlignContent",
initial_value="specified::AlignContent(specified::ContentDistribution::normal())", initial_value="specified::AlignContent(specified::ContentDistribution::normal())",
spec="https://drafts.csswg.org/css-align/#propdef-align-content", spec="https://drafts.csswg.org/css-align/#propdef-align-content",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
${helpers.predefined_type(name="align-items", ${helpers.predefined_type(name="align-items",
type="AlignItems", type="AlignItems",
initial_value="specified::AlignItems::normal()", initial_value="specified::AlignItems::normal()",
spec="https://drafts.csswg.org/css-align/#propdef-align-items", spec="https://drafts.csswg.org/css-align/#propdef-align-items",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
#[cfg(feature = "gecko")] #[cfg(feature = "gecko")]
impl_align_conversions!(::values::specified::align::AlignItems); impl_align_conversions!(::values::specified::align::AlignItems);
@ -121,13 +129,15 @@ ${helpers.predefined_type("flex-grow", "NonNegativeNumber",
"From::from(0.0)", "From::from(0.0)",
spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property", spec="https://drafts.csswg.org/css-flexbox/#flex-grow-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="NonNegativeNumber")} animation_value_type="NonNegativeNumber",
servo_restyle_damage = "reflow")}
${helpers.predefined_type("flex-shrink", "NonNegativeNumber", ${helpers.predefined_type("flex-shrink", "NonNegativeNumber",
"From::from(1.0)", "From::from(1.0)",
spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property", spec="https://drafts.csswg.org/css-flexbox/#flex-shrink-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="NonNegativeNumber")} animation_value_type="NonNegativeNumber",
servo_restyle_damage = "reflow")}
// https://drafts.csswg.org/css-align/#align-self-property // https://drafts.csswg.org/css-align/#align-self-property
% if product == "servo": % if product == "servo":
@ -135,7 +145,8 @@ ${helpers.predefined_type("flex-shrink", "NonNegativeNumber",
${helpers.single_keyword("align-self", "auto stretch flex-start flex-end center baseline", ${helpers.single_keyword("align-self", "auto stretch flex-start flex-end center baseline",
extra_prefixes="webkit", extra_prefixes="webkit",
spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self", spec="https://drafts.csswg.org/css-flexbox/#propdef-align-self",
animation_value_type="discrete")} animation_value_type="discrete",
servo_restyle_damage = "reflow")}
% else: % else:
${helpers.predefined_type(name="align-self", ${helpers.predefined_type(name="align-self",
type="AlignSelf", type="AlignSelf",
@ -158,7 +169,8 @@ ${helpers.predefined_type("flex-shrink", "NonNegativeNumber",
${helpers.predefined_type("order", "Integer", "0", ${helpers.predefined_type("order", "Integer", "0",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="ComputedValue", animation_value_type="ComputedValue",
spec="https://drafts.csswg.org/css-flexbox/#order-property")} spec="https://drafts.csswg.org/css-flexbox/#order-property",
servo_restyle_damage = "reflow")}
% if product == "gecko": % if product == "gecko":
// FIXME: Gecko doesn't support content value yet. // FIXME: Gecko doesn't support content value yet.
@ -173,7 +185,8 @@ ${helpers.predefined_type("order", "Integer", "0",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="MozLength", animation_value_type="MozLength",
allow_quirks=True, allow_quirks=True,
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property" spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
servo_restyle_damage = "reflow"
)} )}
% else: % else:
// FIXME: This property should be animatable. // FIXME: This property should be animatable.
@ -182,7 +195,8 @@ ${helpers.predefined_type("order", "Integer", "0",
"computed::FlexBasis::auto()", "computed::FlexBasis::auto()",
spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property", spec="https://drafts.csswg.org/css-flexbox/#flex-basis-property",
extra_prefixes="webkit", extra_prefixes="webkit",
animation_value_type="none")} animation_value_type="none",
servo_restyle_damage = "reflow")}
% endif % endif
% for (size, logical) in ALL_SIZES: % for (size, logical) in ALL_SIZES:
<% <%
@ -208,7 +222,8 @@ ${helpers.predefined_type("order", "Integer", "0",
logical=logical, logical=logical,
allow_quirks=not logical, allow_quirks=not logical,
spec=spec % size, spec=spec % size,
animation_value_type="MozLength" animation_value_type="MozLength",
servo_restyle_damage = "reflow"
)} )}
// min-width, min-height, min-block-size, min-inline-size, // min-width, min-height, min-block-size, min-inline-size,
${helpers.predefined_type( ${helpers.predefined_type(
@ -219,7 +234,7 @@ ${helpers.predefined_type("order", "Integer", "0",
logical=logical, logical=logical,
allow_quirks=not logical, allow_quirks=not logical,
spec=spec % size, spec=spec % size,
animation_value_type="MozLength" animation_value_type="MozLength",
)} )}
${helpers.predefined_type( ${helpers.predefined_type(
"max-%s" % size, "max-%s" % size,
@ -239,7 +254,8 @@ ${helpers.predefined_type("order", "Integer", "0",
"parse_non_negative", "parse_non_negative",
spec=spec % size, spec=spec % size,
allow_quirks=not logical, allow_quirks=not logical,
animation_value_type="ComputedValue", logical = logical)} animation_value_type="ComputedValue", logical = logical,
servo_restyle_damage = "reflow")}
${helpers.predefined_type("min-%s" % size, ${helpers.predefined_type("min-%s" % size,
"LengthOrPercentage", "LengthOrPercentage",
"computed::LengthOrPercentage::Length(computed::Length::new(0.))", "computed::LengthOrPercentage::Length(computed::Length::new(0.))",

View file

@ -8,7 +8,8 @@
${helpers.single_keyword("table-layout", "auto fixed", ${helpers.single_keyword("table-layout", "auto fixed",
gecko_ffi_name="mLayoutStrategy", animation_value_type="discrete", gecko_ffi_name="mLayoutStrategy", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-tables/#propdef-table-layout")} spec="https://drafts.csswg.org/css-tables/#propdef-table-layout",
servo_restyle_damage = "reflow")}
${helpers.predefined_type("-x-span", ${helpers.predefined_type("-x-span",
"XSpan", "XSpan",

View file

@ -18,12 +18,14 @@ ${helpers.predefined_type("text-overflow",
animation_value_type="discrete", animation_value_type="discrete",
boxed=True, boxed=True,
flags="APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow")} spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword("unicode-bidi", ${helpers.single_keyword("unicode-bidi",
"normal embed isolate bidi-override isolate-override plaintext", "normal embed isolate bidi-override isolate-override plaintext",
animation_value_type="discrete", animation_value_type="discrete",
spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi")} spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.predefined_type("text-decoration-line", ${helpers.predefined_type("text-decoration-line",
"TextDecorationLine", "TextDecorationLine",
@ -31,7 +33,8 @@ ${helpers.predefined_type("text-decoration-line",
initial_specified_value="specified::TextDecorationLine::none()", initial_specified_value="specified::TextDecorationLine::none()",
animation_value_type="discrete", animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line")} spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line",
servo_restyle_damage="rebuild_and_reflow")}
${helpers.single_keyword("text-decoration-style", ${helpers.single_keyword("text-decoration-style",
"solid double dotted dashed wavy -moz-none", "solid double dotted dashed wavy -moz-none",

View file

@ -3870,3 +3870,28 @@ macro_rules! longhand_properties_idents {
} }
} }
} }
% if product == "servo":
% for effect_name in ["repaint", "reflow_out_of_flow", "reflow", "rebuild_and_reflow_inline", "rebuild_and_reflow"]:
macro_rules! restyle_damage_${effect_name} {
($old: ident, $new: ident, $damage: ident, [ $($effect:expr),* ]) => ({
if
% for style_struct in data.active_style_structs():
% for longhand in style_struct.longhands:
% if effect_name in longhand.servo_restyle_damage.split() and not longhand.logical:
$old.get_${style_struct.name_lower}().${longhand.ident} !=
$new.get_${style_struct.name_lower}().${longhand.ident} ||
% endif
% endfor
% endfor
false {
$damage.insert($($effect)|*);
true
} else {
false
}
})
}
% endfor
% endif

View file

@ -175,119 +175,32 @@ impl fmt::Display for ServoRestyleDamage {
} }
} }
// NB: We need the braces inside the RHS due to Rust #8012. This particular
// version of this macro might be safe anyway, but we want to avoid silent
// breakage on modifications.
macro_rules! add_if_not_equal(
($old:ident, $new:ident, $damage:ident,
[ $($effect:path),* ], [ $($style_struct_getter:ident.$name:ident),* ]) => ({
if $( ($old.$style_struct_getter().$name != $new.$style_struct_getter().$name) )||* {
$damage.insert($($effect)|*);
true
} else {
false
}
})
);
fn compute_damage(old: &ComputedValues, new: &ComputedValues) -> ServoRestyleDamage { fn compute_damage(old: &ComputedValues, new: &ComputedValues) -> ServoRestyleDamage {
let mut damage = ServoRestyleDamage::empty(); let mut damage = ServoRestyleDamage::empty();
// This should check every CSS property, as enumerated in the fields of // This should check every CSS property, as enumerated in the fields of
// http://doc.servo.org/style/properties/struct.ComputedValues.html // http://doc.servo.org/style/properties/struct.ComputedValues.html
// FIXME: Test somehow that every property is included. restyle_damage_rebuild_and_reflow!(old, new, damage,
add_if_not_equal!(old, new, damage,
[ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION, [ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION,
ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::BUBBLE_ISIZES, ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::BUBBLE_ISIZES,
ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW, ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW,
ServoRestyleDamage::RECONSTRUCT_FLOW], [ ServoRestyleDamage::RECONSTRUCT_FLOW]) ||
get_box.clear, get_box.float, get_box.display, get_box.position, get_counters.content, (new.get_box().display == Display::Inline &&
get_counters.counter_reset, get_counters.counter_increment, restyle_damage_rebuild_and_reflow_inline!(old, new, damage,
get_list.quotes, get_list.list_style_type,
// If these text or font properties change, we need to reconstruct the flow so that
// text shaping is re-run.
get_inheritedtext.letter_spacing, get_inheritedtext.text_rendering,
get_inheritedtext.text_transform, get_inheritedtext.word_spacing,
get_inheritedtext.overflow_wrap, get_inheritedtext.text_justify,
get_inheritedtext.white_space, get_inheritedtext.word_break, get_text.text_overflow,
get_font.font_family, get_font.font_style, get_font.font_variant_caps, get_font.font_weight,
get_font.font_size, get_font.font_stretch,
get_inheritedbox.direction, get_inheritedbox.writing_mode,
get_text.text_decoration_line, get_text.unicode_bidi,
get_inheritedtable.empty_cells, get_inheritedtable.caption_side,
get_column.column_width, get_column.column_count
]) || (new.get_box().display == Display::Inline &&
add_if_not_equal!(old, new, damage,
[ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION, [ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION,
ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::BUBBLE_ISIZES, ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::BUBBLE_ISIZES,
ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW, ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW,
ServoRestyleDamage::RECONSTRUCT_FLOW], [ ServoRestyleDamage::RECONSTRUCT_FLOW])) ||
// For inline boxes only, border/padding styles are used in flow construction (to decide restyle_damage_reflow!(old, new, damage,
// whether to create fragments for empty flows).
get_border.border_top_width, get_border.border_right_width,
get_border.border_bottom_width, get_border.border_left_width,
get_padding.padding_top, get_padding.padding_right,
get_padding.padding_bottom, get_padding.padding_left
])) || add_if_not_equal!(old, new, damage,
[ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION, [ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION,
ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::BUBBLE_ISIZES, ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::BUBBLE_ISIZES,
ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW], ServoRestyleDamage::REFLOW_OUT_OF_FLOW, ServoRestyleDamage::REFLOW]) ||
[get_border.border_top_width, get_border.border_right_width, restyle_damage_reflow_out_of_flow!(old, new, damage,
get_border.border_bottom_width, get_border.border_left_width,
get_margin.margin_top, get_margin.margin_right,
get_margin.margin_bottom, get_margin.margin_left,
get_padding.padding_top, get_padding.padding_right,
get_padding.padding_bottom, get_padding.padding_left,
get_position.width, get_position.height,
get_inheritedtext.line_height,
get_inheritedtext.text_align, get_inheritedtext.text_indent,
get_table.table_layout,
get_inheritedtable.border_collapse,
get_inheritedtable.border_spacing,
get_column.column_gap,
get_position.flex_direction,
get_position.flex_wrap,
get_position.justify_content,
get_position.align_items,
get_position.align_content,
get_position.order,
get_position.flex_basis,
get_position.flex_grow,
get_position.flex_shrink,
get_position.align_self
]) || add_if_not_equal!(old, new, damage,
[ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION, [ServoRestyleDamage::REPAINT, ServoRestyleDamage::REPOSITION,
ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::REFLOW_OUT_OF_FLOW], ServoRestyleDamage::STORE_OVERFLOW, ServoRestyleDamage::REFLOW_OUT_OF_FLOW]) ||
[get_position.top, get_position.left, restyle_damage_repaint!(old, new, damage,
get_position.right, get_position.bottom, [ServoRestyleDamage::REPAINT]);
get_effects.opacity,
get_box.transform, get_box.transform_style, get_box.transform_origin,
get_box.perspective, get_box.perspective_origin
]) || add_if_not_equal!(old, new, damage,
[ServoRestyleDamage::REPAINT], [
get_color.color, get_background.background_color,
get_background.background_image, get_background.background_position_x,
get_background.background_position_y, get_background.background_repeat,
get_background.background_attachment, get_background.background_clip,
get_background.background_origin, get_background.background_size,
get_border.border_top_color, get_border.border_right_color,
get_border.border_bottom_color, get_border.border_left_color,
get_border.border_top_style, get_border.border_right_style,
get_border.border_bottom_style, get_border.border_left_style,
get_border.border_top_left_radius, get_border.border_top_right_radius,
get_border.border_bottom_left_radius, get_border.border_bottom_right_radius,
get_position.z_index, get_box._servo_overflow_clip_box,
get_inheritedtext.text_decorations_in_effect,
get_pointing.cursor, get_pointing.pointer_events,
get_effects.box_shadow, get_effects.clip, get_inheritedtext.text_shadow, get_effects.filter,
get_effects.mix_blend_mode, get_inheritedbox.image_rendering,
// Note: May require REFLOW et al. if `visibility: collapse` is implemented.
get_inheritedbox.visibility
]);
// Paint worklets may depend on custom properties, // Paint worklets may depend on custom properties,