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

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

Issue 1099713003: Turn isEmpty check in parseSimpleTransform into ASSERT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase against ToT Created 5 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 | « no previous file | 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 // 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/CSSParserFastPaths.h" 6 #include "core/css/parser/CSSParserFastPaths.h"
7 7
8 #include "core/StylePropertyShorthand.h" 8 #include "core/StylePropertyShorthand.h"
9 #include "core/css/CSSFunctionValue.h" 9 #include "core/css/CSSFunctionValue.h"
10 #include "core/css/CSSValuePool.h" 10 #include "core/css/CSSValuePool.h"
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 if (pos < end) { 631 if (pos < end) {
632 if (isCSSSpace(*pos)) 632 if (isCSSSpace(*pos))
633 return nullptr; 633 return nullptr;
634 } 634 }
635 } 635 }
636 return transformList.release(); 636 return transformList.release();
637 } 637 }
638 638
639 static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleTransform(CSSPropertyID prope rtyID, const String& string) 639 static PassRefPtrWillBeRawPtr<CSSValue> parseSimpleTransform(CSSPropertyID prope rtyID, const String& string)
640 { 640 {
641 ASSERT(!string.isEmpty());
642
641 if (propertyID != CSSPropertyTransform) 643 if (propertyID != CSSPropertyTransform)
642 return nullptr; 644 return nullptr;
643 if (string.isEmpty())
644 return nullptr;
645 if (string.is8Bit()) { 645 if (string.is8Bit()) {
646 const LChar* pos = string.characters8(); 646 const LChar* pos = string.characters8();
647 const LChar* end = pos + string.length(); 647 const LChar* end = pos + string.length();
648 return parseSimpleTransformList(pos, end); 648 return parseSimpleTransformList(pos, end);
649 } 649 }
650 const UChar* pos = string.characters16(); 650 const UChar* pos = string.characters16();
651 const UChar* end = pos + string.length(); 651 const UChar* end = pos + string.length();
652 return parseSimpleTransformList(pos, end); 652 return parseSimpleTransformList(pos, end);
653 } 653 }
654 654
655 PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSProperty ID propertyID, const String& string, CSSParserMode parserMode) 655 PassRefPtrWillBeRawPtr<CSSValue> CSSParserFastPaths::maybeParseValue(CSSProperty ID propertyID, const String& string, CSSParserMode parserMode)
656 { 656 {
657 if (RefPtrWillBeRawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode)) 657 if (RefPtrWillBeRawPtr<CSSValue> length = parseSimpleLengthValue(propertyID, string, parserMode))
658 return length.release(); 658 return length.release();
659 if (RefPtrWillBeRawPtr<CSSValue> color = parseColorValue(propertyID, string, parserMode)) 659 if (RefPtrWillBeRawPtr<CSSValue> color = parseColorValue(propertyID, string, parserMode))
660 return color.release(); 660 return color.release();
661 if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, str ing)) 661 if (RefPtrWillBeRawPtr<CSSValue> keyword = parseKeywordValue(propertyID, str ing))
662 return keyword.release(); 662 return keyword.release();
663 if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID , string)) 663 if (RefPtrWillBeRawPtr<CSSValue> transform = parseSimpleTransform(propertyID , string))
664 return transform.release(); 664 return transform.release();
665 return nullptr; 665 return nullptr;
666 } 666 }
667 667
668 } // namespace blink 668 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698