Closed Bug 1201136 Opened 10 years ago Closed 10 years ago

Inspector doesn't support the currentColor keyword

Categories

(DevTools :: Inspector, defect)

defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
Firefox 43
Tracking Status
firefox43 --- fixed

People

(Reporter: canuckistani, Assigned: tromey)

Details

Attachments

(3 files, 1 obsolete file)

Attached image currentColor-bug.gif
This seems like a validation problem in the ruleview, see attached .gif. STR: Apply the rule `background-color: currentColor` to any element. ER: the currentColor value should be visible AR: it's invisible! The color however is actually applied and the markupview is updated. Aside: currentColor is a valid keyword for color-related rules, it should probably also be added to the autocomplete list of named colors you see in the .gif.
I think the bug is in output-parser.js. _appendColor returns a boolean but nothing ever checks it. It seems I introduced this.
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
inDOMUtils doesn't include "currentColor" in its list of completions (it just gives the list from nsColorNameList.h, which includes "transparent"); but there is a catch-all to add "inherit", "initial", and "unset". So "currentColor" seems to be the only missing one.
We should also check (maybe another bug) what it would take to show the color swatch next to currentColor, knowing that it's a dynamic variable that depends on the inherited value of color, so we might need to do some tricky refreshing.
This patch fixes the completion problem; and updates test_is_valid_css_color.html to cover the "transparent" and "currentColor" cases for good measure. This doesn't fix the entire problem.
(In reply to Patrick Brosset [:pbrosset] [:pbro] from comment #3) > We should also check (maybe another bug) what it would take to show the > color swatch next to currentColor, knowing that it's a dynamic variable that > depends on the inherited value of color, so we might need to do some tricky > refreshing. Totally agreed; to me this sounds like bug 1102464.
Fix output-parser to keep the text when a color swatch isn't appropriate.
Attachment #8656138 - Flags: review?(cam)
Attachment #8656147 - Flags: review?(bgrinstead)
Attachment #8656138 - Flags: review?(cam) → review+
Comment on attachment 8656147 [details] [diff] [review] make output-parser correctly handle special color values Review of attachment 8656147 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/devtools/shared/test/browser_outputparser.js @@ +99,5 @@ > "blur(1px) drop-shadow(0 0 0 ", > {name: "blue", value: "#00F"}, > + ") url(\"red.svg#blue\")</span></span>"]), > + > + makeColorTest("color", "currentColor", ["currentColor"]) Uber nit: if you add a comma at the end of this line then it's blame won't be affected when the next test case is added.
Attachment #8656147 - Flags: review?(bgrinstead) → review+
Updated per review.
Attachment #8656147 - Attachment is obsolete: true
Attachment #8656725 - Flags: review+
Keywords: checkin-needed
Note also the comment from a while ago in bug 927367, that system colors like ActiveBorder, ActiveCaption, etc. are also missing from auto-completion. Certainly not as big a deal, given their obscurity and that they still show in the rule view. In fact, maybe one does not even want to surface them in auto-completion...
(In reply to Simon Lindholm from comment #12) > Note also the comment from a while ago in bug 927367, that system colors > like ActiveBorder, ActiveCaption, etc. are also missing from > auto-completion. Certainly not as big a deal, given their obscurity and that > they still show in the rule view. In fact, maybe one does not even want to > surface them in auto-completion... Yes, I talked to Patrick about this and I think we don't want to expose these. So I am going to close that bug as well.
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: