Closed Bug 386939 Opened 17 years ago Closed 17 years ago

[FIX]"ASSERTION: no user stylesheets in styleset, but we have one!" when removing frames from frameset

Categories

(Core :: Layout, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: bzbarsky)

References

Details

(Keywords: assertion, regression, testcase)

Attachments

(4 files)

Loading the testcase triggers:

###!!! ASSERTION: no user stylesheets in styleset, but we have one!: 'numBefore > 0', file /Users/jruderman/trunk/mozilla/layout/base/nsPresShell.cpp, line 1824

This is a regression from within the last few days.
Attached file testcase (deleted) —
This assertion is triggered when loading http://online.wsj.com/public/us.
reproducible in winxp/linux as well and #6 in a recent top site run with over 1300 occurrences.
OS: Mac OS X → All
It's one of the more visible assertions in Mochitest runs in debug builds, too; I don't have access to a machine to determine which test(s) cause it.
This is a regression from bug 310165.

The problem is that setting up the pref stylesheet fails if there is non-chrome script on the JS stack, because presshell uses the CSSOM API to set it up, and we added security checks to those calls (in particular to InsertRule).

We can either push null JSContexts on the stack in a bunch of places in presshell and in nsMathMLFrame, or we need to add a non-scriptable version of InsertRule that skips the security check.

David, do you have a preference?

Oh, and this bug can easily lead to pages without the pref stylesheet applied, so I think we need to block on it.
Blocks: 310165
Component: Layout: HTML Frames → Layout
Flags: blocking1.9?
QA Contact: layout.html-frames → layout
I don't have a preference, other than whichever seems simpler and more maintainable.
Flags: blocking1.9? → blocking1.9+
Blocks: 403310
Attached patch Fix (deleted) — Splinter Review
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attached patch Same as diff -w (deleted) — Splinter Review
Attachment #288927 - Flags: superreview?(dbaron)
Attachment #288927 - Flags: review?(dbaron)
Summary: "ASSERTION: no user stylesheets in styleset, but we have one!" when removing frames from frameset → [FIX]"ASSERTION: no user stylesheets in styleset, but we have one!" when removing frames from frameset
Blocks: 404077
Comment on attachment 288927 [details] [diff] [review]
Same as diff -w

r+sr=dbaron.

Should the InsertRule security check be changed to fail if there's nothing on the context stack?
Attachment #288927 - Flags: superreview?(dbaron)
Attachment #288927 - Flags: superreview+
Attachment #288927 - Flags: review?(dbaron)
Attachment #288927 - Flags: review+
You mean so that these things won't randomly work sometimes and randomly fail at other times?  That seems like a good idea.  I'll make that change before checking in.
Attached patch Updated to comments (deleted) — Splinter Review
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Crashtest checked in.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: