Skip to content

Commit a256ccd

Browse files
committed
[typed-om] Sync up computedStylePropertyMap better with the CSSOM concepts and live-ness.
1 parent 45f0b11 commit a256ccd

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

css-typed-om/Overview.bs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -595,10 +595,6 @@ probably in an appendix.
595595
* Any subclass of {{CSSImageValue}} always matches <<image>>.
596596
</div>
597597

598-
[=Computed StylePropertyMaps=] and [=declared StylePropertyMaps=] are all live objects:
599-
the attributes and methods on these objects must operate on the actual underlying data,
600-
not a snapshot of the data.
601-
602598
A [=string=] is a <dfn>custom property name string</dfn>
603599
if it starts with two dashes (U+002D HYPHEN-MINUS), like <code>--foo</code>.
604600
(This corresponds to the <<custom-property-name>> production,
@@ -615,7 +611,7 @@ Computed {{StylePropertyMapReadOnly}} objects {#computed-stylepropertymapreadonl
615611

616612
<pre class='idl'>
617613
partial interface Element {
618-
StylePropertyMapReadOnly computedStyleMap();
614+
[SameObject] StylePropertyMapReadOnly computedStyleMap();
619615
};
620616
</pre>
621617

@@ -634,14 +630,21 @@ when it is first called.
634630
perform the following steps:
635631

636632
1. If |this|'s {{Element/[[computedStyleMapCache]]}} internal slot is set to `null`,
637-
set its value to a live {{StylePropertyMapReadOnly}} object,
633+
set its value to a new {{StylePropertyMapReadOnly}} object,
638634
whose {{[[declarations]]}} internal slot are the name and [=computed value=] of
639635
every longhand CSS property supported by the User Agent,
640636
every registered [=custom property=],
641637
and every non-registered [=custom property=] which is not set to its initial value
642638
on |this|,
643-
ordered by putting CSS-defined properties before custom properties,
644-
then sorting by code-point order of property name within those two categories.
639+
in the standard order.
640+
641+
The [=computed values=] in the {{[[declarations]]}} of this object
642+
must remain up-to-date,
643+
changing as style resolution changes the properties on |this|
644+
and how they're computed.
645+
646+
Note: In practice, since the values are "hidden" behind a `.get()` method call,
647+
UAs can delay computing anything until a given property is actually requested.
645648

646649
2. Return |this|'s {{Element/[[computedStyleMapCache]]}} internal slot.
647650
</div>

0 commit comments

Comments
 (0)