Closed Bug 630476 Opened 13 years ago Closed 12 years ago

document.styleSheets can holds multiply copies of the same styleSheet

Categories

(Firefox :: Theme, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: tabmix.onemen, Unassigned)

Details

Each overlay load its own styleSheet into document.styleSheets.

the result is that we can have multiply copies of the same styleSheet.

for example if extension overly for the browser (chrome://browser/content/browser.xul) load <?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?> then we will have 2 copies of content/browser.css

steps:
1. create new profile
2. install Active Stop Button extension (https://addons.mozilla.org/en-US/firefox/addon/active-stop-button/ )

result:
2 copies of content/browser.css in document.styleSheets
Why is this a Firefox bug? Sounds like the extension shouldn't be doing this:

> for example if extension overly for the browser
> (chrome://browser/content/browser.xul) load <?xml-stylesheet
> href="chrome://browser/content/browser.css" type="text/css"?> then we will have
> 2 copies of content/browser.css
maybe extensions shouldn't doing this, but they do.

how can you prevent it from happening ?

if there is multiply copies of the same styleSheet does it affect computing styles efficiency ?
I don't see how we would prevent it as long as core code supports it. And it probably needs to remain supported: someone may want to load the same stylesheet twice and modify one copy with JS, dynamically disable/enable them, etc.
what about CSS transitions.

if you have duplicate rule with CSS transitions what is the expecting effect ?
(In reply to comment #4)
> if you have duplicate rule with CSS transitions what is the expecting effect ?

One of the rules applies, based on the usual cascade.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.