Closed
Bug 970404
Opened 11 years ago
Closed 11 years ago
browser.display.use_document_colors;false makes start and end of the active tab colored with browser.display.background_color
Categories
(Firefox :: Theme, defect)
Tracking
()
RESOLVED
FIXED
Firefox 30
People
(Reporter: Aleksej, Assigned: Gijs)
References
(Blocks 1 open bug)
Details
(Whiteboard: [Australis:P3-][bugday-20140210][fixed-in-inbound])
Attachments
(2 files)
|
53.44 KB,
image/png
|
Details | |
|
4.92 KB,
patch
|
bzbarsky
:
review+
Sylvestre
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
2014-02-10-03-02-01-mozilla-central-firefox-30.0a1.en-US.linux-x86_64
Set browser.display.use_document_colors to "false" (uncheck Preferences → Content → Colors → [ ] Allow pages to choose their own colors…).
Expected results:
No effect on tab colors, or no inconsistencies introduced.
Actual results:
Start and end of the active tab are colored with the background color specified in browser.display.background_color (Preferences → Content → Colors → Background).
It's closely related to, or maybe is another side of, bug 943195.
Comment 1•11 years ago
|
||
It seems weird to me that we apply this pref to browser chrome at all. Shouldn't this be an a11y feature for content only?
| Reporter | ||
Updated•11 years ago
|
Attachment #8373448 -
Attachment description: screenshot of the problem with 2014-02-10-03-02-01-mozilla-central-firefox-30.0a1.en-US.linux-x86_64 → screenshot of the problem with 2014-02-10-03-02-01-mozilla-central-firefox-30.0a1.en-US.linux-x86_64 (background set to green, default was plain white)
| Assignee | ||
Updated•11 years ago
|
Whiteboard: [bugday-20140210] → [Australis:P3-][bugday-20140210]
| Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Tim Taubert [:ttaubert] from comment #1)
> It seems weird to me that we apply this pref to browser chrome at all.
> Shouldn't this be an a11y feature for content only?
So this is because we're using an SVG file for the sides of the tabs, and so these prefs are applying to the colors inside the SVG file. Ideally, there should be some way to opt out of this and/or claim "These are chrome SVG bits, don't honor this pref". From looking at http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresContext.cpp#689, it seems that the only current way to deal with that is for it to be a chrome docshell. Boris, do you know if we can change this for an SVG file included into a chrome document?
We're including the SVG as such (tabs.inc.css):
background-image: url(chrome://browser/skin/tabbrowser/tab-selected-start.svg);
Flags: needinfo?(bzbarsky)
Comment 3•11 years ago
|
||
Yeah, that code is just broken for SVG resource docs.
You probably want something more like:
nsIDocument* doc = mDocument->GetDisplayDocument();
if (!doc) {
doc = mDocument;
}
nsIDocShellTreeItem* docShell = doc->GetDocShell();
Flags: needinfo?(bzbarsky)
| Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] (reviews will be slow; ask someone else) from comment #3)
> Yeah, that code is just broken for SVG resource docs.
>
> You probably want something more like:
>
> nsIDocument* doc = mDocument->GetDisplayDocument();
> if (!doc) {
> doc = mDocument;
> }
>
> nsIDocShellTreeItem* docShell = doc->GetDocShell();
So this didn't help because there's no display document, as this isn't a resource document but an image.
Boris, you asked: "So the real question is how to characterize the cases that the pref should not affect".
I think the current check (ie chrome documents) /and/ chrome:// URI'd svg files should not be affected.
I don't think there is a case where we want chrome:// URI'd SVG colors overridden by the user color prefs, even when used in-content. Practically, in Firefox, I don't think there are any such svg files anyway, but also theoretically, it seems to me that that would be surprising. Additionally it'd basically be unfixable from the chrome side, whereas the user has options to still override such styles (such as user stylesheets, extensions, themes, etc.).
Boris, does that make sense?
Flags: needinfo?(bzbarsky)
Comment 5•11 years ago
|
||
OK. So maybe mDocument->IsBeingUsedAsImage() && IsChromeURI(mDocument->GetDocumentURI()) ? I'm assuming these images are not in a content package, so we can't just check for system principal. If we can, we should do that instead of IsChromeURI().
Flags: needinfo?(bzbarsky)
| Assignee | ||
Comment 6•11 years ago
|
||
I had to change the UseDocumentColors getter as well... in fact, it's possible I could leave the other method alone? Not entirely sure. Does this look OK, Boris, or did I mess something up without realizing? :-)
Attachment #8387360 -
Flags: review?(bzbarsky)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Comment 7•11 years ago
|
||
Comment on attachment 8387360 [details] [diff] [review]
don't let users affect document colors for chrome images,
Looks good as far as I can tell. r=me
Attachment #8387360 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #7)
> Comment on attachment 8387360 [details] [diff] [review]
> don't let users affect document colors for chrome images,
>
> Looks good as far as I can tell. r=me
Alright! Ship it:
remote: https://hg.mozilla.org/integration/mozilla-inbound/rev/952d40249eea
(with some trailing whitespace + indentation fixed)
| Assignee | ||
Updated•11 years ago
|
Whiteboard: [Australis:P3-][bugday-20140210] → [Australis:P3-][bugday-20140210][fixed-in-inbound]
Comment 9•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 30
| Assignee | ||
Comment 10•11 years ago
|
||
Comment on attachment 8387360 [details] [diff] [review]
don't let users affect document colors for chrome images,
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Australis
User impact if declined: users that override web colors will have a broken-looking tabstrip
Testing completed (on m-c, etc.): on m-c, local
Risk to taking this patch (and alternatives if risky): reasonably low. Boris, would you concur?
String or IDL/UUID changes made by this patch: none
Attachment #8387360 -
Flags: approval-mozilla-aurora?
Flags: needinfo?(bzbarsky)
Updated•11 years ago
|
status-firefox29:
--- → affected
status-firefox30:
--- → fixed
Updated•11 years ago
|
Attachment #8387360 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 12•11 years ago
|
||
The changeset in this bug didn't apply cleanly when I tried to transplant on mozilla-aurora.
I would have done it by hand, but then I saw what code it was touching. That's a big nope right there.
Gijs, would you mind writing a patch for mozilla-aurora?
Flags: needinfo?(gijskruitbosch+bugs)
| Assignee | ||
Comment 13•11 years ago
|
||
Flags: needinfo?(gijskruitbosch+bugs)
Updated•11 years ago
|
QA Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•