Reviewers: Timothy Loh, alancutter,
Message:
PTAL.
Description:
Consume whitespace at start of calc subexpression
Consume whitespace at start of calc subexpression, just like we do for the
overall calc expression. This fixes the indiloop login page.
BUG=537573
Please review this at
https://codereview.chromium.org/1368213004/
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Affected files (+3, -0 lines):
M third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
M third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt
M third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
Index: third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt
diff --git
a/third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt
b/third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt
index
97d6d3a3b6ae33ffc64bccc643a81852112fb457..dd779e6a9def2743e70f239684e9d0e4936d4155
100644
--- a/third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt
+++ b/third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt
@@ -42,5 +42,6 @@ control => PASS
-50px + 150px => PASS
-50px - -150px => PASS
(((((((100px))))))) => PASS
+50px + 50px => PASS
100px => PASS
100% * 2 => PASS
Index: third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
diff --git a/third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
b/third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
index
6f8ea975b7912760026994f14e9d2541ccfef9bb..68b9678a6248c8b45a5b96cb353086eb2a3727d6
100644
--- a/third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
+++ b/third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
@@ -78,6 +78,7 @@
<div class="width-test" style="width: calc(-50px + 150px);">-50px +
150px</div>
<div class="width-test" style="width: calc(-50px - -150px);">-50px -
-150px</div>
<div class="width-test" style="width:
calc((((((((100px))))))));">(((((((100px)))))))</div>
+<div class="width-test" style="width: calc(( 50px + 50px ));"> 50px +
50px </div>
<div class="height-test" style="height: calc(100px);">100px</div>
<div style="height: 50px; background-color: white;" class="wrapper">
<div class="height-test" style="height: calc(100% * 2);">100% * 2</div>
Index: third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
index
0f78c2caf47a63cfb55b1731fec02b039b17c549..3eaf984de25b259e9b8b45f9322eddb22207b66c
100644
--- a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
@@ -646,6 +646,7 @@ private:
if (tokens.peek().type() == LeftParenthesisToken) {
CSSParserTokenRange innerRange = tokens.consumeBlock();
tokens.consumeWhitespace();
+ innerRange.consumeWhitespace();
return parseValueExpression(innerRange, depth, result);
}