Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSCalculationValue.cpp

Issue 1368213004: Consume whitespace at start of calc subexpression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 } 639 }
640 640
641 bool parseValueTerm(CSSParserTokenRange& tokens, int depth, Value* result) 641 bool parseValueTerm(CSSParserTokenRange& tokens, int depth, Value* result)
642 { 642 {
643 if (checkDepthAndIndex(&depth, tokens) != OK) 643 if (checkDepthAndIndex(&depth, tokens) != OK)
644 return false; 644 return false;
645 645
646 if (tokens.peek().type() == LeftParenthesisToken) { 646 if (tokens.peek().type() == LeftParenthesisToken) {
647 CSSParserTokenRange innerRange = tokens.consumeBlock(); 647 CSSParserTokenRange innerRange = tokens.consumeBlock();
648 tokens.consumeWhitespace(); 648 tokens.consumeWhitespace();
649 innerRange.consumeWhitespace();
649 return parseValueExpression(innerRange, depth, result); 650 return parseValueExpression(innerRange, depth, result);
650 } 651 }
651 652
652 return parseValue(tokens, result); 653 return parseValue(tokens, result);
653 } 654 }
654 655
655 bool parseValueMultiplicativeExpression(CSSParserTokenRange& tokens, int dep th, Value* result) 656 bool parseValueMultiplicativeExpression(CSSParserTokenRange& tokens, int dep th, Value* result)
656 { 657 {
657 if (checkDepthAndIndex(&depth, tokens) != OK) 658 if (checkDepthAndIndex(&depth, tokens) != OK)
658 return false; 659 return false;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 741
741 return expression ? adoptRefWillBeNoop(new CSSCalcValue(expression, range)) : nullptr; 742 return expression ? adoptRefWillBeNoop(new CSSCalcValue(expression, range)) : nullptr;
742 } 743 }
743 744
744 PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(PassRefPtrWillBeRawPtr <CSSCalcExpressionNode> expression, ValueRange range) 745 PassRefPtrWillBeRawPtr<CSSCalcValue> CSSCalcValue::create(PassRefPtrWillBeRawPtr <CSSCalcExpressionNode> expression, ValueRange range)
745 { 746 {
746 return adoptRefWillBeNoop(new CSSCalcValue(expression, range)); 747 return adoptRefWillBeNoop(new CSSCalcValue(expression, range));
747 } 748 }
748 749
749 } // namespace blink 750 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/calc/simple-calcs-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698