@@ -39,17 +39,10 @@ Issue: is it possible to amalgamate this API with value objects once they're spe
39
39
============================================
40
40
41
41
<pre class='idl'>
42
- enum StyleValueKeyword {"initial", "inherit", "revert", "unset"};
43
-
44
42
interface StyleValue {
45
43
attribute DOMString cssString;
46
44
static (StyleValue or sequence<StyleValue>)? parse(DOMString property, DOMString cssText);
47
45
};
48
-
49
- [Constructor(StyleValueKeyword)]
50
- interface KeywordValue : StyleValue {
51
- attribute StyleValueKeyword keywordValue;
52
- };
53
46
</pre>
54
47
55
48
{{StyleValue}} objects are the base class of all CSS Values accessible via the Typed OM API.
@@ -59,15 +52,12 @@ representation (see <a section href="#stylevalue-normalization"></a>) of the val
59
52
contained by a {{StyleValue}} object.
60
53
61
54
The <dfn method for=StyleValue>parse(DOMString <var>property</var>, DOMString <var>cssText</var>)</dfn>
62
- method attempts to parse <var> cssText</var> as a valid {{StyleValue}} or sequence<{{StyleValue> for
55
+ method attempts to parse <var> cssText</var> as a valid {{StyleValue}} or sequence<{{StyleValue}} > for
63
56
<var> property</var> , returning null on failure.
64
57
65
58
Issue(41): Need to add a section describing values that reference custom properties. Should StyleValue handle
66
59
this or should it be a subclass?
67
60
68
- {{KeywordValue}} objects represent {{StyleValue}} s that are set to one of the
69
- <a>CSS-wide keywords</a> or to ''revert'' .
70
-
71
61
The {{StylePropertyMap}} {#the-stylepropertymap}
72
62
================================================
73
63
@@ -221,6 +211,19 @@ The value for a given property is the last valid value provided in the string.
221
211
{{StyleValue}} subclasses {#stylevalue-subclasses}
222
212
==================================================
223
213
214
+ {{KeywordValue}} objects {#keywordvalue-objects}
215
+ ------------------------------------------------
216
+
217
+ <pre class='idl'>
218
+ [Constructor(DOMString)]
219
+ interface KeywordValue : StyleValue {
220
+ attribute DOMString keywordValue;
221
+ };
222
+ </pre>
223
+
224
+ {{KeywordValue}} objects represent {{StyleValue}} s that are keywords. It is simply a wrapper for a string
225
+ and does not check that it contains a valid keyword.
226
+
224
227
{{NumberValue}} objects {#numbervalue-objects}
225
228
----------------------------------------------
226
229
@@ -530,6 +533,21 @@ document.querySelector('.example').styleMap.get('background-position').y;
530
533
531
534
</div>
532
535
536
+ Mapping of properties to accepted types
537
+ =======================================
538
+ This section provides a table of which types of {{StyleValue}} a given property can accept.
539
+
540
+ <table>
541
+ <tr>
542
+ <td>
543
+ width
544
+ </td>
545
+ <td>
546
+ {{KeywordValue}} | {{LengthValue}}
547
+ </td>
548
+ </tr>
549
+ </table>
550
+
533
551
{{StyleValue}} normalization {#stylevalue-normalization}
534
552
========================================================
535
553
0 commit comments