[css-properties-values-api] Support CSSStyleValues in StylePropertyMap.set.
In StyleValueToCSSValue, when checking whether a certain CSSStyleValue matches the property in question, we now ask the registration (via CSSOMTypes) if the CSSStyleValue matches. If it doesn't match, we throw a TypeError like for normal properties. If it does match, the CSSStyleValue is stringified, tokenized, and set on the style rule as tokens. I have postponed support for <color> and <transform-function>, because CSSUnsupportedStyleValue currently does not handle registered custom properties at all. This is appropriate to fix in a separate CL. Note that, because the string version of StylePropertyMap.set also uses StyleValueToCSSValue, it will no longer be possible to set registered custom properties with a string--even if the syntax is matched. A subsequent CL will fix this. R=futhark@chromium.org Bug: 641877 Change-Id: Ie0cc2f87e39f8f59015824bfd1b81efaf402c326 Reviewed-on: https://chromium-review.googlesource.com/1175822 Commit-Queue: Anders Ruud <andruud@chromium.org> Reviewed-by:Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#583695}
Showing
Please register or sign in to comment