Bug 31614 - Web Inspector: Styles Gear Menu Choice to Display Colors "As Authored"
Summary: Web Inspector: Styles Gear Menu Choice to Display Colors "As Authored"
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-17 21:55 PST by Joseph Pecoraro
Modified: 2010-11-29 03:38 PST (History)
7 users (show)

See Also:


Attachments
[TEST CASE] Test Case for Each Color Representation (418 bytes, text/html)
2009-11-17 21:55 PST, Joseph Pecoraro
no flags Details
[PATCH] Suggested solution (7.75 KB, patch)
2010-11-26 06:19 PST, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-11-17 21:55:45 PST
Created attachment 43404 [details]
[TEST CASE] Test Case for Each Color Representation

It would be nice to display the (valid) CSS Color style data exactly the way it was set in the source, "as authored" by the developer.

User Feedback:

> For the color preference in the gear menu, how about “as authored”?
> So that if the style sheet says “red”, then “red” will be displayed in
> the style inspector.


The attached Test Case has a <style> which contains all 4 representations for a single element to make it easy to test this.
Comment 1 Timothy Hatcher 2009-11-18 09:50:15 PST
I don't think we have this information currently. We always get rgb()/rgba() colors back from the style rules. (That is one reason why the Inspector prefered those formats until you came along.)
Comment 2 Alexander Pavlov (apavlov) 2010-11-26 06:19:44 PST
Created attachment 74928 [details]
[PATCH] Suggested solution

One drawback is that cycling through the color formats may bring up same formats in one loop (not sequential).
Comment 3 Pavel Feldman 2010-11-26 06:29:15 PST
Comment on attachment 74928 [details]
[PATCH] Suggested solution

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

> WebCore/inspector/front-end/StylesSidebarPane.js:1315
> +                            throw "Unknown color format: " + curFormat;

This slows us down. Could we get rid of it?
Comment 4 Alexander Pavlov (apavlov) 2010-11-29 03:36:26 PST
Manually committed with the comment addressed: <http://trac.webkit.org/changeset/72786>