From 79b0913b3ac5240fae410200f4132f901bc3324a Mon Sep 17 00:00:00 2001 From: nainar Date: Mon, 29 Jan 2018 11:19:12 +1100 Subject: [PATCH 1/2] define a valid CSS property in Typed OM spec Fixes #568 --- css-typed-om/Overview.bs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index 99656868..c3e5bbd7 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -154,7 +154,7 @@ and parseMultiple set to true. If |property| does not start with two dashes (U+002D HYPHEN), let |property| be |property| [=ASCII lowercased=]. - 2. If |property| is not a [=supported property name=], + 2. If |property| is not a [[=valid CSS property=], [=throw=] a {{TypeError}} and exit this algorithm. 3. Attempt to parse |cssText| according to |property|’s grammar. @@ -252,6 +252,9 @@ probably in an appendix. like each "layer" in a 'background-image' property. +A valid CSS property is defined as a property that either is a valid CSS property name, +or is a custom property that starts with two dashes (U+002D HYPHEN). + The append(DOMString property, (CSSStyleValue or DOMString)... values) method, when invoked, must [=append to a StylePropertyMap=] with property property and values values. @@ -263,7 +266,7 @@ The append(DOMString property, 1. If |property| does not start with two dashes (U+002D HYPHEN), let |property| be |property| [=ASCII lowercased=]. - 2. If |property| is not a [=supported property name=], + 2. If |property| is not a [=valid CSS property=], [=throw=] a {{TypeError}} and exit this algorithm. 3. If |property| is not a [=list-valued property=], @@ -288,7 +291,7 @@ The append(DOMString property, 1. If |property| does not start with two dashes (U+002D HYPHEN), let |property| be |property| [=ASCII lowercased=]. - 2. If |property| is not a [=supported property name=], + 2. If |property| is not a [=valid CSS property=], [=throw=] a {{TypeError}} and exit this algorithm. 3. If {{StylePropertyMap}}’s [=contained properties map=] contains an entry for |property|, @@ -315,7 +318,7 @@ The append(DOMString property, 1. If |property| does not start with two dashes (U+002D HYPHEN), let |property| be |property| [=ASCII lowercased=]. - 2. If |property| is not a [=supported property name=], + 2. If |property| is not a [=valid CSS property=], [=throw=] a {{TypeError}} and exit this algorithm. 3. If {{StylePropertyMap}}’s [=contained properties map=] contains an entry for |property|, @@ -330,7 +333,7 @@ The append(DOMString property, 1. If |property| does not start with two dashes (U+002D HYPHEN), let |property| be |property| [=ASCII lowercased=]. - 2. If |property| is not a [=supported property name=], + 2. If |property| is not a [=valid CSS property=], [=throw=] a {{TypeError}} and exit this algorithm. 3. If {{StylePropertyMap}}’s [=contained properties map=] contains an entry for |property|: @@ -367,7 +370,7 @@ The append(DOMString property, 1. If |property| does not start with two dashes (U+002D HYPHEN), let |property| be |property| [=ASCII lowercased=]. - 2. If |property| is not a [=supported property name=], + 2. If |property| is not a [[=valid CSS property=], [=throw=] a {{TypeError}} and exit this algorithm. 3. If {{StylePropertyMap}}’s [=contained properties map=] contains an entry for |property|, From 84292015164346648394febb811be97d63ac671f Mon Sep 17 00:00:00 2001 From: Tab Atkins Jr Date: Sun, 28 Jan 2018 21:08:55 -0800 Subject: [PATCH 2/2] Move to be next to the other property-verifying algo, use the other algo, and use parallel structure. --- css-typed-om/Overview.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/css-typed-om/Overview.bs b/css-typed-om/Overview.bs index c888c7c9..2d73f7d3 100644 --- a/css-typed-om/Overview.bs +++ b/css-typed-om/Overview.bs @@ -267,9 +267,6 @@ probably in an appendix. like each "layer" in a 'background-image' property. -A valid CSS property is defined as a property that either is a valid CSS property name, -or is a custom property that starts with two dashes (U+002D HYPHEN). -
The append(|property|, ...|values|) method, when called on a {{StylePropertyMap}} |this|, @@ -426,6 +423,10 @@ but applies to [=strings=], rather than [=identifiers=]; it can be used without invoking the CSS parser.) +A [=string=] is a valid CSS property +if it is a [=custom property name string=], +or is a CSS property name recognized by the user agent. + Issue(148): add detailed descriptions of the rest of the methods on {{StylePropertyMap}} Issue(268): stringification