[webkit-reviews] review granted: [Bug 28889] Inspector toggled colors should remember their state across sessions : [Attachment 39124] Proposed Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Sep 6 11:56:33 PDT 2009
mitz at webkit.org has granted Timothy Hatcher <timothy at hatcher.name>'s request
for review:
Bug 28889: Inspector toggled colors should remember their state across sessions
https://bugs.webkit.org/show_bug.cgi?id=28889
Attachment 39124: Proposed Patch
https://bugs.webkit.org/attachment.cgi?id=39124&action=review
------- Additional Comments from mitz at webkit.org
> + swatchElement.title = WebInspector.UIString("Click to change
color format.");
The new style for tool tips is without a trailing period!
> + if (Preferences.colorFormat === "rgb") {
> + if (Preferences.showColorNicknames && color.nickname)
> + format = "nickname";
> + else
> + format = (color.simple ? "rgb" : "rgba");
> + } else if (Preferences.colorFormat === "hsl") {
> + if (Preferences.showColorNicknames && color.nickname)
> + format = "nickname";
> + else
> + format = (color.simple ? "hsl" : "hsla");
> + } else {
> + if (Preferences.showColorNicknames && color.nickname)
> + format = "nickname";
> + else if (color.simple)
> + format = (color.hasShortHex() ? "shorthex" : "hex");
> + else
> + format = "rgba";
> + }
You can test for the (Preferences.showColorNicknames && color.nickname)
condition first instead of repeating it three times.
More information about the webkit-reviews
mailing list