Skip to content

Commit 2519d4b

Browse files
committed
Merge the CSSStyleRule/inline style sections, and more precisely define the properties and order of those StylePropertyMaps.
1 parent fa542db commit 2519d4b

File tree

1 file changed

+23
-33
lines changed

1 file changed

+23
-33
lines changed

css-typed-om/Overview.bs

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,8 @@ interface StylePropertyMap : StylePropertyMapReadOnly {
266266
A {{StylePropertyMapReadOnly}} object has associated <dfn export for="StylePropertyMapReadonly, StylePropertyMap">map entries</dfn>,
267267
which is a [=map=] of property names ([=string=]) → values ([=list=] of {{CSSStyleValue}} objects).
268268
This list is initialized differently depending on where the {{CSSStyleValue}} is used
269-
(see
270-
[[#computed-stylepropertymapreadonly-objects]],
271-
[[#declared-stylepropertymap-objects]], and
272-
[[#inline-stylepropertymap-objects]]).
269+
(see [[#computed-stylepropertymapreadonly-objects]]
270+
and [[#declared-stylepropertymap-objects]]).
273271

274272
Unless otherwise stated,
275273
the initial ordering of the [=StylePropertyMap/map entries=]
@@ -456,7 +454,9 @@ probably in an appendix.
456454

457455
Issue: Do we need an updateAll() method that gets and sets a list?
458456

459-
[=computed StylePropertyMap=], [=declared StylePropertyMap=] and [=inline StylePropertyMap=] are all live objects: the attributes and methods on these objects must operate on the actual underlying data, not a snapshot of the data.
457+
[=Computed StylePropertyMaps=] and [=declared StylePropertyMaps=] are all live objects:
458+
the attributes and methods on these objects must operate on the actual underlying data,
459+
not a snapshot of the data.
460460

461461
A [=string=] is a <dfn>custom property name string</dfn>
462462
if it starts with two dashes (U+002D HYPHEN-MINUS), like <code>--foo</code>.
@@ -498,7 +498,9 @@ and are accessed by calling the {{Element/computedStyleMap()}} method.
498498
whose [=StylePropertyMap/map entries=] are the name and [=computed value=] of
499499
every longhand CSS property supported by the User Agent,
500500
every registered [=custom property=],
501-
and every non-registered [=custom property=] which is not set to its initial value.
501+
and every non-registered [=custom property=] which is not set to its initial value,
502+
ordered by putting CSS-defined properties before custom properties,
503+
then sorting by code-point order of property name within those two categories.
502504
</div>
503505

504506
Note: like {{Window/getComputedStyle()|Window.getComputedStyle()}},
@@ -514,47 +516,35 @@ pseudo-element styles are intended to be obtainable
514516
by adding this method to the new {{PseudoElement}} interface
515517
(rather than using a `pseudoElt` argument like {{Window/getComputedStyle()|Window.getComputedStyle()}} does).
516518

517-
Declared {{StylePropertyMap}} objects {#declared-stylepropertymap-objects}
519+
Declared & Inline {{StylePropertyMap}} objects {#declared-stylepropertymap-objects}
518520
----------------------------------------------------------------------------
519521

520522
<pre class='idl'>
521523
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
522524
partial interface CSSStyleRule {
523525
[SameObject] readonly attribute StylePropertyMap styleMap;
524526
};
525-
</pre>
526-
527-
<dfn>Declared StylePropertyMap</dfn> objects represent style property-value pairs embedded
528-
in a style rule, and are accessed via the <dfn attribute for=CSSStyleRule>styleMap</dfn>
529-
attribute of {{CSSStyleRule}} objects.
530-
531-
When constructed, the [=StylePropertyMap/map entries=] for [=declared StylePropertyMap=]
532-
objects is initialized to contain
533-
an entry for each property that is paired with at least one valid value inside the
534-
{{CSSStyleRule}} that the object represents. The value for a given property is
535-
the last valid value provided by the {{CSSStyleRule}} object.
536-
537527

538-
Inline {{StylePropertyMap}} objects {#inline-stylepropertymap-objects}
539-
----------------------------------------------------------------------
540-
541-
<pre class='idl'>
542528
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
543529
partial interface ElementCSSInlineStyle {
544530
[SameObject] readonly attribute StylePropertyMap attributeStyleMap;
545531
};
546532
</pre>
547533

548-
<dfn>Inline StylePropertyMap</dfn> objects represent inline style declarations
549-
attached directly to {{Element}}s.
550-
They are accessed via the <dfn attribute for=ElementCSSInlineStyle>attributeStyleMap</dfn> attribute of {{Element}} objects
551-
(via the {{ElementCSSInlineStyle}} mixin interface).
534+
<dfn>Declared StylePropertyMap</dfn> objects
535+
represent style property-value pairs embedded in a style rule or inline style,
536+
and are accessed via the <dfn attribute for=CSSStyleRule>styleMap</dfn> attribute of {{CSSStyleRule}} objects,
537+
or the <dfn attribute for="ElementCSSInlineStyle">attributeStyleMap</dfn> attribute
538+
of objects implementing the {{ElementCSSInlineStyle}} interface
539+
(such as {{Element}}s).
540+
541+
When constructed, the [=StylePropertyMap/map entries=] for [=declared StylePropertyMap=] objects
542+
is initialized to contain an entry
543+
for each property with a valid value inside the {{CSSStyleRule}}
544+
or inline style
545+
that the object represents,
546+
in the same order as the {{CSSStyleRule}} or inline style.
552547

553-
When constructed, the [=StylePropertyMap/map entries=] for [=inline StylePropertyMap=] objects
554-
is initialized to contain an
555-
entry for each property that is paired with at least one valid value in the string
556-
representing the style attribute for the Element that the object is associated with.
557-
The value for a given property is the last valid value provided in the string.
558548

559549
{{CSSStyleValue}} subclasses {#stylevalue-subclasses}
560550
==================================================
@@ -730,7 +720,7 @@ There are two interfaces that inherit from {{CSSNumericValue}}:
730720
{{CSSNumericValue}} objects are not range-restricted.
731721
Any valid numeric value can be represented by a {{CSSNumericValue}},
732722
and that value will not be clamped, rounded, or rejected
733-
when set on a [=declared StylePropertyMap=] or [=inline StylePropertyMap=].
723+
when set on a [=declared StylePropertyMap=].
734724
Instead, clamping and/or rounding will occur during computation of style.
735725

736726
<div class='example'>

0 commit comments

Comments
 (0)