Closed
Bug 425057
Opened 17 years ago
Closed 16 years ago
Stylesheets shouldn't cache content policy results across documents
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: jwkbugzilla, Unassigned)
References
Details
(Keywords: regression)
In the current nightlies the global stylesheets (UA sheets, userContent.css and Co) will only trigger content policies once for each rule, no matter how often it is applied. For example, put the following rule in your userContent.css file:
@-moz-document domain(google.com) {
body {
background-image: url(http://www.google.com/intl/en_ALL/images/logo.gif);
}
}
Now go to google.com - you will see the Google logo in the background. Select "Block images from google.com" from the context menu and reload the page. The regular logo will be gone, yet the background image remains and you have to restart the browser to get it away. And if you unblock google.com now you will have to restart again to make the background image reappear.
This does not happen in Firefox 2.0.0.12, there content policies are called every time a rule is applied in a new document. And it breaks Adblock Plus because Adblock Plus defines a global style sheet via nsIStyleSheetService and uses a fake cursor property to get notified whenever one of the rules in this style sheet matches (required to give users a feedback and to support exception rules here).
Reporter | ||
Comment 1•17 years ago
|
||
Regression range is 2005112006 to 2005112106 but I have trouble finding the change that might have caused this.
Reporter | ||
Comment 2•17 years ago
|
||
This seems to be a regression from bug 303812 - at least for the cursor property.
Blocks: 303812
Comment 3•17 years ago
|
||
So.... The load should be performed exactly once: the very first time the rule applies to something. That was changed in bug 57607. That predates Gecko 1.9. The background-image behavior should not have changed since then. If it really did change since 1.8, I'd be interested in knowing when.
There was a bug where we would restart the loads every time the rule matched for cursors. All bug 303812 did was make that code look exactly like the background image code.
Note that in the near future I'd really like to remove all content policy checks for loads done from UA stylesheets (just like we don't do content policy checks for loads done from chrome documents)...
Reporter | ||
Comment 4•17 years ago
|
||
(In reply to comment #3)
> Note that in the near future I'd really like to remove all content policy
> checks for loads done from UA stylesheets (just like we don't do content policy
> checks for loads done from chrome documents)...
That's a pretty obvious course of action for UA stylesheets - but not necessarily so for user stylesheets.
You are right, the background-image behavior is the same in Firefox 2.0, don't know why my test turned up something different originally. So only the cursor behavior changed. Problem is, there is only one load but the result will be applied to lots of documents - so that the one content policy call is meaningless.
Comment 5•17 years ago
|
||
> That's a pretty obvious course of action for UA stylesheets - but not
> necessarily so for user stylesheets.
Indeed. The plan is just UA sheets for now.
And yeah, the content policy call is meaningless if you want to do context-sensitive stuff. But to be honest, I couldn't think of legitimate reasons to want multiple content policy checks or multiple loads here.
What information are you getting this way, exactly? Perhaps you just need another way to get this information?
Reporter | ||
Comment 6•16 years ago
|
||
WONTFIX based on comments above - I worked around the issue.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•