Fixing calc() parameter parsing in cubic-bezier functions

Before this patch, calc values in cubic-bezier functions
weren't being read correctly since they were handled as
simple floats.

R=rob.buis@samsung.com,timloh@chromium.org,alancutter@chromium.org
BUG=388332

Review URL: https://codereview.chromium.org/369313002

git-svn-id: svn://svn.chromium.org/blink/trunk@178998 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 87b847d2
This tests that calc() values in cubic-bezier functions are read correctly.
PASS
<!DOCTYPE html>
<html>
<style>
* {
transition-timing-function: cubic-bezier(0, 0, calc(0.5), calc(1.0));
}
</style>
</head>
<body>
<p>This tests that calc() values in cubic-bezier functions are read correctly.</p>
<p id="result"></p>
</body>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var body = document.getElementsByTagName("body")[0];
if (window.getComputedStyle(body)["transitionTimingFunction"] == "cubic-bezier(0, 0, 0.5, 1)")
document.getElementById("result").innerText = "PASS";
else
document.getElementById("result").innerText = "FAIL";
</script>
</html>
\ No newline at end of file
...@@ -3120,7 +3120,7 @@ bool CSSPropertyParser::parseCubicBezierTimingFunctionValue(CSSParserValueList*& ...@@ -3120,7 +3120,7 @@ bool CSSPropertyParser::parseCubicBezierTimingFunctionValue(CSSParserValueList*&
CSSParserValue* v = args->current(); CSSParserValue* v = args->current();
if (!validUnit(v, FNumber)) if (!validUnit(v, FNumber))
return false; return false;
result = v->fValue; result = parsedDouble(v, ReleaseParsedCalcValue);
v = args->next(); v = args->next();
if (!v) if (!v)
// The last number in the function has no comma after it, so we're done. // The last number in the function has no comma after it, so we're done.
......
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