Commit 3f409410 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[css-typed-om] Make CSSStyleValue.parse work with list-valued properties

Currently, when given a list value, CSSStyleValue.parse returns null,
but the spec says to take the first entry:

https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parse

Bug: 779422
Change-Id: I9f80d1876b9390f1d2684c271d3db3ef4192ddd3
Reviewed-on: https://chromium-review.googlesource.com/743101Reviewed-by: default avatarBugs Nash <bugsnash@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512440}
parent 3b4c0299
......@@ -13,7 +13,7 @@ FAIL Calling CSSStyleValue.parseAll with an invalid cssText for the given proper
FAIL Calling CSSStyleValue.parseAll with a valid cssText for the given property returns a valid CSSStyleValue CSSStyleValue[parseMethod] is not a function
FAIL Calling CSSStyleValue.parseAll with a mixed case cssText returns a valid CSSStyleValue CSSStyleValue[parseMethod] is not a function
FAIL Calling CSSStyleValue.parseAll with a custom property returns a valid CSSStyleValue CSSStyleValue[parseMethod] is not a function
FAIL Calling CSSStyleValue.parse with a list-value property returns first list value Cannot read property 'constructor' of null
PASS Calling CSSStyleValue.parse with a list-value property returns first list value
FAIL Calling CSSStyleValue.parseAll with a list-value property returns a sequence of values CSSStyleValue.parseAll is not a function
Harness: the test ran to completion.
......@@ -46,11 +46,7 @@ ScriptValue CSSStyleValue::parse(ScriptState* script_state,
CSSStyleValueVector style_value_vector =
StyleValueFactory::CssValueToStyleValueVector(property_id, *css_value);
if (style_value_vector.size() != 1) {
// TODO(meade): Support returning a CSSStyleValueOrCSSStyleValueSequence
// from this function.
return ScriptValue::CreateNull(script_state);
}
DCHECK(!style_value_vector.IsEmpty());
v8::Local<v8::Value> wrapped_value =
ToV8(style_value_vector[0], script_state->GetContext()->Global(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment