Closed Bug 1260531 Opened 8 years ago Closed 8 years ago

nsSubDocumentFrame::Init call nsFrameLoader::Hide which leads to presentation destruction

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: tnikkel, Assigned: tnikkel)

Details

Attachments

(1 file)

Which is probably a bad idea during frame construction. nsSubDocumentFrame::Init also accesses |this| after the call, which could be deleted. And we should clear the detached views before exiting this function.

Fix is to move the hide call to be done async like the show call for the new frame loader.
Attached patch patchSplinter Review
Attachment #8735992 - Flags: review?(mats)
Found this while looking for potential causes of bug 724355 and bug 1259572. So maybe (hopefully?) this helps those bugs.
Could you CC me on bug 724355?
CC'd you on bug 724355 and bug 1259572.
(In reply to Timothy Nikkel (:tnikkel) from comment #0)
> Which is probably a bad idea during frame construction.
> nsSubDocumentFrame::Init also accesses |this| after the call, which could be
> deleted. And we should clear the detached views before exiting this function.

"before exiting" -> "before calling an external function which can do lots of things"
Group: core-security → layout-core-security
Comment on attachment 8735992 [details] [diff] [review]
patch

Bug 724355 seems unrelated to this bug (it involves nsObjectFrame, not nsSubDocumentFrame).
Bug 1259572 might be related although I'm not convinced it has anything to do with Init.

(In reply to Timothy Nikkel (:tnikkel) from comment #0)
> Which is probably a bad idea during frame construction.

Why?  Scripts are blocked during frame construction.

> nsSubDocumentFrame::Init also accesses |this| after the call, which could be
> deleted. And we should clear the detached views before exiting this function.

Destroying a sub-shell and its frames/views should be completely safe from
the parent shell's (and its frames/views) POV.

I'm inclined to leave this code as is since it seems safer to me to destroy
the old shell/frames/views as soon as possible when we know we wont use them.

If you have any particular error-scenario in mind for bug 1259572, perhaps
we could add assertions/annotations to verify it first?
Attachment #8735992 - Flags: review?(mats)
(In reply to Mats Palmgren (:mats) from comment #6)
> Bug 724355 seems unrelated to this bug (it involves nsObjectFrame, not
> nsSubDocumentFrame).

They hijacked the bug lower down in the comments to be about a crash in GetRootPresContext.

> 
> (In reply to Timothy Nikkel (:tnikkel) from comment #0)
> > Which is probably a bad idea during frame construction.
> 
> Why?  Scripts are blocked during frame construction.
> 
> > nsSubDocumentFrame::Init also accesses |this| after the call, which could be
> > deleted. And we should clear the detached views before exiting this function.
> 
> Destroying a sub-shell and its frames/views should be completely safe from
> the parent shell's (and its frames/views) POV.
> 
> I'm inclined to leave this code as is since it seems safer to me to destroy
> the old shell/frames/views as soon as possible when we know we wont use them.
> 
> If you have any particular error-scenario in mind for bug 1259572, perhaps
> we could add assertions/annotations to verify it first?

Nothing specific.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Blocks: 1261175
No longer blocks: 1261175
Group: layout-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: