Skip to content

Commit 456dcb3

Browse files
committed
[css-typed-om] Split KeywordValue from StyleValue.
1 parent 08b2057 commit 456dcb3

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

css-typed-om/Overview.bs

+15-13
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,24 @@ 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", "default", "unset"};
42+
enum StyleValueKeyword {"initial", "inherit", "revert", "unset"};
4343

4444
interface StyleValue {
45-
attribute StyleValueKeyword? keywordValue;
4645
attribute DOMString cssString;
4746
static (StyleValue or sequence&ltStyleValue>)? parse(DOMString property, DOMString cssText);
4847
};
48+
49+
[Constructor(StyleValueKeyword)]
50+
interface KeywordValue : StyleValue {
51+
attribute StyleValueKeyword keywordValue;
52+
};
4953
</pre>
5054

5155
{{StyleValue}} objects are the base class of all CSS Values accessible via the Typed OM API.
5256

53-
For a given {{StyleValue}}:
54-
: The <dfn attribute for=StyleValue>keywordValue</dfn> attribute
55-
:: is either set to one of the universal keywords represented in the
56-
{{StyleValueKeyword}} enum, or null if the object has a more specific
57-
value.
58-
: The <dfn attribute for=StyleValue>cssString</dfn> attribute
59-
:: provides a normalized representation (see <a section href="#stylevalue-normalization"></a>)
60-
of the value.
57+
The <dfn attribute for=StyleValue>cssString</dfn> attribute provides a normalized
58+
representation (see <a section href="#stylevalue-normalization"></a>) of the value
59+
contained by a {{StyleValue}} object.
6160

6261
The <dfn method for=StyleValue>parse(DOMString <var>property</var>, DOMString <var>cssText</var>)</dfn>
6362
method attempts to parse <var>cssText</var> as a valid {{StyleValue}} or sequence&lt;{{StyleValue> for
@@ -66,6 +65,9 @@ method attempts to parse <var>cssText</var> as a valid {{StyleValue}} or sequenc
6665
Issue(41): Need to add a section describing values that reference custom properties. Should StyleValue handle
6766
this or should it be a subclass?
6867
68+
{{KeywordValue}} objects represent {{StyleValue}}s that are set to one of the
69+
<a>CSS-wide keywords</a> or to ''revert''.
70+
6971
The {{StylePropertyMap}} {#the-stylepropertymap}
7072
================================================
7173

@@ -111,7 +113,7 @@ When invoked, the <dfn method for=StylePropertyMap>append(DOMString <var>propert
111113

112114
Issue: first need to check whether the property is a valid property.
113115

114-
1.
116+
1.
115117
: if <var>property</var> is not list-valued
116118
:: throw a TypeError
117119

@@ -483,7 +485,7 @@ interface PositionValue : StyleValue {
483485

484486
</pre>
485487

486-
{{PositionValue}} objects represent values for properties that take <<position>>
488+
{{PositionValue}} objects represent values for properties that take <<position>>
487489
productions, for example 'background-position'.
488490

489491
The <dfn attribute for=PositionValue>x</dfn> attribute contains the position offset
@@ -500,7 +502,7 @@ for=PositionValue>x</a> and <a attribute for=PositionValue>y</a> values of the
500502
{{StyleValue}} object.
501503

502504
New {{PositionValue}} objects can only be constructed via pairs of lengths, and
503-
will only return the direct serialization of these lengths in the
505+
will only return the direct serialization of these lengths in the
504506
<a attribute for=StyleValue>cssString</a> attribute.
505507

506508
<div class='example'>

0 commit comments

Comments
 (0)