"ASSERTION: too late to set quirks style sheet" with document.write

VERIFIED FIXED in mozilla1.9.1b3

Status

()

P3
normal
VERIFIED FIXED
10 years ago
7 years ago

People

(Reporter: jruderman, Assigned: dbaron)

Tracking

(Blocks: 1 bug, 4 keywords)

Trunk
mozilla1.9.1b3
x86
All
assertion, regression, testcase, verified1.9.1
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9.1 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

10 years ago
Created attachment 333331 [details]
testcase

###!!! 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?

Updated

10 years ago
OS: Mac OS X → All
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P3
(Reporter)

Updated

10 years ago
Blocks: 410460
(Assignee)

Updated

10 years ago
Assignee: nobody → dbaron
(Assignee)

Comment 2

10 years ago
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.
(Assignee)

Comment 3

10 years ago
Created attachment 341676 [details] [diff] [review]
work in progress

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.
(Assignee)

Comment 5

10 years ago
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...
(Assignee)

Comment 7

10 years ago
Created attachment 348677 [details] [diff] [review]
patch

indeed
Attachment #341676 - Attachment is obsolete: true
(Assignee)

Updated

10 years ago
Attachment #348677 - Flags: superreview?(bzbarsky)
Attachment #348677 - Flags: review?(bzbarsky)
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
Attachment #348677 - Flags: superreview?(bzbarsky)
Attachment #348677 - Flags: superreview+
Attachment #348677 - Flags: review?(bzbarsky)
Attachment #348677 - Flags: review+
(Assignee)

Updated

10 years ago
Whiteboard: [needs landing]
(Assignee)

Comment 9

10 years ago
Fixed in mozilla-central (and thus also on mozilla-1.9.1):
http://hg.mozilla.org/mozilla-central/rev/951de4bb933c
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Target Milestone: --- → mozilla1.9.1
(Assignee)

Updated

10 years ago
Target Milestone: mozilla1.9.1 → mozilla1.9.1b3
Keywords: fixed1.9.1
Flags: in-testsuite?
Oh, the patch included a test.
Flags: in-testsuite? → in-testsuite+
Duplicate of this bug: 387872
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
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
(Assignee)

Updated

7 years ago
Blocks: 147691
You need to log in before you can comment on or make changes to this bug.