Bug 194752

Summary: Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
Product: WebKit Reporter: Darin Adler <darin>
Component: WebKit Misc.Assignee: Darin Adler <darin>
Status: RESOLVED FIXED    
Severity: Normal CC: dbates, ews-watchlist, guijemont, guijemont+jsc-armv7-ews, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 30342    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews100 for mac-highsierra
none
Archive of layout-test-results from ews105 for mac-highsierra-wk2
none
Archive of layout-test-results from ews113 for mac-highsierra
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch
none
Patch
none
Patch dbates: review+

Description Darin Adler 2019-02-16 21:34:55 PST
Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
Comment 1 Darin Adler 2019-02-16 22:32:46 PST Comment hidden (obsolete)
Comment 2 Darin Adler 2019-02-16 22:33:44 PST Comment hidden (obsolete)
Comment 3 EWS Watchlist 2019-02-16 23:25:53 PST Comment hidden (obsolete)
Comment 4 EWS Watchlist 2019-02-16 23:25:55 PST Comment hidden (obsolete)
Comment 5 EWS Watchlist 2019-02-16 23:28:32 PST Comment hidden (obsolete)
Comment 6 EWS Watchlist 2019-02-16 23:28:34 PST Comment hidden (obsolete)
Comment 7 EWS Watchlist 2019-02-16 23:34:16 PST Comment hidden (obsolete)
Comment 8 EWS Watchlist 2019-02-16 23:34:17 PST Comment hidden (obsolete)
Comment 9 EWS Watchlist 2019-02-16 23:59:13 PST Comment hidden (obsolete)
Comment 10 EWS Watchlist 2019-02-16 23:59:14 PST Comment hidden (obsolete)
Comment 11 Darin Adler 2019-02-17 13:59:45 PST Comment hidden (obsolete)
Comment 12 Darin Adler 2019-02-18 03:57:25 PST Comment hidden (obsolete)
Comment 13 Darin Adler 2019-02-18 06:55:16 PST
Created attachment 362293 [details]
Patch
Comment 14 Daniel Bates 2019-02-18 09:26:57 PST
Comment on attachment 362293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=362293&action=review

> Source/WTF/wtf/text/StringConcatenateNumbers.h:119
> +        : m_number(number)

No change necessary. Uniform initializer syntax (UIS)?

> Source/WebCore/html/HTMLMediaElement.h:1210
> +    static String toString(const WebCore::HTMLMediaElement::AutoplayEventPlaybackState reason) { return convertEnumerationToString(reason); }

Ok as-is. Const not necessary.

> Source/WebCore/html/HTMLMediaElement.h:1217
> +    static String string(WebCore::TextTrackCue* const& cue) { return cue->debugString(); }

Ok as-is. const type without const pointer and the ref would be better. Find yourself with more free time, it would be better to pass by const lvalue ref.

> Source/WebCore/platform/graphics/Color.cpp:393
> +    if (alpha() < 0xFF)
> +        return makeString('#', hex(red(), 2), hex(green(), 2), hex(blue(), 2), hex(alpha(), 2));
> +    return makeString('#', hex(red(), 2), hex(green(), 2), hex(blue(), 2));

Nice.

> Source/WebCore/rendering/RenderFragmentedFlow.h:287
> +    static String string(const WeakPtr<WebCore::RenderFragmentContainer> value) { return value.get() ? value->debugString() : String(); }

No change necessary. .get() is not necessary. Could use UIS for nullptr branch.
Comment 15 Daniel Bates 2019-02-18 09:29:39 PST
Comment on attachment 362293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=362293&action=review

> Source/JavaScriptCore/ChangeLog:11
> +        keep behavior the same, so lets do that.

Ok as-is. lets => let's
Comment 16 Darin Adler 2019-02-18 18:04:38 PST
Committed r241751: <https://trac.webkit.org/changeset/241751>
Comment 17 Radar WebKit Bug Importer 2019-02-18 18:22:08 PST
<rdar://problem/48186054>