Open Bug 1265769 Opened 8 years ago Updated 2 years ago

Don't accidentally enable meta refresh timers in nsDocShell::SetIsActive() if the page has not loaded

Categories

(Core :: DOM: Navigation, defect)

1.9.2 Branch
defect

Tracking

()

People

(Reporter: snorp, Unassigned)

References

()

Details

(Whiteboard: btpp-active)

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #518805 +++

This bug is for addressing the incorrect enabling of timers according to https://bugzilla.mozilla.org/show_bug.cgi?id=518805#c27
Summary: meta refresh should not reload page when tab/window is not active (not visible) or in idle state → don't accidentally enable meta refresh timers in nsDocShell::SetIsActive() if the page has not loaded
Summary: don't accidentally enable meta refresh timers in nsDocShell::SetIsActive() if the page has not loaded → Don't accidentally enable meta refresh timers in nsDocShell::SetIsActive() if the page has not loaded
Comment on attachment 8742889 [details] [diff] [review]
Don't enable meta refresh timers if the page has not finished loading

This isn't quite right either.  SuspendRefreshURIs when we go inactive will suspend all our descendant docshells.  Skipping ResumeRefreshURIs will not resume them, therefore.

Now we _have_ already done SetIsActive stuff on our descendants before we reach this code... but we don't do that for mozbrowsers.

So even with this patch we end up with two remaining issues:

1)  A mozbrowser descendant of this docshell that's done loading will not have its refresh stuff correctly reenabled.  Or more precisely, it should never have been disabled to start with.

2)  If we _are_ done loading we're now walking all kids twice in SetIsActiveInternal: once to SetIsActive* on them, and once under ResumeRefreshURIs/SuspendRefreshURIs.  This means we end up with behavior exponential in the depth of the docshell tree.  Luckily this is capped at 10 or so, so we don't get to experience the true power of 2^{50} or whatnot, but that's still not great...

Seems to me that given the active/inactive semantics around mozbrowser, calling we want to call versions of Resume/SuspendRefreshURIs here that do NOT do anything with the kids, and let the walk over kids earlier in this method handle the kids as needed.  In the case of ResumeRefreshURIs that means just calling RefreshURIFromQueue.  In the case of SuspendRefreshURIs it means either adding an argument to it or factoring out the first part of it into a separate method that we can call here.  Probably the latter, since SuspendRefreshURIs is public API.
Attachment #8742889 - Flags: review?(bzbarsky) → review-
Assignee: nobody → snorp
Whiteboard: btpp-active
See Also: → 1389499

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: snorp → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: