Skip to content

Commit 87a1397

Browse files
committed
2 parents 1f5605e + 4efe2f5 commit 87a1397

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

css-typed-om/Overview.bs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,23 @@ The <dfn method for=StylePropertyMap>append(DOMString <var>property</var>,
250250

251251
5. Let |values to append| be the empty list.
252252

253-
6. For each |value| in |values|:
253+
6. For each |value| in |values| if the [=algorithm that coerces value into an appropriate type for a given property=] does not throw an error, append the returned object to |values to append|.
254+
255+
7. Append |values to append| to the end of |entry|’s list.
256+
</div>
257+
258+
<div algorithm>
259+
This section describes the <dfn>algorithm that coerces value into an appropriate type for a given property</dfn>, or fails and throws a {{TypeError}}:
254260
: If |value| is a {{CSSStyleValue}},
255261
:: If |value| does not match the grammar of a [=list-valued property iteration=] of |property|,
256262
[=throw=] a {{TypeError}} and exit this algorithm.
257-
Otherwise, append |value| to the end of |values to append|.
263+
Otherwise, return the |value|.
258264
: If |value| is a {{DOMString}},
259-
:: [=Parse a CSSStyleValue=] with property |property| and value |value|.
265+
:: [=Parse a CSSStyleValue=] with property |property| and value |value| and return the resulting |value|.
260266
If the result is null,
261267
[=throw=] a {{TypeError}} and exit this algorithm.
262-
Otherwise, append each [=list-valued property iteration=] in the result to the end of |values to append|.
263-
264-
7. Append |values to append| to the end of |entry|’s list.
268+
Otherwise, append each [=list-valued property iteration=] in the result to a |values to append| object
269+
and return |values to append|.
265270
</div>
266271

267272
<div algorithm>
@@ -307,12 +312,10 @@ the [=property model=]. This list of properties is sorted in the following manne
307312
* custom properties are sorted by increasing code point order.
308313
* custom properties are sorted after normal properties.
309314

310-
Issue(145): should refactor out value type-checking, as it'll be needed by the rest of the setters too
315+
[=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.
311316

312317
Issue(148): add detailed descriptions of the rest of the methods on {{StylePropertyMap}}
313318

314-
Issue(149): describe that these are not live objects
315-
316319
Issue(268): stringification
317320

318321
Issue(276): interaction with custom properties
@@ -2060,9 +2063,7 @@ is a [=list=] of {{CSSTransformComponent}}s.
20602063
--------------------------------------------------
20612064

20622065
{{CSSPositionValue}} objects represent <<position>> values,
2063-
used by properties such as 'background-position'.
2064-
2065-
Issue(312): background-position is a shorthand
2066+
used by properties such as 'object-position'.
20662067

20672068
<pre class='idl'>
20682069
[Constructor(CSSNumericValue x, CSSNumericValue y)]
@@ -2111,7 +2112,7 @@ The {{CSSPositionValue/x}} attribute expresses the offset from the left edge of
21112112

21122113
<pre class='lang-css'>
21132114
.example {
2114-
background-position: center bottom 10px;
2115+
object-position: center bottom 10px;
21152116
}
21162117
</pre>
21172118

@@ -2120,10 +2121,10 @@ The {{CSSPositionValue/x}} attribute expresses the offset from the left edge of
21202121
<pre class='lang-javascript'>
21212122
let map = document.querySelector('.example').styleMap;
21222123

2123-
map.get('background-position').x;
2124+
map.get('object-position').x;
21242125
// CSS.percent(50)
21252126

2126-
map.get('background-position').y;
2127+
map.get('object-position').y;
21272128
// CSSMathSum(CSS.percent(100), CSS.px(-10))
21282129
</pre>
21292130
</div>

0 commit comments

Comments
 (0)