RESOLVED FIXED Bug 94625
Create CSS color output string on 8 bits
https://bugs.webkit.org/show_bug.cgi?id=94625
Summary Create CSS color output string on 8 bits
Benjamin Poulain
Reported 2012-08-21 12:15:35 PDT
Forcing 16 bits on everyone is bad.
Attachments
Patch (3.52 KB, patch)
2012-08-21 12:23 PDT, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2012-08-21 12:23:04 PDT
Andreas Kling
Comment 2 2012-08-21 13:26:13 PDT
Comment on attachment 159735 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=159735&action=review r=me > Source/WebCore/css/CSSPrimitiveValue.cpp:1011 > + bool colorHasAlpha = color.hasAlpha(); Does this really need a local variable? > Source/WebCore/css/CSSPrimitiveValue.cpp:1029 > + NumberToStringBuffer buffer; > + const char* alphaString = numberToFixedPrecisionString(color.alpha() / 255.0f, 6, buffer, true); > + result.append(alphaString, strlen(alphaString)); Too bad we need the strlen() here.
Benjamin Poulain
Comment 3 2012-08-21 14:22:38 PDT
Comment on attachment 159735 [details] Patch Clearing flags on attachment: 159735 Committed r126186: <http://trac.webkit.org/changeset/126186>
Benjamin Poulain
Comment 4 2012-08-21 14:22:40 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 5 2012-08-21 14:35:56 PDT
Shouldn’t we be doing this with StringBuilder rather than Vector<LChar>?
Benjamin Poulain
Comment 6 2012-08-21 17:19:02 PDT
(In reply to comment #5) > Shouldn’t we be doing this with StringBuilder rather than Vector<LChar>? StringBuilder could do the job but it does not anything similar to WTF::appendNumber(). I do not mind updating StringBuilder if you think it is important.
Note You need to log in before you can comment on or make changes to this bug.