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

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

Issue 1856633002: Support nested calc() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/calc-nesting.html ('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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 CSSPrimitiveValue::create(token.numericValue(), type), token.numeric ValueType() == IntegerValueType); 629 CSSPrimitiveValue::create(token.numericValue(), type), token.numeric ValueType() == IntegerValueType);
630 630
631 return true; 631 return true;
632 } 632 }
633 633
634 bool parseValueTerm(CSSParserTokenRange& tokens, int depth, Value* result) 634 bool parseValueTerm(CSSParserTokenRange& tokens, int depth, Value* result)
635 { 635 {
636 if (checkDepthAndIndex(&depth, tokens) != OK) 636 if (checkDepthAndIndex(&depth, tokens) != OK)
637 return false; 637 return false;
638 638
639 if (tokens.peek().type() == LeftParenthesisToken) { 639 if (tokens.peek().type() == LeftParenthesisToken || tokens.peek().functi onId() == CSSValueCalc) {
640 CSSParserTokenRange innerRange = tokens.consumeBlock(); 640 CSSParserTokenRange innerRange = tokens.consumeBlock();
641 tokens.consumeWhitespace(); 641 tokens.consumeWhitespace();
642 innerRange.consumeWhitespace(); 642 innerRange.consumeWhitespace();
643 return parseValueExpression(innerRange, depth, result); 643 return parseValueExpression(innerRange, depth, result);
644 } 644 }
645 645
646 return parseValue(tokens, result); 646 return parseValue(tokens, result);
647 } 647 }
648 648
649 bool parseValueMultiplicativeExpression(CSSParserTokenRange& tokens, int dep th, Value* result) 649 bool parseValueMultiplicativeExpression(CSSParserTokenRange& tokens, int dep th, Value* result)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 734
735 return expression ? new CSSCalcValue(expression, range) : nullptr; 735 return expression ? new CSSCalcValue(expression, range) : nullptr;
736 } 736 }
737 737
738 RawPtr<CSSCalcValue> CSSCalcValue::create(RawPtr<CSSCalcExpressionNode> expressi on, ValueRange range) 738 RawPtr<CSSCalcValue> CSSCalcValue::create(RawPtr<CSSCalcExpressionNode> expressi on, ValueRange range)
739 { 739 {
740 return new CSSCalcValue(expression, range); 740 return new CSSCalcValue(expression, range);
741 } 741 }
742 742
743 } // namespace blink 743 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/calc/calc-nesting.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698