Closed
Bug 1429248
Opened 7 years ago
Closed 7 years ago
input[type=color] color-swatch has its color overriden with document colors disabled
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: ntim, Assigned: emilio)
References
Details
Attachments
(1 file)
STR:
- Disable document colors from about:preferences
- Go to data:text/html,<input type="color"/>
The color swatch has its color overriden with document colors disabled.
Assignee | ||
Comment 1•7 years ago
|
||
So, we were talking about what the cleanest way of doing this was... Some options considered:
* Special-casing NAC subtrees to avoid using doc colors... Doable in theory, but kind of annoying because pseudo-elements are user-stylable, _but_ the only case we care about are actually pseudo-elements.
* Adding a chrome-only CSS property or something to control which properties are affected by this. Actually annoying, since we need Color to be an early property, and this would need to be the same, so suddenly you don't get deterministic order.
* Special-casing the ::-moz-color-swatch pseudo. Kind of nasty, but... :)
Cam, any other idea?
Flags: needinfo?(cam)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•7 years ago
|
||
That patch implements the third option discussed above. Not sold on that though, so if you think there's a cleaner way...
Comment 4•7 years ago
|
||
Can we allow document colors in all NAC subtrees specified by style="" attributes? We can check for CascadeLevel::StyleAttribute{,Important}. Though all NAC subtrees also includes SVG <use> shadow trees, where we want to ignore any colors from style="" attributes. (Ignoring the point that SVG content is often pretty useless if you ignore document colors...)
Flags: needinfo?(cam) → needinfo?(emilio)
Assignee | ||
Comment 5•7 years ago
|
||
Well we could, but then we need to thread that information through StyleResolver via CascadeFlags or what not, which I thought it wasn't that great.
But I can do that I guess. Do you know if there's a way to detect <use> subtrees without walking up the tree? It'd be unfortunate having to do that all the time just to thread a flag that may not end up being used...
Flags: needinfo?(emilio) → needinfo?(cam)
Comment 6•7 years ago
|
||
There's no way to tell if you're in an SVG <use> shadow tree without searching up the tree, I think, so special casing sounds OK.
Flags: needinfo?(cam)
Comment 7•7 years ago
|
||
There's also ::cue, which uses a style="" attribute to apply styles that come from WebVTT files. Can you check whether we need to handle that too? If so, then maybe we should base this on the CSS_PSEUDO_ELEMENT_SUPPORTS_STYLE_ATTRIBUTE flag instead of hard coding the pseudo name.
Also, do we need to check for background-color specifically? Can we just allow any color-related property that comes from style=""?
Flags: needinfo?(emilio)
Comment 8•7 years ago
|
||
Actually I'm not certain if the style="" is on the element corresponding to ::cue itself, but there are other style="" attributes set with colors such as this:
https://searchfox.org/mozilla-central/rev/7fb999d1d39418fd331284fab909df076b967ac6/dom/media/webvtt/vtt.jsm#622-645
Comment hidden (mozreview-request) |
Assignee | ||
Comment 10•7 years ago
|
||
I updated it to allow pseudo-element style attributes for now.
Flags: needinfo?(emilio)
Comment hidden (mozreview-request) |
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8941247 [details]
Bug 1429248: Special-case pseudo style attributes to avoid ignoring doc colors.
https://reviewboard.mozilla.org/r/211516/#review219218
r=me after the commit message is updated to be more like a commit message. :-). (Although in general I do like to review commit messages...)
Attachment #8941247 -
Flags: review?(cam) → review+
Assignee | ||
Comment 13•7 years ago
|
||
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Assignee: nobody → emilio
You need to log in
before you can comment on or make changes to this bug.
Description
•