@@ -381,21 +381,19 @@ Computed {{StylePropertyMapReadOnly}} objects {#computed-stylepropertymapreadonl
381
381
--------------------------------------------------------------------------
382
382
383
383
<pre class='idl'>
384
- partial interface Window {
385
- StylePropertyMapReadOnly getComputedStyleMap(Element element, optional DOMString? pseudoElt );
384
+ partial interface Element {
385
+ StylePropertyMapReadOnly computedStyleMap( );
386
386
};
387
387
</pre>
388
388
389
- Issue(350): getComputedStyleMap needs to move to CSS
390
-
391
389
<dfn>Computed StylePropertyMap</dfn> objects represent the computed style of an
392
390
{{Element}} or pseudo element, and are accessed by calling the
393
- {{Window/getComputedStyleMap ()}} method.
391
+ {{Element/computedStyleMap ()}} method.
394
392
395
393
When constructed, the [=property model=] for [=computed StylePropertyMap=]
396
394
objects is initialized to contain an entry for every valid CSS property supported by the User Agent.
397
395
398
- Note: The StylePropertyMap returned by getComputedStyleMap represents computed style,
396
+ Note: The StylePropertyMap returned by computedStyleMap represents computed style,
399
397
not resolved style. In this regard it provides different values than those
400
398
in objects returned by getComputedStyle.
401
399
@@ -404,12 +402,12 @@ Declared {{StylePropertyMap}} objects {#declared-stylepropertymap-objects}
404
402
405
403
<pre class='idl'>
406
404
partial interface CSSStyleRule {
407
- [SameObject] readonly attribute StylePropertyMap styleMap ;
405
+ [SameObject] readonly attribute StylePropertyMap attributeStyleMap ;
408
406
};
409
407
</pre>
410
408
411
409
<dfn>Declared StylePropertyMap</dfn> objects represent style property-value pairs embedded
412
- in a style rule, and are accessed via the <dfn attribute for=CSSStyleRule>styleMap </dfn>
410
+ in a style rule, and are accessed via the <dfn attribute for=CSSStyleRule>attributeStyleMap </dfn>
413
411
attribute of {{CSSStyleRule}} objects.
414
412
415
413
When constructed, the [=property model=] for [=declared StylePropertyMap=]
@@ -424,12 +422,12 @@ Inline {{StylePropertyMap}} objects {#inline-stylepropertymap-objects}
424
422
425
423
<pre class='idl'>
426
424
partial interface Element {
427
- [SameObject] readonly attribute StylePropertyMap styleMap ;
425
+ [SameObject] readonly attribute StylePropertyMap attributeStyleMap ;
428
426
};
429
427
</pre>
430
428
431
429
<dfn>Inline StylePropertyMap</dfn> objects represent inline style declarations attached
432
- directly to {{Element}} s. They are accessed via the <dfn attribute for=Element>styleMap </dfn>
430
+ directly to {{Element}} s. They are accessed via the <dfn attribute for=Element>attributeStyleMap </dfn>
433
431
attribute of {{Element}} objects.
434
432
435
433
When constructed, the [=property model=] for [=inline StylePropertyMap=] objects
@@ -578,13 +576,13 @@ Instead, clamping and/or rounding will occur during computation of style.
578
576
The following code is valid
579
577
580
578
<pre class=lang-js>
581
- myElement.styleMap .set("opacity", CSS.number(3));
582
- myElement.styleMap .set("z-index", CSS.number(15.4));
579
+ myElement.attributeStyleMap .set("opacity", CSS.number(3));
580
+ myElement.attributeStyleMap .set("z-index", CSS.number(15.4));
583
581
584
- console.log(myElement.styleMap .get("opacity").value); // 3
585
- console.log(myElement.styleMap .get("z-index").value); // 15.4
582
+ console.log(myElement.attributeStyleMap .get("opacity").value); // 3
583
+ console.log(myElement.attributeStyleMap .get("z-index").value); // 15.4
586
584
587
- var computedStyle = getComputedStyleMap( myElement);
585
+ var computedStyle = myElement.computedStyleMap( );
588
586
var opacity = computedStyle.get("opacity");
589
587
var zIndex = computedStyle.get("z-index");
590
588
</pre>
@@ -2172,7 +2170,7 @@ The {{CSSPositionValue/x}} attribute expresses the offset from the left edge of
2172
2170
Will produce the following behavior:
2173
2171
2174
2172
<pre class='lang-javascript'>
2175
- let map = document.querySelector('.example' ).styleMap ;
2173
+ let map = document.querySelector('.example' ).attributeStyleMap ;
2176
2174
2177
2175
map.get('object-position' ).x;
2178
2176
// CSS.percent(50)
@@ -2752,7 +2750,7 @@ var length2 = CSSNumericValue.from(42.0, "px");
2752
2750
length2.toString(); // "42px";
2753
2751
2754
2752
element.style.width = "42.0px";
2755
- var length3 = element.styleMap .get('width' );
2753
+ var length3 = element.attributeStyleMap .get('width' );
2756
2754
length3.toString(); // "42px";
2757
2755
</pre>
2758
2756
0 commit comments