Summary: | Update RGBA color serialization to match HTML5 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||||||
Component: | WebCore Misc. | Assignee: | Andreas Kling <kling> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | dglazkov, webkit.review.bot | ||||||||||
Priority: | P2 | Keywords: | HTML5 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Andreas Kling
2011-05-25 10:19:59 PDT
Created attachment 94807 [details]
Proposed patch
Comment on attachment 94807 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=94807&action=review > Source/WebCore/platform/graphics/Color.cpp:211 > + if (!hasAlpha()) > + result.append('1'); > + else if (!alpha()) I don't know how often this is called (or if the compiler does a good job here) so maybe that is not relevant. But this will call alpha() twice: for hasAlpha() and second check for hasAlpha() :) Also I am not a fan of "hasAlpha()" since it is not clear if that mean alpha == 0 or alpha == 1 :) "alpha() == 255" is clearer, at least for me. Created attachment 94810 [details]
Proposed patch v2
Created attachment 94811 [details]
Proposed patch v2
Comment on attachment 94811 [details] Proposed patch v2 Attachment 94811 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/8739035 New failing tests: editing/style/inline-style-container.html Created attachment 94918 [details]
Archive of layout-test-results from ec2-cr-linux-01
The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-01 Port: Chromium Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
(In reply to comment #5) > (From update of attachment 94811 [details]) > Attachment 94811 [details] did not pass chromium-ews (chromium-xvfb): > Output: http://queues.webkit.org/results/8739035 > > New failing tests: > editing/style/inline-style-container.html Need a minor expectation tweak in editing/style/inline-style-container.html, will fix when landing if r+ed. Comment on attachment 94811 [details]
Proposed patch v2
LGTM modulo the breakage :D
Comment on attachment 94811 [details]
Proposed patch v2
String::format("%.5f", alpha() / 255.0f)); -> DecimalNumber(alpha() / 255.0) will create different values regarding float/double and the rounding of float/dtoa.
But as far as I can see, that is for the better, so r+ :)
Committed r87512: <http://trac.webkit.org/changeset/87512> |