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

Side by Side Diff: Source/core/css/parser/CSSParserImpl.cpp

Issue 1181023004: Move rem handling out of CSSParserValues.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Another attempt Created 5 years, 4 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 | « Source/core/css/StyleSheetContents.cpp ('k') | Source/core/css/parser/CSSParserValues.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/parser/CSSParserImpl.h" 6 #include "core/css/parser/CSSParserImpl.h"
7 7
8 #include "core/css/CSSKeyframesRule.h" 8 #include "core/css/CSSKeyframesRule.h"
9 #include "core/css/CSSStyleSheet.h" 9 #include "core/css/CSSStyleSheet.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 } 701 }
702 702
703 if (unresolvedProperty == CSSPropertyInvalid) 703 if (unresolvedProperty == CSSPropertyInvalid)
704 return; 704 return;
705 705
706 consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEn d), unresolvedProperty, important, ruleType); 706 consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEn d), unresolvedProperty, important, ruleType);
707 } 707 }
708 708
709 void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSProper tyID unresolvedProperty, bool important, StyleRule::Type ruleType) 709 void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSProper tyID unresolvedProperty, bool important, StyleRule::Type ruleType)
710 { 710 {
711 bool usesRemUnits; 711 CSSParserValueList valueList(range);
712 CSSParserValueList valueList(range, usesRemUnits);
713 if (!valueList.size()) 712 if (!valueList.size())
714 return; // Parser error 713 return; // Parser error
715 if (usesRemUnits && m_styleSheet)
716 m_styleSheet->parserSetUsesRemUnits(true);
717 CSSPropertyParser::parseValue(unresolvedProperty, important, &valueList, m_c ontext, m_parsedProperties, ruleType); 714 CSSPropertyParser::parseValue(unresolvedProperty, important, &valueList, m_c ontext, m_parsedProperties, ruleType);
718 } 715 }
719 716
720 PassOwnPtr<Vector<double>> CSSParserImpl::consumeKeyframeKeyList(CSSParserTokenR ange range) 717 PassOwnPtr<Vector<double>> CSSParserImpl::consumeKeyframeKeyList(CSSParserTokenR ange range)
721 { 718 {
722 OwnPtr<Vector<double>> result = adoptPtr(new Vector<double>); 719 OwnPtr<Vector<double>> result = adoptPtr(new Vector<double>);
723 while (true) { 720 while (true) {
724 range.consumeWhitespace(); 721 range.consumeWhitespace();
725 const CSSParserToken& token = range.consumeIncludingWhitespace(); 722 const CSSParserToken& token = range.consumeIncludingWhitespace();
726 if (token.type() == PercentageToken && token.numericValue() >= 0 && toke n.numericValue() <= 100) 723 if (token.type() == PercentageToken && token.numericValue() >= 0 && toke n.numericValue() <= 100)
727 result->append(token.numericValue() / 100); 724 result->append(token.numericValue() / 100);
728 else if (token.type() == IdentToken && token.valueEqualsIgnoringCase("fr om")) 725 else if (token.type() == IdentToken && token.valueEqualsIgnoringCase("fr om"))
729 result->append(0); 726 result->append(0);
730 else if (token.type() == IdentToken && token.valueEqualsIgnoringCase("to ")) 727 else if (token.type() == IdentToken && token.valueEqualsIgnoringCase("to "))
731 result->append(1); 728 result->append(1);
732 else 729 else
733 return nullptr; // Parser error, invalid value in keyframe selector 730 return nullptr; // Parser error, invalid value in keyframe selector
734 if (range.atEnd()) 731 if (range.atEnd())
735 return result.release(); 732 return result.release();
736 if (range.consume().type() != CommaToken) 733 if (range.consume().type() != CommaToken)
737 return nullptr; // Parser error 734 return nullptr; // Parser error
738 } 735 }
739 } 736 }
740 737
741 } // namespace blink 738 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/StyleSheetContents.cpp ('k') | Source/core/css/parser/CSSParserValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698