Closed Bug 473773 Opened 16 years ago Closed 16 years ago

DocumentViewerImpl::InitPresentationStuff can reenter

Categories

(Core :: Web Painting, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1b3

People

(Reporter: peterv, Assigned: peterv)

References

Details

(Keywords: fixed1.9.1)

Attachments

(2 files, 1 obsolete file)

I ran into this while debugging a crash in bug 471126. When loading the crashtest 458637-1.html I sometimes see us reentering DocumentViewerImpl::InitPresentationStuff. I've attached a stack that shows what happens. The testcase is a document with an iframe. The iframe contains a document with an embedded XSLT stylesheet that has an error. We end up in DocumentViewerImpl::SetDOMDocument to set the document to the error document, while there's still a pending restyle on the frame. DocumentViewerImpl::InitPresentationStuff calls mViewManager->EnableRefresh(NS_VMREFRESH_IMMEDIATE) which ends up dealing with the pending restyle, calling DocumentViewerImpl::Show which calls DocumentViewerImpl::InitPresentationStuff again.

There's a couple of ways to fix this, but it's hard for me to judge what would be the right thing to do. Boris suggested passing aReenableRefresh=PR_FALSE to InitPresentationStuff from SetDOMDocument and calling EnableRefresh from SetDOMDocument after InitPresentationStuff has returned. We can also reorder InitPresentationStuff so that the EnableRefresh call is the last thing and reentering is safer. Boris was worried about potential flickering. Roc, any opinions?
Flags: blocking1.9.1?
Attached file Stack trace (obsolete) —
Attached file Stack trace
Attachment #357159 - Attachment is obsolete: true
Related to bug 470582?
To be clear, the major flicker worry was if we change from NS_VMREFRESH_IMMEDIATE to NS_VMREFRESH_DEFERRED in this code.  Moving the EnableRefresh should be reasonably safe, I think, but I wanted roc to sanity-check that.
Passing aReenableRefresh=PR_FALSE sounds good to me.
Attached patch v1Splinter Review
Assignee: nobody → peterv
Status: NEW → ASSIGNED
Attachment #357424 - Flags: superreview?(bzbarsky)
Attachment #357424 - Flags: review?(roc)
Attachment #357424 - Flags: superreview?(bzbarsky) → superreview+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
(In reply to comment #3)
> Related to bug 470582?

Ok, never mind, bug 470582 still seems to crash with the 2009-01-19 build.
Blocking since this blocks blocker bug 471126.
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P1
Target Milestone: mozilla1.9.2a1 → mozilla1.9.1b3
Keywords: fixed1.9.1
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: