Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp |
| index 8631242a92978c046192b10baf959e86f1af0ba7..d250b9442b378236d6022f574179b9f7a1601cc5 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/HTMLParserIdioms.cpp |
| @@ -160,9 +160,6 @@ template <typename CharacterType> |
| static bool parseHTMLIntegerInternal(const CharacterType* position, |
| const CharacterType* end, |
| int& value) { |
| - // Step 3 |
|
tkent
2016/10/06 14:37:42
Adding a comment why the implementation is differe
rwlbuis
2016/10/06 15:10:44
Done.
|
| - int sign = 1; |
| - |
| // Step 4 |
| while (position < end) { |
| if (!isHTMLSpace<CharacterType>(*position)) |
| @@ -176,8 +173,9 @@ static bool parseHTMLIntegerInternal(const CharacterType* position, |
| ASSERT(position < end); |
| // Step 6 |
| + StringBuilder digits; |
| if (*position == '-') { |
| - sign = -1; |
| + digits.append('-'); |
| ++position; |
| } else if (*position == '+') |
| ++position; |
| @@ -190,7 +188,6 @@ static bool parseHTMLIntegerInternal(const CharacterType* position, |
| return false; |
| // Step 8 |
| - StringBuilder digits; |
| while (position < end) { |
| if (!isASCIIDigit(*position)) |
| break; |
| @@ -200,11 +197,9 @@ static bool parseHTMLIntegerInternal(const CharacterType* position, |
| // Step 9 |
| bool ok; |
| if (digits.is8Bit()) |
| - value = sign * |
| - charactersToIntStrict(digits.characters8(), digits.length(), &ok); |
| + value = charactersToIntStrict(digits.characters8(), digits.length(), &ok); |
| else |
| - value = sign * |
| - charactersToIntStrict(digits.characters16(), digits.length(), &ok); |
| + value = charactersToIntStrict(digits.characters16(), digits.length(), &ok); |
| return ok; |
| } |