Closed Bug 611166 Opened 14 years ago Closed 14 years ago

Use window's context for tracking modal state

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b8

People

(Reporter: Dolske, Assigned: Dolske)

References

Details

Attachments

(1 file)

Attached patch Patch v.1Splinter Review
I noticed with my patches in bug 59314 that I was triggering an assert in nsJSContext::LeaveModalState()... "Uh, mismatched LeaveModalState() call!". A bit of debugging revealed that nsGlobalWindow::LeaveModalState was getting a different context that the one it got in ::EnterModalState.

bkap explains that, basically, in the EnterModalState call it's picking up the existing content (chrome?) context. But since the 2nd event loop is still on the stack when calling LeaveModalState, there's a null context pushed, and thus the obtained context is that of the JS component where this code lives. After a bit of discussion with jst, there was conclusion that we should (1) use the window's context to avoid this problem and (2) file a followup bug to improve how we track modal state.

This patch is still compiling. ;)
Attachment #489673 - Flags: review?(mrbkap)
Attachment #489673 - Flags: review?(mrbkap) → review+
...and filed bug 611170 for improving the state tracking.
Comment on attachment 489673 [details] [diff] [review]
Patch v.1

a=me since this is simple and blocks a blocker.
Attachment #489673 - Flags: approval2.0+
Pushed http://hg.mozilla.org/mozilla-central/rev/de3b5061113f
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: