mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibWeb/CSS: Mark list-valued properties
Typed-OM requires us to have a generic way of asking "does property X accept a list or a single value?" so this exists mainly for that. Coordinating lists are annotated too - I'm not clear on exactly what will be needed for those, but giving them a unique value now at the worst will make them easier to find later.
This commit is contained in:
parent
b3ad4be90c
commit
1e1752b33b
|
|
@ -19,23 +19,24 @@ 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.)
|
(Note that required fields are not required on properties with `legacy-alias-for` or `logical-alias-for` set.)
|
||||||
|
|
||||||
| Field | Required | Default | Description | Generated functions |
|
| 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-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)` |
|
| `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)` |
|
| `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. | `bool is_inherited_property(PropertyID)` |
|
| `inherited` | Yes | | Boolean. Whether the property is inherited by its child elements. | `bool is_inherited_property(PropertyID)` |
|
||||||
| `initial` | Yes | | String. The property's initial value if it is not specified. | `NonnullRefPtr<StyleValue const> property_initial_value(PropertyID)` |
|
| `initial` | Yes | | String. The property's initial value if it is not specified. | `NonnullRefPtr<StyleValue const> property_initial_value(PropertyID)` |
|
||||||
| `legacy-alias-for` | No | Nothing | String. The name of a property this is an alias for. See below. | |
|
| `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);`<br/>`PropertyID map_logical_alias_to_physical_property(PropertyID, LogicalAliasMappingContext const&)` |
|
| `logical-alias-for` | No | Nothing | An object. See below. | `bool property_is_logical_alias(PropertyID);`<br/>`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<PropertyID> longhands_for_shorthand(PropertyID)`<br/>`Vector<PropertyID> expanded_longhands_for_shorthand(PropertyID)`<br/>`Vector<PropertyID> shorthands_for_longhand(PropertyID)` |
|
| `longhands` | No | `[]` | Array of strings. If this is a shorthand, these are the property names that it expands out into. | `Vector<PropertyID> longhands_for_shorthand(PropertyID)`<br/>`Vector<PropertyID> expanded_longhands_for_shorthand(PropertyID)`<br/>`Vector<PropertyID> 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)` |
|
| `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)` |
|
||||||
| `percentages-resolve-to` | No | Nothing | String. What type percentages get resolved to. eg, for `width` percentages are resolved to `length` values. | `Optional<ValueType> property_resolves_percentages_relative_to(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)`<br/>`bool property_is_list_valued(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)` |
|
| `percentages-resolve-to` | No | Nothing | String. What type percentages get resolved to. eg, for `width` percentages are resolved to `length` values. | `Optional<ValueType> property_resolves_percentages_relative_to(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)` |
|
| `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)` |
|
||||||
| `valid-identifiers` | No | `[]` | Array of strings. Which keywords the property accepts. See below. | `bool property_accepts_keyword(PropertyID, Keyword)`<br/>`Optional<Keyword> resolve_legacy_value_alias(PropertyID, Keyword)` |
|
| `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-types` | No | `[]` | Array of strings. Which value types the property accepts. See below. | `bool property_accepts_type(PropertyID, ValueType)` |
|
| `valid-identifiers` | No | `[]` | Array of strings. Which keywords the property accepts. See below. | `bool property_accepts_keyword(PropertyID, Keyword)`<br/>`Optional<Keyword> resolve_legacy_value_alias(PropertyID, Keyword)` |
|
||||||
| `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)` |
|
| `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`
|
### `animation-type`
|
||||||
|
|
||||||
|
|
@ -69,6 +70,16 @@ Logical aliases are properties like `margin-block-start`, which may assign a val
|
||||||
| `group` | String. Name of the logical property group this is associated with. (See [LogicalPropertyGroups.json](#logicalpropertygroupsjson).) |
|
| `group` | String. Name of the logical property group this is associated with. (See [LogicalPropertyGroups.json](#logicalpropertygroupsjson).) |
|
||||||
| `mapping` | String. How this relates to the group. eg, if it's the block end value, `block-end`. |
|
| `mapping` | String. How this relates to the group. eg, if it's the block end value, `block-end`. |
|
||||||
|
|
||||||
|
### `multiplicity`
|
||||||
|
The three possible values are `"single"`, `"list"`, and `"coordinating-list"`.
|
||||||
|
|
||||||
|
Most properties represent a single "thing", possibly made of multiple parts. For example, `border` takes a color, style
|
||||||
|
and thickness, but it's still a single border. Others are a list: `background` takes multiple layers, separated by
|
||||||
|
commas; `counter-increment` doesn't have commas but also is a list of counters that are incremented.
|
||||||
|
|
||||||
|
Lists can also be [coordinating list properties](https://drafts.csswg.org/css-values-4/#linked-properties), in which
|
||||||
|
case they are marked as `coordinating-list` instead of `list`.
|
||||||
|
|
||||||
### `positional-value-list-shorthand`
|
### `positional-value-list-shorthand`
|
||||||
Some shorthand properties work differently to normal in that mapping of provided values to longhands isn't necessarily
|
Some shorthand properties work differently to normal in that mapping of provided values to longhands isn't necessarily
|
||||||
1-to-1 and instead depends on the number of values provided, for example `margin`, `border-width`, `gap`, etc.
|
1-to-1 and instead depends on the number of values provided, for example `margin`, `border-width`, `gap`, etc.
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,8 @@
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none 0s ease 1 normal running 0s none",
|
"initial": "none 0s ease 1 normal running 0s none",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"longhands": [
|
"longhands": [
|
||||||
"animation-duration",
|
"animation-duration",
|
||||||
"animation-timing-function",
|
"animation-timing-function",
|
||||||
|
|
@ -225,6 +227,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0s",
|
"initial": "0s",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"time [-∞,∞]"
|
"time [-∞,∞]"
|
||||||
]
|
]
|
||||||
|
|
@ -234,6 +238,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "normal",
|
"initial": "normal",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-identifiers": [
|
"valid-identifiers": [
|
||||||
"normal",
|
"normal",
|
||||||
"reverse",
|
"reverse",
|
||||||
|
|
@ -246,6 +252,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0s",
|
"initial": "0s",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"time [0,∞]"
|
"time [0,∞]"
|
||||||
],
|
],
|
||||||
|
|
@ -258,6 +266,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-identifiers": [
|
"valid-identifiers": [
|
||||||
"none",
|
"none",
|
||||||
"forwards",
|
"forwards",
|
||||||
|
|
@ -270,6 +280,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "1",
|
"initial": "1",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"number [0,∞]"
|
"number [0,∞]"
|
||||||
],
|
],
|
||||||
|
|
@ -282,6 +294,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"string",
|
"string",
|
||||||
"custom-ident ![none]"
|
"custom-ident ![none]"
|
||||||
|
|
@ -295,6 +309,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "running",
|
"initial": "running",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-identifiers": [
|
"valid-identifiers": [
|
||||||
"running",
|
"running",
|
||||||
"paused"
|
"paused"
|
||||||
|
|
@ -305,6 +321,8 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "ease",
|
"initial": "ease",
|
||||||
|
"__comment": "FIXME: animation properties should be coordinating-lists",
|
||||||
|
"multiplicity": "single",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"easing-function"
|
"easing-function"
|
||||||
]
|
]
|
||||||
|
|
@ -336,6 +354,7 @@
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
"__comment": "FIXME: List `filter-value-list` as a valid-type once it's generically supported.",
|
"__comment": "FIXME: List `filter-value-list` as a valid-type once it's generically supported.",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-identifiers": [
|
"valid-identifiers": [
|
||||||
"none"
|
"none"
|
||||||
]
|
]
|
||||||
|
|
@ -353,13 +372,15 @@
|
||||||
"background-position",
|
"background-position",
|
||||||
"background-repeat",
|
"background-repeat",
|
||||||
"background-size"
|
"background-size"
|
||||||
]
|
],
|
||||||
|
"multiplicity": "coordinating-list"
|
||||||
},
|
},
|
||||||
"background-attachment": {
|
"background-attachment": {
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "scroll",
|
"initial": "scroll",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"background-attachment"
|
"background-attachment"
|
||||||
]
|
]
|
||||||
|
|
@ -368,6 +389,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "normal",
|
"initial": "normal",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"mix-blend-mode"
|
"mix-blend-mode"
|
||||||
]
|
]
|
||||||
|
|
@ -377,6 +399,7 @@
|
||||||
"animation-type": "repeatable-list",
|
"animation-type": "repeatable-list",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "border-box",
|
"initial": "border-box",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"background-box"
|
"background-box"
|
||||||
]
|
]
|
||||||
|
|
@ -398,6 +421,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"image"
|
"image"
|
||||||
],
|
],
|
||||||
|
|
@ -410,6 +434,7 @@
|
||||||
"animation-type": "repeatable-list",
|
"animation-type": "repeatable-list",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "padding-box",
|
"initial": "padding-box",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"background-box"
|
"background-box"
|
||||||
]
|
]
|
||||||
|
|
@ -419,6 +444,7 @@
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0% 0%",
|
"initial": "0% 0%",
|
||||||
"max-values": 4,
|
"max-values": 4,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"background-position"
|
"background-position"
|
||||||
],
|
],
|
||||||
|
|
@ -436,6 +462,7 @@
|
||||||
"animation-type": "repeatable-list",
|
"animation-type": "repeatable-list",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0%",
|
"initial": "0%",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"length [-∞,∞]",
|
"length [-∞,∞]",
|
||||||
"percentage [-∞,∞]"
|
"percentage [-∞,∞]"
|
||||||
|
|
@ -452,6 +479,7 @@
|
||||||
"animation-type": "repeatable-list",
|
"animation-type": "repeatable-list",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0%",
|
"initial": "0%",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"length [-∞,∞]",
|
"length [-∞,∞]",
|
||||||
"percentage [-∞,∞]"
|
"percentage [-∞,∞]"
|
||||||
|
|
@ -468,6 +496,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "repeat",
|
"initial": "repeat",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"max-values": 2,
|
"max-values": 2,
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"repetition"
|
"repetition"
|
||||||
|
|
@ -482,6 +511,7 @@
|
||||||
"animation-type": "repeatable-list",
|
"animation-type": "repeatable-list",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"max-values": 2,
|
"max-values": 2,
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"length [0,∞]",
|
"length [0,∞]",
|
||||||
|
|
@ -1158,6 +1188,7 @@
|
||||||
"animation-type": "custom",
|
"animation-type": "custom",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-identifiers": [
|
"valid-identifiers": [
|
||||||
"none"
|
"none"
|
||||||
]
|
]
|
||||||
|
|
@ -1386,6 +1417,7 @@
|
||||||
"animation-type": "by-computed-value",
|
"animation-type": "by-computed-value",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"custom-ident ![none]",
|
"custom-ident ![none]",
|
||||||
"integer [-∞,∞]"
|
"integer [-∞,∞]"
|
||||||
|
|
@ -1398,6 +1430,7 @@
|
||||||
"animation-type": "by-computed-value",
|
"animation-type": "by-computed-value",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"custom-ident ![none]",
|
"custom-ident ![none]",
|
||||||
"integer [-∞,∞]"
|
"integer [-∞,∞]"
|
||||||
|
|
@ -1410,6 +1443,7 @@
|
||||||
"animation-type": "by-computed-value",
|
"animation-type": "by-computed-value",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"custom-ident ![none]",
|
"custom-ident ![none]",
|
||||||
"integer [-∞,∞]"
|
"integer [-∞,∞]"
|
||||||
|
|
@ -1423,6 +1457,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": true,
|
"inherited": true,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"url",
|
"url",
|
||||||
"cursor-predefined",
|
"cursor-predefined",
|
||||||
|
|
@ -1524,6 +1559,7 @@
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
"__comment": "FIXME: List `filter-value-list` as a valid-type once it's generically supported.",
|
"__comment": "FIXME: List `filter-value-list` as a valid-type once it's generically supported.",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-identifiers": [
|
"valid-identifiers": [
|
||||||
"none"
|
"none"
|
||||||
]
|
]
|
||||||
|
|
@ -1642,6 +1678,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": true,
|
"inherited": true,
|
||||||
"initial": "serif",
|
"initial": "serif",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"custom-ident",
|
"custom-ident",
|
||||||
"string"
|
"string"
|
||||||
|
|
@ -1651,6 +1688,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": true,
|
"inherited": true,
|
||||||
"initial": "normal",
|
"initial": "normal",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"integer [0,∞]",
|
"integer [0,∞]",
|
||||||
"opentype-tag"
|
"opentype-tag"
|
||||||
|
|
@ -1786,6 +1824,7 @@
|
||||||
"animation-type": "custom",
|
"animation-type": "custom",
|
||||||
"inherited": true,
|
"inherited": true,
|
||||||
"initial": "normal",
|
"initial": "normal",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"number",
|
"number",
|
||||||
"opentype-tag"
|
"opentype-tag"
|
||||||
|
|
@ -2444,6 +2483,7 @@
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"longhands": [
|
"longhands": [
|
||||||
"mask-clip",
|
"mask-clip",
|
||||||
"mask-composite",
|
"mask-composite",
|
||||||
|
|
@ -2459,6 +2499,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"coord-box"
|
"coord-box"
|
||||||
],
|
],
|
||||||
|
|
@ -2471,6 +2512,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"compositing-operator"
|
"compositing-operator"
|
||||||
],
|
],
|
||||||
|
|
@ -2481,6 +2523,7 @@
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"affects-stacking-context": true,
|
"affects-stacking-context": true,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"image",
|
"image",
|
||||||
"url"
|
"url"
|
||||||
|
|
@ -2494,6 +2537,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"masking-mode"
|
"masking-mode"
|
||||||
],
|
],
|
||||||
|
|
@ -2503,6 +2547,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"coord-box"
|
"coord-box"
|
||||||
],
|
],
|
||||||
|
|
@ -2513,6 +2558,7 @@
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0% 0%",
|
"initial": "0% 0%",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"position"
|
"position"
|
||||||
],
|
],
|
||||||
|
|
@ -2523,6 +2569,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "repeat",
|
"initial": "repeat",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"max-values": 2,
|
"max-values": 2,
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"repetition"
|
"repetition"
|
||||||
|
|
@ -2537,6 +2584,7 @@
|
||||||
"animation-type": "repeatable-list",
|
"animation-type": "repeatable-list",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"max-values": 2,
|
"max-values": 2,
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"length [0,∞]",
|
"length [0,∞]",
|
||||||
|
|
@ -2553,6 +2601,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"mask-type"
|
"mask-type"
|
||||||
],
|
],
|
||||||
|
|
@ -3048,6 +3097,7 @@
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
"inherited": true,
|
"inherited": true,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"string"
|
"string"
|
||||||
],
|
],
|
||||||
|
|
@ -3508,7 +3558,8 @@
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"affects-stacking-context": true,
|
"affects-stacking-context": true,
|
||||||
"percentages-resolve-to": "length"
|
"percentages-resolve-to": "length",
|
||||||
|
"multiplicity": "list"
|
||||||
},
|
},
|
||||||
"transform-box": {
|
"transform-box": {
|
||||||
"animation-type": "discrete",
|
"animation-type": "discrete",
|
||||||
|
|
@ -3542,6 +3593,7 @@
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "none",
|
"initial": "none",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"longhands": [
|
"longhands": [
|
||||||
"transition-property",
|
"transition-property",
|
||||||
"transition-duration",
|
"transition-duration",
|
||||||
|
|
@ -3555,6 +3607,7 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "normal",
|
"initial": "normal",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"transition-behavior"
|
"transition-behavior"
|
||||||
]
|
]
|
||||||
|
|
@ -3564,6 +3617,7 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0s",
|
"initial": "0s",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"time"
|
"time"
|
||||||
]
|
]
|
||||||
|
|
@ -3573,6 +3627,7 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "0s",
|
"initial": "0s",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"time [0,∞]"
|
"time [0,∞]"
|
||||||
]
|
]
|
||||||
|
|
@ -3582,6 +3637,7 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "all",
|
"initial": "all",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"custom-ident ![all,none]"
|
"custom-ident ![all,none]"
|
||||||
],
|
],
|
||||||
|
|
@ -3595,6 +3651,7 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "ease",
|
"initial": "ease",
|
||||||
|
"multiplicity": "coordinating-list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"easing-function"
|
"easing-function"
|
||||||
]
|
]
|
||||||
|
|
@ -3729,6 +3786,7 @@
|
||||||
"animation-type": "none",
|
"animation-type": "none",
|
||||||
"inherited": false,
|
"inherited": false,
|
||||||
"initial": "auto",
|
"initial": "auto",
|
||||||
|
"multiplicity": "list",
|
||||||
"valid-types": [
|
"valid-types": [
|
||||||
"custom-ident ![all,auto,contents,none,scroll-position,will-change]"
|
"custom-ident ![all,auto,contents,none,scroll-position,will-change]"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,9 @@ WEB_API Optional<PropertyID> property_id_from_string(StringView);
|
||||||
WEB_API bool is_inherited_property(PropertyID);
|
WEB_API bool is_inherited_property(PropertyID);
|
||||||
NonnullRefPtr<StyleValue const> property_initial_value(PropertyID);
|
NonnullRefPtr<StyleValue const> property_initial_value(PropertyID);
|
||||||
|
|
||||||
|
bool property_is_single_valued(PropertyID);
|
||||||
|
bool property_is_list_valued(PropertyID);
|
||||||
|
|
||||||
bool property_accepts_type(PropertyID, ValueType);
|
bool property_accepts_type(PropertyID, ValueType);
|
||||||
struct AcceptedTypeRange {
|
struct AcceptedTypeRange {
|
||||||
float min;
|
float min;
|
||||||
|
|
@ -774,6 +777,38 @@ NonnullRefPtr<StyleValue const> property_initial_value(PropertyID property_id)
|
||||||
}
|
}
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool property_is_single_valued(PropertyID property_id)
|
||||||
|
{
|
||||||
|
return !property_is_list_valued(property_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool property_is_list_valued(PropertyID property_id)
|
||||||
|
{
|
||||||
|
switch (property_id) {
|
||||||
|
)~~~");
|
||||||
|
|
||||||
|
properties.for_each_member([&](auto& name, JsonValue const& value) {
|
||||||
|
auto property = value.as_object();
|
||||||
|
if (auto multiplicity = property.get_string("multiplicity"sv);
|
||||||
|
multiplicity.has_value() && multiplicity != "single"sv) {
|
||||||
|
|
||||||
|
if (!first_is_one_of(multiplicity, "list"sv, "coordinating-list"sv)) {
|
||||||
|
dbgln("'{}' is not a valid value for 'multiplicity'. Accepted values are: 'single', 'list', 'coordinating-list'", multiplicity.value());
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
|
auto property_generator = generator.fork();
|
||||||
|
property_generator.set("name:titlecase", title_casify(name));
|
||||||
|
property_generator.appendln(" case PropertyID::@name:titlecase@:");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
generator.append(R"~~~(
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool property_has_quirk(PropertyID property_id, Quirk quirk)
|
bool property_has_quirk(PropertyID property_id, Quirk quirk)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user