diff --git a/Documentation/CSSGeneratedFiles.md b/Documentation/CSSGeneratedFiles.md index 3f584ada81..0013c702ca 100644 --- a/Documentation/CSSGeneratedFiles.md +++ b/Documentation/CSSGeneratedFiles.md @@ -19,24 +19,25 @@ Each property will have some set of these fields on it: (Note that required fields are not required on properties with `legacy-alias-for` or `logical-alias-for` set.) -| Field | Required | Default | Description | Generated functions | -|-------------------------------------|----------|------------|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `affects-layout` | No | `true` | Boolean. Whether changing this property will invalidate the element's layout. | `bool property_affects_layout(PropertyID)` | -| `affects-stacking-context` | No | `false` | Boolean. Whether this property can cause a new stacking context for the element. | `bool property_affects_stacking_context(PropertyID)` | -| `animation-type` | Yes | | String. How the property should be animated. Defined by the spec. See below. | `AnimationType animation_type_from_longhand_property(PropertyID)` | -| `inherited` | Yes | | Boolean. Whether the property is inherited by its child elements. Only applicable to longhand properties. | `bool is_inherited_property(PropertyID)` | -| `initial` | Yes | | String. The property's initial value if it is not specified. | `NonnullRefPtr property_initial_value(PropertyID)` | -| `legacy-alias-for` | No | Nothing | String. The name of a property this is an alias for. See below. | | -| `logical-alias-for` | No | Nothing | An object. See below. | `bool property_is_logical_alias(PropertyID);`
`PropertyID map_logical_alias_to_physical_property(PropertyID, LogicalAliasMappingContext const&)` | -| `longhands` | No | `[]` | Array of strings. If this is a shorthand, these are the property names that it expands out into. | `Vector longhands_for_shorthand(PropertyID)`
`Vector expanded_longhands_for_shorthand(PropertyID)`
`Vector shorthands_for_longhand(PropertyID)` | -| `max-values` | No | `1` | Integer. How many values can be parsed for this property. eg, `margin` can have up to 4 values. | `size_t property_maximum_value_count(PropertyID)` | -| `multiplicity` | No | `"single"` | String. Category for whether this property is a single value or a list of values. See below. | `bool property_is_single_valued(PropertyID)`
`bool property_is_list_valued(PropertyID)`
`PropertyMultiplicity property_multiplicity(PropertyID)` | -| `percentages-resolve-to` | No | Nothing | String. What type percentages get resolved to. eg, for `width` percentages are resolved to `length` values. | `Optional property_resolves_percentages_relative_to(PropertyID)` | -| `positional-value-list-shorthand` | No | `false` | Boolean. Whether this property is a "positional value list shorthand". See below. | `bool property_is_positional_value_list_shorthand(PropertyID)` | -| `quirks` | No | `[]` | Array of strings. Some properties have special behavior in "quirks mode", which are listed here. See below. | `bool property_has_quirk(PropertyID, Quirk)` | -| `valid-identifiers` | No | `[]` | Array of strings. Which keywords the property accepts. See below. | `bool property_accepts_keyword(PropertyID, Keyword)`
`Optional resolve_legacy_value_alias(PropertyID, Keyword)` | -| `valid-types` | No | `[]` | Array of strings. Which value types the property accepts. See below. | `bool property_accepts_type(PropertyID, ValueType)` | -| `needs-layout-for-getcomputedstyle` | No | `false` | Boolean. Whether this property requires up-to-date layout before it could be queried by getComputedStyle() | `bool property_needs_layout_for_getcomputedstyle(PropertyID)` | +| Field | Required | Default | Description | Generated functions | +|-------------------------------------|----------|------------|-------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `affects-layout` | No | `true` | Boolean. Whether changing this property will invalidate the element's layout. | `bool property_affects_layout(PropertyID)` | +| `affects-stacking-context` | No | `false` | Boolean. Whether this property can cause a new stacking context for the element. | `bool property_affects_stacking_context(PropertyID)` | +| `animation-type` | Yes | | String. How the property should be animated. Defined by the spec. See below. | `AnimationType animation_type_from_longhand_property(PropertyID)` | +| `inherited` | Yes | | Boolean. Whether the property is inherited by its child elements. Only applicable to longhand properties. | `bool is_inherited_property(PropertyID)` | +| `initial` | Yes | | String. The property's initial value if it is not specified. | `NonnullRefPtr property_initial_value(PropertyID)` | +| `legacy-alias-for` | No | Nothing | String. The name of a property this is an alias for. See below. | | +| `logical-alias-for` | No | Nothing | An object. See below. | `bool property_is_logical_alias(PropertyID);`
`PropertyID map_logical_alias_to_physical_property(PropertyID, LogicalAliasMappingContext const&)` | +| `longhands` | No | `[]` | Array of strings. If this is a shorthand, these are the property names that it expands out into. | `Vector longhands_for_shorthand(PropertyID)`
`Vector expanded_longhands_for_shorthand(PropertyID)`
`Vector shorthands_for_longhand(PropertyID)` | +| `max-values` | No | `1` | Integer. How many values can be parsed for this property. eg, `margin` can have up to 4 values. | `size_t property_maximum_value_count(PropertyID)` | +| `multiplicity` | No | `"single"` | String. Category for whether this property is a single value or a list of values. See below. | `bool property_is_single_valued(PropertyID)`
`bool property_is_list_valued(PropertyID)`
`PropertyMultiplicity property_multiplicity(PropertyID)` | +| `percentages-resolve-to` | No | Nothing | String. What type percentages get resolved to. eg, for `width` percentages are resolved to `length` values. | `Optional property_resolves_percentages_relative_to(PropertyID)` | +| `positional-value-list-shorthand` | No | `false` | Boolean. Whether this property is a "positional value list shorthand". See below. | `bool property_is_positional_value_list_shorthand(PropertyID)` | +| `quirks` | No | `[]` | Array of strings. Some properties have special behavior in "quirks mode", which are listed here. See below. | `bool property_has_quirk(PropertyID, Quirk)` | +| `requires-computation` | Yes | | String. When a property's value needs to be run through the computation process. See below. | `bool property_requires_computation_with_inherited_value(PropertyID)`
`bool property_requires_computation_with_initial_value(PropertyID)`
`bool property_requires_computation_with_cascaded_value(PropertyID)` | +| `valid-identifiers` | No | `[]` | Array of strings. Which keywords the property accepts. See below. | `bool property_accepts_keyword(PropertyID, Keyword)`
`Optional resolve_legacy_value_alias(PropertyID, Keyword)` | +| `valid-types` | No | `[]` | Array of strings. Which value types the property accepts. See below. | `bool property_accepts_type(PropertyID, ValueType)` | +| `needs-layout-for-getcomputedstyle` | No | `false` | Boolean. Whether this property requires up-to-date layout before it could be queried by getComputedStyle() | `bool property_needs_layout_for_getcomputedstyle(PropertyID)` | ### `animation-type` @@ -96,6 +97,30 @@ The [Quirks spec](https://quirks.spec.whatwg.org/#css) defines these. | The hashless hex color quirk | `hashless-hex-color` | | The unitless length quirk | `unitless-length` | +### `requires-computation` + +There are three ways the specified value of a property on an element can be determined: + +- Inherited, e.g. it is an inherited property and no value has been specified, or the `inherit` keyword has been + specified +- Initial, e.g. it is _not_ an inherited property and no value has been specified, or the `initial` keyword has been + specified +- Cascaded, a value has been cascaded for this element based on the styles + +We then turn that specified value into a computed value by running the computation (see +`StyleComputer::compute_value_of_property`). + +Depending on the property, we know that for some of the above cases the computed value is guaranteed to be the same as +the specified value, by specifying the cases where it _isn't_ we can limit running the computation process to only when +required. + +| Value | Behavior | +| --------------------- | ------------------------------------------------------------------------------------------------------------- | +| `always` | Always runs the computation process, regardless of how the specified value was determined | +| `non-inherited-value` | Only run the computation process if the specified value was determined based on the initial or cascaded value | +| `cascaded-value` | Only run the computation process if the specified value was determined based on a cascaded value | +| `never` | Always skip the computation process | + ### `valid-identifiers` A list of CSS keyword names, that the property accepts. Consider defining an enum instead and putting its name in the diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index 3f28a7f95d..eaf95d0779 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -152,6 +152,7 @@ "inherited": true, "initial": "currentColor", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ] @@ -188,6 +189,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "color" ], @@ -199,6 +201,7 @@ "animation-type": "discrete", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-types": [ "align-content" ] @@ -207,6 +210,7 @@ "animation-type": "discrete", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-types": [ "align-items" ] @@ -215,6 +219,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "align-self" ] @@ -230,6 +235,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "dashed-ident" ], @@ -242,6 +248,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "dashed-ident" ], @@ -271,6 +278,7 @@ "animation-type": "none", "inherited": false, "initial": "replace", + "requires-computation": "never", "valid-types": [ "animation-composition" ], @@ -281,6 +289,7 @@ "animation-type": "none", "inherited": false, "initial": "0s", + "requires-computation": "cascaded-value", "multiplicity": "coordinating-list", "valid-types": [ "time [-∞,∞]" @@ -292,6 +301,7 @@ "inherited": false, "initial": "normal", "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-identifiers": [ "normal", "reverse", @@ -306,6 +316,7 @@ "initial": "0s", "multiplicity": "coordinating-list", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "time [0,∞]" ], @@ -319,6 +330,7 @@ "inherited": false, "initial": "none", "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-identifiers": [ "none", "forwards", @@ -332,6 +344,7 @@ "inherited": false, "initial": "1", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "number [0,∞]" ], @@ -345,6 +358,7 @@ "inherited": false, "initial": "none", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "string", "custom-ident ![none]" @@ -359,6 +373,7 @@ "inherited": false, "initial": "running", "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-identifiers": [ "running", "paused" @@ -369,6 +384,7 @@ "animation-type": "none", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "dashed-ident", "scroll-function", @@ -386,6 +402,7 @@ "inherited": false, "initial": "ease", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "easing-function", "easing-keyword" @@ -395,6 +412,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "appearance" ] @@ -404,6 +422,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "ratio" ], @@ -420,6 +439,7 @@ "needs-layout-node-for-resolved-value": true, "__comment": "FIXME: List `filter-value-list` as a valid-type once it's generically supported.", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-identifiers": [ "none" ] @@ -445,6 +465,7 @@ "inherited": false, "initial": "scroll", "multiplicity": "coordinating-list", + "requires-computation": "always", "valid-types": [ "background-attachment" ] @@ -455,6 +476,7 @@ "inherited": false, "initial": "normal", "multiplicity": "coordinating-list", + "requires-computation": "always", "valid-types": [ "mix-blend-mode" ] @@ -466,6 +488,7 @@ "initial": "border-box", "multiplicity": "coordinating-list", "__comment": "FIXME: Support `border-area`", + "requires-computation": "always", "valid-types": [ "background-box" ] @@ -476,6 +499,7 @@ "inherited": false, "initial": "transparent", "needs-layout-node-for-resolved-value": true, + "requires-computation": "non-inherited-value", "valid-types": [ "color" ], @@ -489,6 +513,7 @@ "inherited": false, "initial": "none", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "image" ], @@ -503,6 +528,7 @@ "initial": "padding-box", "multiplicity": "coordinating-list", "__comment": "FIXME: This shouldn't allow `text`", + "requires-computation": "always", "valid-types": [ "background-box" ] @@ -530,6 +556,7 @@ "inherited": false, "initial": "0%", "multiplicity": "coordinating-list", + "requires-computation": "always", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -547,6 +574,7 @@ "inherited": false, "initial": "0%", "multiplicity": "coordinating-list", + "requires-computation": "always", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -565,6 +593,7 @@ "initial": "repeat", "multiplicity": "coordinating-list", "max-values": 2, + "requires-computation": "always", "valid-types": [ "repetition" ], @@ -580,6 +609,7 @@ "initial": "auto", "multiplicity": "coordinating-list", "max-values": 2, + "requires-computation": "always", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -732,6 +762,7 @@ "initial": "currentcolor", "inherited": false, "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ], @@ -745,6 +776,7 @@ "initial": "0", "inherited": false, "max-values": 2, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -757,6 +789,7 @@ "initial": "0", "inherited": false, "max-values": 2, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -767,6 +800,7 @@ "animation-type": "discrete", "initial": "none", "inherited": false, + "requires-computation": "never", "valid-types": [ "line-style" ] @@ -775,6 +809,7 @@ "animation-type": "by-computed-value", "initial": "medium", "inherited": false, + "requires-computation": "non-inherited-value", "valid-types": [ "length [0,∞]", "line-width" @@ -789,6 +824,7 @@ "animation-type": "discrete", "inherited": true, "initial": "separate", + "requires-computation": "never", "valid-types": [ "border-collapse" ] @@ -840,6 +876,7 @@ "inherited": false, "initial": "0", "max-values": 4, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "number [0,∞]" @@ -851,6 +888,7 @@ "inherited": false, "initial": "stretch", "max-values": 2, + "requires-computation": "never", "valid-types": [ "border-image-repeat" ] @@ -860,6 +898,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "100%", + "requires-computation": "cascaded-value", "valid-identifiers": [ "fill" ], @@ -874,6 +913,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "cascaded-value", "valid-types": [ "image" ], @@ -887,6 +927,7 @@ "inherited": false, "initial": "1", "max-values": 4, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]", @@ -1015,6 +1056,7 @@ "initial": "currentcolor", "inherited": false, "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ], @@ -1026,6 +1068,7 @@ "animation-type": "discrete", "initial": "none", "inherited": false, + "requires-computation": "never", "valid-types": [ "line-style" ] @@ -1034,6 +1077,7 @@ "animation-type": "by-computed-value", "initial": "medium", "inherited": false, + "requires-computation": "non-inherited-value", "valid-types": [ "length [0,∞]", "line-width" @@ -1072,6 +1116,7 @@ "initial": "currentcolor", "inherited": false, "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ], @@ -1083,6 +1128,7 @@ "animation-type": "discrete", "initial": "none", "inherited": false, + "requires-computation": "never", "valid-types": [ "line-style" ] @@ -1091,6 +1137,7 @@ "animation-type": "by-computed-value", "initial": "medium", "inherited": false, + "requires-computation": "non-inherited-value", "valid-types": [ "length [0,∞]", "line-width" @@ -1106,6 +1153,7 @@ "inherited": true, "initial": "0", "max-values": 2, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]" ], @@ -1154,6 +1202,7 @@ "initial": "currentcolor", "inherited": false, "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ], @@ -1167,6 +1216,7 @@ "initial": "0", "inherited": false, "max-values": 2, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -1179,6 +1229,7 @@ "initial": "0", "inherited": false, "max-values": 2, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -1189,6 +1240,7 @@ "animation-type": "discrete", "initial": "none", "inherited": false, + "requires-computation": "never", "valid-types": [ "line-style" ] @@ -1197,6 +1249,7 @@ "animation-type": "by-computed-value", "initial": "medium", "inherited": false, + "requires-computation": "non-inherited-value", "valid-types": [ "length [0,∞]", "line-width" @@ -1227,6 +1280,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]", @@ -1247,6 +1301,7 @@ "inherited": false, "initial": "none", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "multiplicity": "list", "valid-identifiers": [ "none" @@ -1256,6 +1311,7 @@ "animation-type": "discrete", "inherited": false, "initial": "content-box", + "requires-computation": "never", "valid-types": [ "box-sizing" ] @@ -1264,6 +1320,7 @@ "animation-type": "discrete", "inherited": true, "initial": "top", + "requires-computation": "never", "valid-types": [ "caption-side" ] @@ -1274,6 +1331,7 @@ "inherited": true, "initial": "auto", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -1285,6 +1343,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "clear" ] @@ -1294,6 +1353,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -1309,6 +1369,7 @@ "affects-layout": false, "affects-stacking-context": true, "inherited": false, + "requires-computation": "cascaded-value", "valid-identifiers": [ "none" ], @@ -1324,6 +1385,7 @@ "animation-type": "discrete", "inherited": true, "initial": "nonzero", + "requires-computation": "never", "valid-types": [ "fill-rule" ] @@ -1334,6 +1396,7 @@ "inherited": true, "initial": "canvastext", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ], @@ -1346,6 +1409,7 @@ "animation-type": "discrete", "inherited": true, "initial": "srgb", + "requires-computation": "never", "valid-types": [ "color-interpolation" ] @@ -1355,6 +1419,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "custom-ident ![normal,light,dark,only]" ], @@ -1368,6 +1433,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "integer [1,∞]" ], @@ -1379,6 +1445,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "normal", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -1392,6 +1459,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]" ], @@ -1403,6 +1471,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "column-span" ] @@ -1411,6 +1480,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]" ], @@ -1432,6 +1502,7 @@ "inherited": false, "initial": "none", "needs-layout-node-for-resolved-value": true, + "requires-computation": "never", "valid-types": [ "contain" ] @@ -1441,6 +1512,7 @@ "animation-type": "none", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-identifiers": [ "normal", "size", @@ -1453,6 +1525,7 @@ "inherited": false, "initial": "normal", "__comment": "FIXME: This accepts a whole lot of other types and identifiers!", + "requires-computation": "cascaded-value", "valid-types": [ "counter", "image", @@ -1471,6 +1544,7 @@ "animation-type": "custom", "inherited": false, "initial": "visible", + "requires-computation": "never", "valid-types": [ "content-visibility" ] @@ -1501,6 +1575,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "round", + "requires-computation": "non-inherited-value", "valid-types": [ "corner-shape" ] @@ -1509,6 +1584,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "round", + "requires-computation": "non-inherited-value", "valid-types": [ "corner-shape" ] @@ -1609,6 +1685,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "round", + "requires-computation": "non-inherited-value", "valid-types": [ "corner-shape" ] @@ -1617,6 +1694,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "round", + "requires-computation": "non-inherited-value", "valid-types": [ "corner-shape" ] @@ -1637,6 +1715,7 @@ "inherited": false, "initial": "none", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-types": [ "custom-ident ![none]", "integer [-∞,∞]" @@ -1650,6 +1729,7 @@ "inherited": false, "initial": "none", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-types": [ "custom-ident ![none]", "integer [-∞,∞]" @@ -1663,6 +1743,7 @@ "inherited": false, "initial": "none", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-types": [ "custom-ident ![none]", "integer [-∞,∞]" @@ -1676,6 +1757,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "url", "cursor-predefined", @@ -1687,6 +1769,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -1701,6 +1784,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -1714,6 +1798,7 @@ "animation-type": "none", "inherited": true, "initial": "ltr", + "requires-computation": "never", "valid-types": [ "direction" ] @@ -1722,6 +1807,7 @@ "animation-type": "custom", "inherited": false, "initial": "inline", + "requires-computation": "never", "max-values": 3, "valid-identifiers": [ "list-item" @@ -1738,6 +1824,7 @@ "animation-type": "discrete", "inherited": true, "initial": "show", + "requires-computation": "never", "valid-types": [ "empty-cells" ] @@ -1747,6 +1834,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "black", + "requires-computation": "non-inherited-value", "valid-types": [ "paint" ] @@ -1756,6 +1844,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "1", + "requires-computation": "cascaded-value", "valid-types": [ "opacity" ] @@ -1765,6 +1854,7 @@ "animation-type": "discrete", "inherited": true, "initial": "nonzero", + "requires-computation": "never", "valid-types": [ "fill-rule" ] @@ -1778,6 +1868,7 @@ "needs-layout-node-for-resolved-value": true, "__comment": "FIXME: List `filter-value-list` as a valid-type once it's generically supported.", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-identifiers": [ "none" ] @@ -1797,6 +1888,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -1814,6 +1906,7 @@ "animation-type": "discrete", "inherited": false, "initial": "row", + "requires-computation": "never", "valid-types": [ "flex-direction" ] @@ -1829,6 +1922,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "number [0,∞]" ] @@ -1837,6 +1931,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "1", + "requires-computation": "cascaded-value", "valid-types": [ "number [0,∞]" ] @@ -1845,6 +1940,7 @@ "animation-type": "discrete", "inherited": false, "initial": "nowrap", + "requires-computation": "never", "valid-types": [ "flex-wrap" ] @@ -1853,6 +1949,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "float" ] @@ -1862,6 +1959,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "black", + "requires-computation": "non-inherited-value", "valid-types": [ "color" ] @@ -1871,6 +1969,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "1", + "requires-computation": "cascaded-value", "valid-types": [ "opacity" ] @@ -1898,6 +1997,7 @@ "inherited": true, "initial": "serif", "multiplicity": "list", + "requires-computation": "never", "valid-types": [ "custom-ident", "string" @@ -1908,6 +2008,7 @@ "inherited": true, "initial": "normal", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-types": [ "integer [0,∞]", "opentype-tag" @@ -1922,6 +2023,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "font-kerning" ] @@ -1930,6 +2032,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "string" ], @@ -1941,6 +2044,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "font-optical-sizing" ] @@ -1949,6 +2053,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "medium", + "requires-computation": "non-inherited-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]", @@ -1970,6 +2075,7 @@ "animation-type": "custom", "inherited": true, "initial": "normal", + "requires-computation": "cascaded-value", "valid-types": [ "font-style" ] @@ -1993,6 +2099,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-alternates" ] @@ -2001,6 +2108,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-caps" ] @@ -2009,6 +2117,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-east-asian" ] @@ -2017,6 +2126,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-emoji" ] @@ -2025,6 +2135,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-ligatures" ] @@ -2033,6 +2144,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-numeric" ] @@ -2041,6 +2153,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "font-variant-position" ] @@ -2050,6 +2163,7 @@ "inherited": true, "initial": "normal", "multiplicity": "list", + "requires-computation": "cascaded-value", "valid-types": [ "number", "opentype-tag" @@ -2063,6 +2177,7 @@ "inherited": true, "initial": "normal", "needs-layout-node-for-resolved-value": true, + "requires-computation": "non-inherited-value", "valid-types": [ "number [1,1000]" ], @@ -2078,6 +2193,7 @@ "inherited": true, "initial": "normal", "needs-layout-node-for-resolved-value": true, + "requires-computation": "non-inherited-value", "valid-types": [ "percentage [0,∞]", "font-width" @@ -2138,6 +2254,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -2151,12 +2268,14 @@ "grid-auto-flow": { "animation-type": "discrete", "inherited": false, - "initial": "row" + "initial": "row", + "requires-computation": "never" }, "grid-auto-rows": { "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -2184,6 +2303,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-identifiers": [ "auto" ], @@ -2198,6 +2318,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-identifiers": [ "auto" ], @@ -2225,6 +2346,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-identifiers": [ "auto" ], @@ -2239,6 +2361,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-identifiers": [ "auto" ], @@ -2268,6 +2391,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-identifiers": [ "none" ], @@ -2280,6 +2404,7 @@ "inherited": false, "initial": "none", "max-values": 4, + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -2296,6 +2421,7 @@ "inherited": false, "initial": "none", "max-values": 4, + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -2311,6 +2437,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -2332,6 +2459,7 @@ "affects-layout": false, "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "image-rendering" ] @@ -2434,6 +2562,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "isolation" ] @@ -2442,6 +2571,7 @@ "animation-type": "discrete", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-types": [ "justify-content" ] @@ -2450,6 +2580,7 @@ "animation-type": "discrete", "inherited": false, "initial": "legacy", + "requires-computation": "never", "valid-types": [ "justify-items" ] @@ -2458,6 +2589,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "justify-self" ] @@ -2466,6 +2598,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]", @@ -2485,6 +2618,7 @@ "inherited": true, "initial": "normal", "needs-layout-node-for-resolved-value": true, + "requires-computation": "non-inherited-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -2502,6 +2636,7 @@ "inherited": true, "initial": "normal", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "number [0,∞]", @@ -2525,6 +2660,7 @@ "animation-type": "discrete", "inherited": true, "initial": "none", + "requires-computation": "cascaded-value", "valid-types": [ "image" ], @@ -2536,6 +2672,7 @@ "animation-type": "discrete", "inherited": true, "initial": "outside", + "requires-computation": "never", "valid-types": [ "list-style-position" ] @@ -2544,6 +2681,7 @@ "animation-type": "discrete", "inherited": true, "initial": "disc", + "requires-computation": "never", "valid-types": [ "counter-style", "string" @@ -2609,6 +2747,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -2657,6 +2796,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -2674,6 +2814,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -2691,6 +2832,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -2725,6 +2867,7 @@ "inherited": false, "affects-layout": false, "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-types": [ "coord-box" ], @@ -2738,6 +2881,7 @@ "inherited": false, "affects-layout": false, "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-types": [ "compositing-operator" ], @@ -2749,6 +2893,7 @@ "affects-layout": false, "affects-stacking-context": true, "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "image", "url" @@ -2763,6 +2908,7 @@ "inherited": false, "affects-layout": false, "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-types": [ "masking-mode" ], @@ -2773,6 +2919,7 @@ "inherited": false, "affects-layout": false, "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-types": [ "coord-box" ], @@ -2784,6 +2931,7 @@ "inherited": false, "initial": "0% 0%", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "position" ], @@ -2796,6 +2944,7 @@ "initial": "repeat", "multiplicity": "coordinating-list", "max-values": 2, + "requires-computation": "never", "valid-types": [ "repetition" ], @@ -2811,6 +2960,7 @@ "initial": "auto", "multiplicity": "coordinating-list", "max-values": 2, + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -2827,6 +2977,7 @@ "inherited": false, "affects-layout": false, "multiplicity": "single", + "requires-computation": "never", "valid-types": [ "mask-type" ], @@ -2838,6 +2989,7 @@ "initial": "0", "needs-layout-node-for-resolved-value": true, "__comment": "FIXME: `add()` is also valid but we can't represent that here yet.", + "requires-computation": "cascaded-value", "valid-types": [ "integer" ], @@ -2849,6 +3001,7 @@ "animation-type": "none", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "math-shift" ] @@ -2857,6 +3010,7 @@ "animation-type": "none", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-types": [ "math-style" ] @@ -2872,6 +3026,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "none", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -2898,6 +3053,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "none", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -2924,6 +3080,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -2950,6 +3107,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -2970,6 +3128,7 @@ "animation-type": "discrete", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-types": [ "mix-blend-mode" ] @@ -2979,6 +3138,7 @@ "animation-type": "discrete", "inherited": false, "initial": "fill", + "requires-computation": "never", "valid-types": [ "object-fit" ] @@ -2989,6 +3149,7 @@ "affects-layout": false, "inherited": false, "initial": "50% 50%", + "requires-computation": "cascaded-value", "valid-types": [ "position" ], @@ -3000,6 +3161,7 @@ "affects-stacking-context": true, "inherited": false, "initial": "1", + "requires-computation": "cascaded-value", "valid-types": [ "opacity" ] @@ -3008,6 +3170,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "integer [-∞,∞]" ] @@ -3016,6 +3179,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "2", + "requires-computation": "cascaded-value", "valid-types": [ "integer [1,∞]" ], @@ -3037,6 +3201,7 @@ "__comment": "FIXME: We don't yet support `invert`. Until we do, the spec directs us to use `currentColor` as the default instead, and reject `invert`", "initial": "currentColor", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ] @@ -3046,6 +3211,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]" ] @@ -3055,6 +3221,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "outline-style" ] @@ -3064,6 +3231,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "medium", + "requires-computation": "non-inherited-value", "valid-types": [ "length [0,∞]", "line-width" @@ -3099,6 +3267,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-identifiers": [ "anywhere", "break-word", @@ -3109,6 +3278,7 @@ "animation-type": "discrete", "inherited": false, "initial": "visible", + "requires-computation": "never", "valid-types": [ "overflow" ], @@ -3120,6 +3290,7 @@ "animation-type": "discrete", "inherited": false, "initial": "visible", + "requires-computation": "never", "valid-types": [ "overflow" ], @@ -3178,6 +3349,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3219,6 +3391,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3233,6 +3406,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3247,6 +3421,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3261,6 +3436,7 @@ "animation-type": "discrete", "inherited": true, "initial": "normal", + "requires-computation": "never", "valid-identifiers": [ "normal" ], @@ -3272,6 +3448,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "none", + "requires-computation": "cascaded-value", "valid-identifiers": [ "none" ], @@ -3284,6 +3461,7 @@ "affects-layout": false, "inherited": false, "initial": "50% 50%", + "requires-computation": "cascaded-value", "valid-types": [ "position" ], @@ -3315,6 +3493,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "pointer-events" ] @@ -3323,6 +3502,7 @@ "animation-type": "discrete", "inherited": false, "initial": "static", + "requires-computation": "never", "valid-types": [ "positioning" ] @@ -3331,6 +3511,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "dashed-ident" ], @@ -3343,6 +3524,7 @@ "__comment": "Animation type is currently listed as TBD in the specification", "inherited": false, "initial": "none", + "requires-computation": "cascaded-value", "valid-types": [ "position-area" ], @@ -3354,6 +3536,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "dashed-ident", "try-tactic" @@ -3366,6 +3549,7 @@ "animation-type": "discrete", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-types": [ "try-order" ], @@ -3377,6 +3561,7 @@ "animation-type": "discrete", "inherited": false, "initial": "anchors-visible", + "requires-computation": "never", "valid-identifiers": [ "always", "anchors-valid", @@ -3389,6 +3574,7 @@ "inherited": true, "initial": "auto", "multiplicity": "list", + "requires-computation": "never", "valid-types": [ "string" ], @@ -3402,6 +3588,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3416,6 +3603,7 @@ "inherited": false, "affects-layout": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "resize" ] @@ -3424,6 +3612,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]", @@ -3443,12 +3632,14 @@ "inherited": false, "initial": "none", "affects-layout": false, - "affects-stacking-context": true + "affects-stacking-context": true, + "requires-computation": "cascaded-value" }, "row-gap": { "animation-type": "by-computed-value", "inherited": false, "initial": "normal", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3463,6 +3654,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3480,6 +3672,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3497,7 +3690,8 @@ "inherited": false, "initial": "none", "affects-layout": false, - "affects-stacking-context": true + "affects-stacking-context": true, + "requires-computation": "cascaded-value" }, "scroll-timeline": { "affects-layout": false, @@ -3513,6 +3707,7 @@ "animation-type": "none", "inherited": false, "initial": "block", + "requires-computation": "never", "valid-types": [ "axis" ], @@ -3523,6 +3718,7 @@ "animation-type": "none", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-identifiers": [ "none" ], @@ -3535,20 +3731,23 @@ "affects-layout": false, "animation-type": "by-computed-value", "inherited": true, - "initial": "auto" + "initial": "auto", + "requires-computation": "cascaded-value" }, "scrollbar-gutter": { "affects-layout": false, "animation-type": "discrete", "__comment": "This property should affect layout per-spec, but ladybird always uses overlay scrollbars so it doesn't in practice.", "inherited": false, - "initial": "auto" + "initial": "auto", + "requires-computation": "never" }, "scrollbar-width": { "affects-layout": false, "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "scrollbar-width" ], @@ -3563,6 +3762,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "opacity" ] @@ -3571,6 +3771,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "percentage [0,∞]" @@ -3581,13 +3782,15 @@ "affects-layout": true, "animation-type": "by-computed-value", "inherited": false, - "initial": "none" + "initial": "none", + "requires-computation": "cascaded-value" }, "shape-rendering": { "affects-layout": true, "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "shape-rendering" ] @@ -3597,6 +3800,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "black", + "requires-computation": "non-inherited-value", "valid-types": [ "color" ] @@ -3606,6 +3810,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "1", + "requires-computation": "cascaded-value", "valid-types": [ "opacity" ] @@ -3615,6 +3820,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "none", + "requires-computation": "cascaded-value", "valid-types": [ "paint" ] @@ -3624,13 +3830,15 @@ "inherited": true, "initial": "none", "affects-layout": false, - "percentages-resolve-to": "length" + "percentages-resolve-to": "length", + "requires-computation": "cascaded-value" }, "stroke-dashoffset": { "affects-layout": false, "animation-type": "by-computed-value", "inherited": true, "initial": "0px", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "number [0,∞]", @@ -3643,6 +3851,7 @@ "animation-type": "discrete", "inherited": true, "initial": "butt", + "requires-computation": "never", "valid-types": [ "stroke-linecap" ] @@ -3652,6 +3861,7 @@ "animation-type": "discrete", "inherited": true, "initial": "miter", + "requires-computation": "never", "valid-types": [ "stroke-linejoin" ] @@ -3661,6 +3871,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "4", + "requires-computation": "cascaded-value", "valid-types": [ "number [0,∞]" ] @@ -3670,6 +3881,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "1", + "requires-computation": "cascaded-value", "valid-types": [ "opacity" ] @@ -3679,6 +3891,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "1px", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "number [0,∞]", @@ -3690,6 +3903,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "8", + "requires-computation": "cascaded-value", "valid-types": [ "length [0,∞]", "number [0,∞]" @@ -3699,6 +3913,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "table-layout" ] @@ -3707,6 +3922,7 @@ "animation-type": "discrete", "inherited": true, "initial": "start", + "requires-computation": "never", "valid-types": [ "text-align" ] @@ -3715,6 +3931,7 @@ "animation-type": "discrete", "inherited": true, "initial": "start", + "requires-computation": "never", "valid-types": [ "text-anchor" ] @@ -3735,6 +3952,7 @@ "inherited": false, "initial": "currentcolor", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "color" ] @@ -3745,6 +3963,7 @@ "__comment": "FIXME: This property is not supposed to be inherited, but we currently rely on inheritance to propagate decorations into line boxes.", "inherited": true, "initial": "none", + "requires-computation": "never", "valid-types": [ "text-decoration-line" ] @@ -3754,6 +3973,7 @@ "animation-type": "discrete", "inherited": false, "initial": "solid", + "requires-computation": "never", "valid-types": [ "text-decoration-style" ] @@ -3763,6 +3983,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -3777,6 +3998,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -3794,6 +4016,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "text-justify" ], @@ -3806,6 +4029,7 @@ "animation-type": "discrete", "inherited": false, "initial": "clip", + "requires-computation": "never", "valid-types": [ "text-overflow" ] @@ -3815,6 +4039,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "text-rendering" ] @@ -3825,6 +4050,7 @@ "inherited": true, "initial": "none", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-identifiers": [ "none" ] @@ -3834,6 +4060,7 @@ "animation-type": "discrete", "inherited": true, "initial": "none", + "requires-computation": "never", "valid-types": [ "text-transform" ] @@ -3842,6 +4069,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "auto", + "requires-computation": "cascaded-value", "valid-identifiers": [ "auto" ], @@ -3855,6 +4083,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "text-underline-position-horizontal", "text-underline-position-vertical" @@ -3871,6 +4100,7 @@ "animation-type": "discrete", "inherited": true, "initial": "wrap", + "requires-computation": "never", "valid-types": [ "text-wrap-mode" ] @@ -3879,6 +4109,7 @@ "animation-type": "discrete", "inherited": true, "initial": "auto", + "requires-computation": "never", "valid-types": [ "text-wrap-style" ] @@ -3887,12 +4118,14 @@ "affects-layout": false, "animation-type": "none", "inherited": false, - "initial": "none" + "initial": "none", + "requires-computation": "never" }, "top": { "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]", @@ -3913,6 +4146,7 @@ "inherited": false, "initial": "auto", "max-values": 2, + "requires-computation": "never", "valid-types": [ "touch-action" ] @@ -3925,6 +4159,7 @@ "affects-stacking-context": true, "needs-layout-node-for-resolved-value": true, "percentages-resolve-to": "length", + "requires-computation": "cascaded-value", "valid-types": [ "transform-list" ], @@ -3937,6 +4172,7 @@ "inherited": false, "initial": "view-box", "affects-layout": false, + "requires-computation": "never", "valid-types": [ "transform-box" ] @@ -3947,6 +4183,7 @@ "inherited": false, "initial": "50% 50%", "max-values": 3, + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -3964,6 +4201,7 @@ "animation-type": "discrete", "inherited": false, "initial": "flat", + "requires-computation": "never", "valid-identifiers": [ "flat", "preserve-3d" @@ -3987,6 +4225,7 @@ "inherited": false, "initial": "normal", "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-types": [ "transition-behavior" ] @@ -3997,6 +4236,7 @@ "inherited": false, "initial": "0s", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "time" ] @@ -4007,6 +4247,7 @@ "inherited": false, "initial": "0s", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "time [0,∞]" ] @@ -4017,6 +4258,7 @@ "inherited": false, "initial": "all", "multiplicity": "coordinating-list", + "requires-computation": "never", "valid-types": [ "custom-ident ![none]" ], @@ -4030,6 +4272,7 @@ "inherited": false, "initial": "ease", "multiplicity": "coordinating-list", + "requires-computation": "cascaded-value", "valid-types": [ "easing-function", "easing-keyword" @@ -4041,6 +4284,7 @@ "initial": "none", "affects-layout": false, "affects-stacking-context": true, + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -4051,6 +4295,7 @@ "animation-type": "none", "inherited": false, "initial": "normal", + "requires-computation": "never", "valid-types": [ "unicode-bidi" ] @@ -4060,6 +4305,7 @@ "animation-type": "discrete", "inherited": false, "initial": "auto", + "requires-computation": "never", "valid-types": [ "user-select" ] @@ -4068,6 +4314,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "baseline", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]", @@ -4093,6 +4340,7 @@ "animation-type": "none", "inherited": false, "initial": "block", + "requires-computation": "never", "valid-types": [ "axis" ], @@ -4103,6 +4351,7 @@ "animation-type": "none", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "view-timeline-inset" ], @@ -4114,6 +4363,7 @@ "animation-type": "none", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-identifiers": [ "none" ], @@ -4128,6 +4378,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-types": [ "custom-ident ![auto,none]" ], @@ -4139,6 +4390,7 @@ "animation-type": "custom", "inherited": true, "initial": "visible", + "requires-computation": "never", "valid-types": [ "visibility" ] @@ -4158,6 +4410,7 @@ "animation-type": "discrete", "inherited": true, "initial": "collapse", + "requires-computation": "never", "valid-types": [ "white-space-collapse" ] @@ -4166,6 +4419,7 @@ "animation-type": "discrete", "inherited": false, "initial": "none", + "requires-computation": "never", "valid-identifiers": [ "none", "discard-before", @@ -4177,6 +4431,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "2", + "requires-computation": "cascaded-value", "valid-types": [ "integer [1,∞]" ], @@ -4186,6 +4441,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "auto", + "requires-computation": "cascaded-value", "valid-types": [ "fit-content", "length [0,∞]", @@ -4209,6 +4465,7 @@ "inherited": false, "initial": "auto", "multiplicity": "list", + "requires-computation": "never", "valid-types": [ "custom-ident ![all,auto,contents,none,scroll-position,will-change]" ], @@ -4222,6 +4479,7 @@ "animation-type": "discrete", "initial": "normal", "inherited": true, + "requires-computation": "never", "valid-identifiers": [ "normal", "keep-all", @@ -4233,6 +4491,7 @@ "animation-type": "by-computed-value", "inherited": true, "initial": "normal", + "requires-computation": "non-inherited-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -4252,6 +4511,7 @@ "animation-type": "none", "inherited": true, "initial": "horizontal-tb", + "requires-computation": "never", "valid-types": [ "writing-mode" ] @@ -4261,6 +4521,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -4275,6 +4536,7 @@ "animation-type": "by-computed-value", "inherited": false, "initial": "0", + "requires-computation": "cascaded-value", "valid-types": [ "length [-∞,∞]", "percentage [-∞,∞]" @@ -4291,6 +4553,7 @@ "inherited": false, "initial": "auto", "needs-layout-node-for-resolved-value": true, + "requires-computation": "cascaded-value", "valid-types": [ "integer [-∞,∞]" ], diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index 976304c365..6728b959ff 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -1965,10 +1965,12 @@ GC::Ref StyleComputer::compute_properties(DOM::AbstractEleme auto inherited = ComputedProperties::Inherited::No; RefPtr value; auto important = Important::No; + bool requires_computation; if (auto cascaded_style_property = cascaded_properties.style_property(property_id); cascaded_style_property.has_value()) { important = cascaded_style_property->important; value = cascaded_style_property->value; + requires_computation = property_requires_computation_with_cascaded_value(property_id); } // NOTE: We've already handled font-size above. @@ -1990,19 +1992,23 @@ GC::Ref StyleComputer::compute_properties(DOM::AbstractEleme should_inherit |= property_id == PropertyID::Color && value && value->to_keyword() == Keyword::Currentcolor; // FIXME: Logical properties should inherit from their parent's equivalent unmapped logical property. - if (should_inherit) { + if (should_inherit && abstract_element.element_to_inherit_style_from().has_value()) { inherited = ComputedProperties::Inherited::Yes; + value = get_non_animated_inherit_value(property_id, abstract_element); + requires_computation = property_requires_computation_with_inherited_value(property_id); // FIXME: Do we need to recompute animated inherited values? if (auto animated_value = get_animated_inherit_value(property_id, abstract_element); animated_value.has_value()) computed_style->set_animated_property(property_id, animated_value->value, animated_value->is_result_of_transition, ComputedProperties::Inherited::Yes); } - if (!value || value->is_initial() || value->is_unset()) + if (!value || value->is_initial() || value->is_unset() || (should_inherit && !abstract_element.element_to_inherit_style_from().has_value())) { value = property_initial_value(property_id); + requires_computation = property_requires_computation_with_initial_value(property_id); + } - computed_style->set_property(property_id, compute_property(property_id, value.release_nonnull()), inherited, important); + computed_style->set_property(property_id, requires_computation ? compute_property(property_id, value.release_nonnull()) : value.release_nonnull(), inherited, important); } if (is(abstract_element.element())) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp index 2509d41723..b725234f6b 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateCSSPropertyID.cpp @@ -292,6 +292,10 @@ Vector const& shorthands_for_longhand(PropertyID); Vector const& property_computation_order(); bool property_is_positional_value_list_shorthand(PropertyID); +bool property_requires_computation_with_inherited_value(PropertyID); +bool property_requires_computation_with_initial_value(PropertyID); +bool property_requires_computation_with_cascaded_value(PropertyID); + size_t property_maximum_value_count(PropertyID); bool property_affects_layout(PropertyID); @@ -1607,6 +1611,101 @@ bool property_is_positional_value_list_shorthand(PropertyID property_id) return false; } } +)~~~"); + + Vector properties_requiring_computation_with_inherited_value; + Vector properties_requiring_computation_with_initial_value; + Vector properties_requiring_computation_with_cascaded_value; + + properties.for_each_member([&](auto& name, auto& value) { + VERIFY(value.is_object()); + if (is_legacy_alias(value.as_object())) + return; + + auto const& requires_computation = value.as_object().get_string("requires-computation"sv); + + if (requires_computation.has_value() && value.as_object().has("longhands"sv)) { + dbgln("Property '{}' is a shorthand and cannot have 'requires-computation' set.", name); + VERIFY_NOT_REACHED(); + } + + if (value.as_object().has("longhands"sv)) + return; + + if (!requires_computation.has_value()) { + dbgln("Property '{}' is missing 'requires-computation' field.", name); + VERIFY_NOT_REACHED(); + } + + if (requires_computation.value() == "always"sv) { + properties_requiring_computation_with_inherited_value.append(name); + properties_requiring_computation_with_initial_value.append(name); + properties_requiring_computation_with_cascaded_value.append(name); + } else if (requires_computation.value() == "non-inherited-value"sv) { + properties_requiring_computation_with_initial_value.append(name); + properties_requiring_computation_with_cascaded_value.append(name); + } else if (requires_computation.value() == "cascaded-value"sv) { + properties_requiring_computation_with_cascaded_value.append(name); + } else if (requires_computation.value() != "never"sv) { + dbgln("Property '{}' has unrecognized 'requires-computation' value '{}'", name, requires_computation.value()); + VERIFY_NOT_REACHED(); + } + }); + + generator.append(R"~~~( +bool property_requires_computation_with_inherited_value(PropertyID property_id) +{ + switch(property_id) { + )~~~"); + + for (auto const& property_name : properties_requiring_computation_with_inherited_value) { + auto property_generator = generator.fork(); + property_generator.set("name:titlecase", title_casify(property_name)); + property_generator.appendln(" case PropertyID::@name:titlecase@:"); + } + + generator.append(R"~~~( + return true; + default: + return false; + } +} + +bool property_requires_computation_with_initial_value(PropertyID property_id) +{ + switch(property_id) { + )~~~"); + + for (auto const& property_name : properties_requiring_computation_with_initial_value) { + auto property_generator = generator.fork(); + property_generator.set("name:titlecase", title_casify(property_name)); + property_generator.appendln(" case PropertyID::@name:titlecase@:"); + } + + generator.append(R"~~~( + return true; + default: + return false; + } +} + +bool property_requires_computation_with_cascaded_value(PropertyID property_id) +{ + switch(property_id) { + )~~~"); + + for (auto const& property_name : properties_requiring_computation_with_cascaded_value) { + auto property_generator = generator.fork(); + property_generator.set("name:titlecase", title_casify(property_name)); + property_generator.appendln(" case PropertyID::@name:titlecase@:"); + } + + generator.append(R"~~~( + return true; + default: + return false; + } +} )~~~"); generator.append(R"~~~(