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

Unified Diff: Source/core/css/parser/CSSTokenizer-in.cpp

Issue 545173003: Support scientific notation in CSS numbers/percentages/dimensions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop parseSVGNumber; Add additional TC. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/parser/CSSParserMode.h ('k') | Source/core/svg/SVGParserUtilities.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSTokenizer-in.cpp
diff --git a/Source/core/css/parser/CSSTokenizer-in.cpp b/Source/core/css/parser/CSSTokenizer-in.cpp
index 37692f38085c65e5e4d63b138fc143753e41b808..ca09bd9697e747dcb337a3b46da195fbfe971396 100644
--- a/Source/core/css/parser/CSSTokenizer-in.cpp
+++ b/Source/core/css/parser/CSSTokenizer-in.cpp
@@ -1239,28 +1239,23 @@ restartAfterComment:
break;
}
- // Use SVG parser for numbers on SVG presentation attributes.
- if (isSVGNumberParsingEnabledForMode(m_parser.m_context.mode())) {
- // We need to take care of units like 'em' or 'ex'.
- SrcCharacterType* character = currentCharacter<SrcCharacterType>();
- if (isASCIIAlphaCaselessEqual(*character, 'e')) {
- ASSERT(character - tokenStart<SrcCharacterType>() > 0);
+ // We need to take care of units like 'em' or 'ex'.
+ SrcCharacterType* character = currentCharacter<SrcCharacterType>();
+ if (isASCIIAlphaCaselessEqual(*character, 'e')) {
+ ASSERT(character - tokenStart<SrcCharacterType>() > 0);
+ ++character;
+ if (*character == '-' || *character == '+' || isASCIIDigit(*character)) {
++character;
- if (*character == '-' || *character == '+' || isASCIIDigit(*character)) {
+ while (isASCIIDigit(*character))
++character;
- while (isASCIIDigit(*character))
- ++character;
- // Use FLOATTOKEN if the string contains exponents.
- dotSeen = true;
- currentCharacter<SrcCharacterType>() = character;
- }
+ // Use FLOATTOKEN if the string contains exponents.
+ dotSeen = true;
+ currentCharacter<SrcCharacterType>() = character;
}
- if (!parseSVGNumber(tokenStart<SrcCharacterType>(), character - tokenStart<SrcCharacterType>(), yylval->number))
- break;
- } else {
- yylval->number = charactersToDouble(tokenStart<SrcCharacterType>(), currentCharacter<SrcCharacterType>() - tokenStart<SrcCharacterType>());
}
+ yylval->number = charactersToDouble(tokenStart<SrcCharacterType>(), currentCharacter<SrcCharacterType>() - tokenStart<SrcCharacterType>());
+
// Type of the function.
if (isIdentifierStart<SrcCharacterType>()) {
SrcCharacterType* type = currentCharacter<SrcCharacterType>();
« no previous file with comments | « Source/core/css/parser/CSSParserMode.h ('k') | Source/core/svg/SVGParserUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698