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

Issue 667663002: Simplify CSSParserToken::textForUnitTests by using more WTF helpers (Closed)

Created:
6 years, 2 months ago by Timothy Loh
Modified:
6 years, 2 months ago
Reviewers:
Yoav Weiss
CC:
blink-reviews, blink-reviews-css, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, darktears, rune+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Simplify CSSParserToken::textForUnitTests by using more WTF helpers Instead of manually handling char arrays and using sprintf in converting CSSParserTokens to strings, we should just concatenate Strings and use String::number. I didn't bother using StringBuilder here since the function is only used in unit tests and it's a bit more readable this way. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183975

Patch Set 1 #

Total comments: 4

Patch Set 2 : use numberToStringFixedWidth #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -20 lines) Patch
M Source/core/css/parser/CSSParserToken.cpp View 1 1 chunk +14 lines, -20 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Timothy Loh
6 years, 2 months ago (2014-10-20 07:41:15 UTC) #2
Yoav Weiss
All in all looks good, but printing of doubles gets the wrong precision. https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp File ...
6 years, 2 months ago (2014-10-20 08:04:43 UTC) #3
Timothy Loh
https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp File Source/core/css/parser/CSSParserToken.cpp (right): https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp#newcode99 Source/core/css/parser/CSSParserToken.cpp:99: return String::number(m_numericValue, 6, KeepTrailingZeros) + unit; On 2014/10/20 08:04:43, ...
6 years, 2 months ago (2014-10-20 08:16:39 UTC) #4
Yoav Weiss
https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp File Source/core/css/parser/CSSParserToken.cpp (right): https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp#newcode99 Source/core/css/parser/CSSParserToken.cpp:99: return String::number(m_numericValue, 6, KeepTrailingZeros) + unit; On 2014/10/20 08:16:38, ...
6 years, 2 months ago (2014-10-20 08:38:24 UTC) #5
Timothy Loh
https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp File Source/core/css/parser/CSSParserToken.cpp (right): https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp#newcode99 Source/core/css/parser/CSSParserToken.cpp:99: return String::number(m_numericValue, 6, KeepTrailingZeros) + unit; On 2014/10/20 08:38:24, ...
6 years, 2 months ago (2014-10-20 10:52:32 UTC) #6
Yoav Weiss
On 2014/10/20 10:52:32, Timothy Loh wrote: > https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp > File Source/core/css/parser/CSSParserToken.cpp (right): > > https://codereview.chromium.org/667663002/diff/1/Source/core/css/parser/CSSParserToken.cpp#newcode99 ...
6 years, 2 months ago (2014-10-20 10:59:46 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/667663002/20001
6 years, 2 months ago (2014-10-20 11:01:41 UTC) #9
commit-bot: I haz the power
6 years, 2 months ago (2014-10-20 12:17:44 UTC) #10
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as 183975

Powered by Google App Engine
This is Rietveld 408576698