Closed
Bug 429817
Opened 16 years ago
Closed 16 years ago
background-image not working in non-chrome user stylesheets in thunderbird
Categories
(Thunderbird :: Security, defect, P4)
Thunderbird
Security
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3.0b1
People
(Reporter: pav, Assigned: standard8)
References
Details
(Keywords: regression)
Attachments
(1 file)
1.78 KB,
patch
|
dveditz
:
review+
neil
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008041803 Thunderbird/3.0a1pre ID:2008041803 Background images fail to display when they are data urls and the CSS is applied using the stylesheet service. The error console doesn't show any warning or error. Reproducible: Always Steps to Reproduce: 1. Install and open Stylish 2. Click the "Write..." button to write a new style 3. Paste the following in the text area and click preview @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); toolbarspring { background: red url() repeat !important; background-image: url("chrome://messenger/skin/icons/quick-search-clear.png") !important; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAIUlEQVQImWNgwA3+45P4j03Ff3TJ/9gk0AVQJLAaRZTrANZXFOyxhZAqAAAAAElFTkSuQmCC") !important; } Actual Results: The background of the toolbarspring next to the main menu turned red but the background image didn't show. Expected Results: It should have displayed the background image (a black "check") over a red color.
Reporter | ||
Updated•16 years ago
|
Version: unspecified → Trunk
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008050715 Lightning/0.6a1 Thunderbird/3.0a1 ID:2008050715 same I actually blamed Stylish for such when had issues with some lightning calendar css, but I put this in userChrome.css and see no change. So I'd say it's a bug ..
Comment 2•16 years ago
|
||
Marking this a dup of bug 154836 Pavlos, if you disagree, please re-open
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Not really. may be related somehow, but not dupe IMO. 1.that is a bug about messages css and images, this is about user css for skins 2.this works on TB 2.0.0.16 very well, but not on trunk (*regression?*) 3.this is not limited to data in my case, but to all images Retested in version 3.0a2 (2008072418) and even worse: using userChrome.css and clean TB, no extensions #folderTree { background: red url("out.png") repeat !important; } [replace pic with whatever aside userchrome file], -not working. goes red but no img. -not this, no for file:/// path, not data: ... I basically cannot use img in css ui style anymore. Note that I tested repeatedly with styles that work like a charm in tb2 reopening please further test these with latest trunks
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Comment 4•16 years ago
|
||
One major change with regard to CSS background images from Gecko 1.8 to Gecko 1.9 is the way we do the security check for loading them. We used to base it on the document the CSS is applied to; now we base it on the stylesheet the CSS is in. Which means that the images in question are no longer being loaded by all-powerful chrome, but by whatever principal the user sheet has (file:// for userChrome, no idea for stylish). Then we end up in nsMsgContentPolicy::ShouldLoad, which allows through loads sourced from chrome:/resource:/about:, but blocks all others. At the very least, it should probably allow data:, and maybe the check for requesting location should be loosened a bit somehow too.
Status: UNCONFIRMED → NEW
Component: General → Security
Ever confirmed: true
Flags: blocking-thunderbird3?
Keywords: regression
QA Contact: general → thunderbird
Summary: CSS: dataURL background-image not working when applied with the stylesheet service → background-image not working in non-chrome user stylesheets in thunderbird
Assignee | ||
Comment 5•16 years ago
|
||
Triaging according to policy for flags. https://wiki.mozilla.org/Thunderbird:Release_Driving
Flags: wanted-thunderbird3+
Flags: blocking-thunderbird3?
Flags: blocking-thunderbird3-
Priority: -- → P4
Target Milestone: --- → Thunderbird 3.0rc1
Assignee | ||
Comment 6•16 years ago
|
||
Here is the proposed fix: - Allow requesting locations which are file protocols to load any URI. - Allow data protocols to be loaded from any context location. From comment 4 this is what I understand is needed.
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
Attachment #335574 -
Flags: superreview?(dmose)
Attachment #335574 -
Flags: review?(neil)
Attachment #335574 -
Flags: review?(dveditz)
Comment 7•16 years ago
|
||
Comment on attachment 335574 [details] [diff] [review] The fix I don't think this affects SeaMonkey because we bail out earlier (code is #ifndef Thunderbird).
Attachment #335574 -
Flags: review?(neil)
Comment 8•16 years ago
|
||
(In reply to comment #7) > (From update of attachment 335574 [details] [diff] [review]) > I don't think this affects SeaMonkey because we bail out earlier (code is > #ifndef Thunderbird). To clarify, file: and data: background images in user*.css load as expected. A data: image in a new message gets turned into a cid: attachment, so this fix only helps SeaMonkey when the start page or a message contains data: images.
Comment 9•16 years ago
|
||
I can however verify that the acid2 test displays correctly with this patch applied and with plugins enabled in the message window.
Assignee | ||
Updated•16 years ago
|
Attachment #335574 -
Flags: review?(neil)
Comment 10•16 years ago
|
||
Comment on attachment 335574 [details] [diff] [review] The fix > rv = aContentLocation->SchemeIs("chrome", &isChrome); > rv |= aContentLocation->SchemeIs("resource", &isRes); >+ rv |= aContentLocation->SchemeIs("data", &isData); > >- if (isExposedProtocol || (NS_SUCCEEDED(rv) && (isChrome || isRes))) >+ if (isExposedProtocol || (NS_SUCCEEDED(rv) && (isChrome || isRes || isData))) r=me on this bit, but I still have no way of testing the other code...
Attachment #335574 -
Flags: review?(neil) → review+
Comment 11•16 years ago
|
||
> data: image in a new message gets turned into a cid: attachment, so this fix
> only helps SeaMonkey when the start page or a message contains data: images.
>
This does not happen (conversion to CID) when you use:
<div style="width: 20%; height: 20%; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAIUlEQVQImWNgwA3+45P4j03Ff3TJ/9gk0AVQJLAaRZTrANZXFOyxhZAqAAAAAElFTkSuQmCC);" );="" align="right">test</div>
I have a composition in my unsent Ermmm outbox ready to test.
This would be the first time I successfully inserted a background-image in a div or a table, in many years of trying.
BTW the background shows in the composition window, but not in the saved message.
Comment 12•16 years ago
|
||
The above with: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1a2pre) Gecko/20080825031404 Shredder/3.0b1pre ID:20080825031404
Comment 13•16 years ago
|
||
This seems to fix moz-border-image in Thunderbird chrome (except for extensions, somehow). This will allow much nicer buttons, so marking blocking-tb3+, and asking for targeting b2 (b1 would be fine, but not necessary).
Flags: blocking-thunderbird3- → blocking-thunderbird3+
Target Milestone: Thunderbird 3.0rc1 → Thunderbird 3.0b2
Updated•16 years ago
|
OS: Windows XP → All
Hardware: PC → All
Comment 14•16 years ago
|
||
Comment on attachment 335574 [details] [diff] [review] The fix r=dveditz
Attachment #335574 -
Flags: review?(dveditz) → review+
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review dmose]
Updated•16 years ago
|
Target Milestone: Thunderbird 3.0b1 → Thunderbird 3.0b2
Updated•16 years ago
|
Attachment #335574 -
Flags: superreview?(dmose) → superreview?(bienvenu)
Updated•16 years ago
|
Attachment #335574 -
Flags: superreview?(bienvenu) → superreview+
Assignee | ||
Comment 15•16 years ago
|
||
Checked in: http://hg.mozilla.org/comm-central/rev/e3756324068f
Status: ASSIGNED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Whiteboard: [needs review dmose]
Target Milestone: Thunderbird 3.0b2 → Thunderbird 3.0b1
You need to log in
before you can comment on or make changes to this bug.
Description
•