Consume whitespace at start of calc subexpression (issue 1368213004 by rob.buis@samsung.com)

0 views
Skip to first unread message

rob....@samsung.com

unread,
Oct 4, 2015, 5:57:42 PM10/4/15
to tim...@chromium.org, alanc...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com
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);
}



rob....@samsung.com

unread,
Oct 5, 2015, 9:50:11 AM10/5/15
to tim...@chromium.org, alanc...@chromium.org, sko...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com
Adding skobes since it would be nice if this made the cutoff :)
Note that current trunk has some trouble loading the dynamic content of this
page. So like in the bug report I had to save to a local file to test my
fix.

https://codereview.chromium.org/1368213004/

sko...@chromium.org

unread,
Oct 5, 2015, 11:03:59 AM10/5/15
to rob....@samsung.com, tim...@chromium.org, alanc...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com, rob....@samsung.com

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 11:05:58 AM10/5/15
to rob....@samsung.com, tim...@chromium.org, alanc...@chromium.org, sko...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com, rob....@samsung.com

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 11:14:53 AM10/5/15
to rob....@samsung.com, tim...@chromium.org, alanc...@chromium.org, sko...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com, rob....@samsung.com
Try jobs failed on following builders:
linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_clobber_rel_ng/builds/78124)

https://codereview.chromium.org/1368213004/

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 2:44:27 PM10/5/15
to rob....@samsung.com, tim...@chromium.org, alanc...@chromium.org, sko...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com, rob....@samsung.com

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 4:50:57 PM10/5/15
to rob....@samsung.com, tim...@chromium.org, alanc...@chromium.org, sko...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com, rob....@samsung.com
Committed patchset #1 (id:1)

https://codereview.chromium.org/1368213004/

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 4:52:00 PM10/5/15
to rob....@samsung.com, tim...@chromium.org, alanc...@chromium.org, sko...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, dglazko...@chromium.org, apavlo...@chromium.org, alexis...@intel.com, rob....@samsung.com
Patchset 1 (id:??) landed as
https://crrev.com/7bb8c25b4e763779e29cd592216ed92b2b140e0d
Cr-Commit-Position: refs/heads/master@{#352418}

https://codereview.chromium.org/1368213004/
Reply all
Reply to author
Forward
0 new messages