Closed Bug 450191 Opened 13 years ago Closed 13 years ago
"ASSERTION: too late to set quirks style sheet" with document
###!!! ASSERTION: too late to set quirks style sheet: '!mRuleCascades', file /Users/jruderman/central/mozilla/layout/style/nsCSSRuleProcessor.h, line 101 One of the patches in bug 448281 added this assertion. I'm hitting it at http://htmledit.squarefree.com/ and at https://mail.google.com/mail/. The testcase is reduced from http://htmledit.squarefree.com/.
This looks like a real issue. The compat mode of a document can go from quirks to standards or vice versa as a result of document.write. We should probably clear rule cascades in OpenCommon or something along those lines...
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P3
So I'm actually thinking maybe we should just make this work... although I'm wondering why it doesn't work already, given that mQuirkStyleSheet->SetEnabled(aEnable) ought to call ClearRuleCascades.
Here's a patch that I was hoping would work... but it doesn't, I think because cloning sheets with children doesn't set up clones of the children, which means that ClearRuleCascades chaining up to the parent doesn't work. That seems like a pretty major bug, although I'm not very good at remembering what situations we use cloning for. Are there ever any sheets other than UA sheets that can be cloned such that the clones are in different documents or in different levels of the cascade?
We use cloning for chrome sheets and for sheets linked from a given document that have the same URI. I don't think that clones can ever be in different levels of the cascade, and other than UA sheets (and possibly XBL resource sheets? not sure) they can't be in different documents.
Boris, what's the status here after bug 454578 landed?
I think that should make the "work in progress" patch do the right thing now, at first glance...
Attachment #341676 - Attachment is obsolete: true
Comment on attachment 348677 [details] [diff] [review] patch >+++ b/layout/style/nsCSSRuleProcessor.h >+ NS_ASSERTION(!mRuleCascades, >+ "can't quirks style sheet without clearing rule cascades"); "can't toggle" maybe? r+sr=bzbarsky
Fixed in mozilla-central (and thus also on mozilla-1.9.1): http://hg.mozilla.org/mozilla-central/rev/951de4bb933c
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Target Milestone: --- → mozilla1.9.1
Target Milestone: mozilla1.9.1 → mozilla1.9.1b3
Oh, the patch included a test.
Flags: in-testsuite? → in-testsuite+
verified FIXED on builds: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090414 Minefield/3.6a1pre ID:20090414030735 and Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b4pre) Gecko/20090414 Shiretoko/3.5b4pre ID:20090414035212
You need to log in before you can comment on or make changes to this bug.