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

Issue 2217853002: Merge all of the consumeNumber() logic and make a single call to getDouble. (Closed)

Created:
4 years, 4 months ago by esprehn
Modified:
4 years, 4 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, chromium-reviews, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Merge all of the consumeNumber() logic and make a single call to getDouble. We don't need to do all of the math manually to convert the string into a number value, we can just validate the input and then call getDouble. This is still slower than the fast path which optimistically attempts to parse the whole input as a double followed by a length, but it makes the code simpler which is nice. It also means we now call charactersToDouble the same number of times in the fast and slow paths. I also converted CSSTokenizerInputStream::skipWhilePredicate to branch once on is8Bit so we're not checking every time inside the loop. BUG=605792 Committed: https://crrev.com/37f87f519d4f1e6d43286e1e433b81e217d3b467 Cr-Commit-Position: refs/heads/master@{#410588}

Patch Set 1 #

Patch Set 2 : hacky hack 2. #

Patch Set 3 : hack. #

Patch Set 4 : even better. #

Patch Set 5 : add back CSSParserFastPath. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -74 lines) Patch
M third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp View 1 2 3 1 chunk +33 lines, -72 lines 2 comments Download
M third_party/WebKit/Source/core/css/parser/CSSTokenizerInputStream.h View 1 2 3 1 chunk +9 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
esprehn
4 years, 4 months ago (2016-08-09 02:19:06 UTC) #7
Timothy Loh
yesssss lgtm!! https://codereview.chromium.org/2217853002/diff/80001/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp File third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp (right): https://codereview.chromium.org/2217853002/diff/80001/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp#newcode406 third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp:406: double value = m_input.getDouble(0, numberLength); getDouble doesn't ...
4 years, 4 months ago (2016-08-09 02:31:45 UTC) #8
esprehn
https://codereview.chromium.org/2217853002/diff/80001/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp File third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp (right): https://codereview.chromium.org/2217853002/diff/80001/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp#newcode406 third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp:406: double value = m_input.getDouble(0, numberLength); On 2016/08/09 at 02:31:44, ...
4 years, 4 months ago (2016-08-09 04:03:33 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2217853002/80001
4 years, 4 months ago (2016-08-09 04:04:16 UTC) #11
meade_UTC10
lgtm
4 years, 4 months ago (2016-08-09 04:21:58 UTC) #12
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-08-09 05:36:18 UTC) #13
commit-bot: I haz the power
4 years, 4 months ago (2016-08-09 05:38:29 UTC) #15
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/37f87f519d4f1e6d43286e1e433b81e217d3b467
Cr-Commit-Position: refs/heads/master@{#410588}

Powered by Google App Engine
This is Rietveld 408576698