Move docshell events to inner window only

RESOLVED DUPLICATE of bug 1182316

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 1182316
4 years ago
3 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 8448247 [details] [diff] [review]
Patch

This one is slightly tricky.  There is (potentially) a behavior change here.  Before if popstate caused a navigation we would end up firing the hashchange at the new inner window.  That seems wrong to me, so I changed it.
Attachment #8448247 - Flags: review?(bugs)

Comment 1

4 years ago
Comment on attachment 8448247 [details] [diff] [review]
Patch


>             // The event dispatch below can cause us to re-enter script and
>-            // destroy the docshell, nulling out mScriptGlobal. Hold a stack
>-            // reference to avoid null derefs. See bug 914521.
>-            nsRefPtr<nsGlobalWindow> win = mScriptGlobal;
>-            if (win) {
>+            // destroy the docshell, nulling out mScriptGlobal or changing the
>+            // inner window. Hold a stack reference to avoid null derefs. See
>+            // bug 914521.
>+            nsCOMPtr<nsPIDOMWindow> inner =
>+              mScriptGlobal->GetCurrentInnerWindow();
Nothing guarantees mScriptGlobal is non-null here, at least in theory.
So, null check.
Attachment #8448247 - Flags: review?(bugs) → review+
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1182316
You need to log in before you can comment on or make changes to this bug.