summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Loh <timloh@chromium.org>2015-12-04 11:43:34 +1100
committerTimothy Loh <timloh@chromium.org>2015-12-04 00:45:40 +0000
commitc9f94e0e06388cc9068979f61eb436662d5cd007 (patch)
tree5721b510f51fe37eab216ebafe1481a39853dd75
parent4372d24e43b8f0be622a64d37fde48a433c9ee6e (diff)
downloadchromium_src-c9f94e0e06388cc9068979f61eb436662d5cd007.zip
chromium_src-c9f94e0e06388cc9068979f61eb436662d5cd007.tar.gz
chromium_src-c9f94e0e06388cc9068979f61eb436662d5cd007.tar.bz2
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,565240 Review URL: https://codereview.chromium.org/1368213004 Cr-Commit-Position: refs/heads/master@{#352418} (cherry picked from commit 7bb8c25b4e763779e29cd592216ed92b2b140e0d) Review URL: https://codereview.chromium.org/1499803002 . Cr-Commit-Position: refs/branch-heads/2526@{#501} Cr-Branched-From: cb947c0153db0ec02a8abbcb3ca086d88bf6006f-refs/heads/master@{#352221}
-rw-r--r--third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt1
-rw-r--r--third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html1
-rw-r--r--third_party/WebKit/Source/core/css/CSSCalculationValue.cpp1
3 files changed, 3 insertions, 0 deletions
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 97d6d3a..dd779e6 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
diff --git a/third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html b/third_party/WebKit/LayoutTests/css3/calc/simple-calcs.html
index 6f8ea97..68b9678 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>
diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp b/third_party/WebKit/Source/core/css/CSSCalculationValue.cpp
index 0f78c2c..3eaf984 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);
}