Skip to content

Commit 6ac2a3b

Browse files
committed
Changed something
1 parent 456dcb3 commit 6ac2a3b

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

css-typed-om/Overview.bs

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,10 @@ Issue: is it possible to amalgamate this API with value objects once they're spe
3939
============================================
4040

4141
<pre class='idl'>
42-
enum StyleValueKeyword {"initial", "inherit", "revert", "unset"};
43-
4442
interface StyleValue {
4543
attribute DOMString cssString;
4644
static (StyleValue or sequence&ltStyleValue>)? parse(DOMString property, DOMString cssText);
4745
};
48-
49-
[Constructor(StyleValueKeyword)]
50-
interface KeywordValue : StyleValue {
51-
attribute StyleValueKeyword keywordValue;
52-
};
5346
</pre>
5447

5548
{{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
5952
contained by a {{StyleValue}} object.
6053

6154
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&lt;{{StyleValue> for
55+
method attempts to parse <var>cssText</var> as a valid {{StyleValue}} or sequence&lt;{{StyleValue}}> for
6356
<var>property</var>, returning null on failure.
6457

6558
Issue(41): Need to add a section describing values that reference custom properties. Should StyleValue handle
6659
this or should it be a subclass?
6760

68-
{{KeywordValue}} objects represent {{StyleValue}}s that are set to one of the
69-
<a>CSS-wide keywords</a> or to ''revert''.
70-
7161
The {{StylePropertyMap}} {#the-stylepropertymap}
7262
================================================
7363

@@ -221,6 +211,19 @@ The value for a given property is the last valid value provided in the string.
221211
{{StyleValue}} subclasses {#stylevalue-subclasses}
222212
==================================================
223213

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+
224227
{{NumberValue}} objects {#numbervalue-objects}
225228
----------------------------------------------
226229

@@ -530,6 +533,21 @@ document.querySelector('.example').styleMap.get('background-position').y;
530533

531534
</div>
532535

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+
533551
{{StyleValue}} normalization {#stylevalue-normalization}
534552
========================================================
535553

0 commit comments

Comments
 (0)