[Webkit-unassigned] [Bug 69152] New: Web Inspector: rgb() with percentages shows wrong hex/hsl values
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Sep 30 09:54:20 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=69152
Summary: Web Inspector: rgb() with percentages shows wrong
hex/hsl values
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
URL: http://test.csswg.org/suites/css2.1/20110323/html4/bor
der-bottom-color-057.htm
OS/Version: All
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: Web Inspector
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: myakura.web at gmail.com
CC: timothy at apple.com, rik at webkit.org, keishi at webkit.org,
pmuellr at yahoo.com, joepeck at webkit.org,
pfeldman at chromium.org, yurys at chromium.org,
bweinstein at apple.com, apavlov at chromium.org,
loislo at chromium.org
Steps to reproduce
1. Open http://test.csswg.org/suites/css2.1/20110323/html4/border-bottom-color-057.htm and inspect the 2nd white box.
2. Check out the style panel reports the background-color as #FFFFFF
Actual result:
I see #646464. Clicking the color box besides the value to see the HSL value, it shows hsl(0, 0%, 39%) not hsl(0, 100%, 100%).
CSS rgb() and rgba() color values usually takes three integer but also accept percentages.
http://www.w3.org/TR/css3-color/#rgb-color
100% maps to 255, and pecentages over 100% will be clipped to 100%, hence rgb(100%, 100%, 100%) or rgb(101%, 101%, 101%) should show #FFFFFF or hsl(0, 100%, 100%) in the style panel.
However, both _rgbToHex() and _rgbToHSL() in inspector/front-end/Color.js just passes values through parseInt().toString(16) even if the values are percentages, so it causes wrong base conversion. given 'rgb(100%, 100%, 100%)', toString('100%') just drop the '%' and toString(16) will convert the left '100' to '64', so it'll end up showing #646464 in the style panel.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list