Open Bug 298313 Opened 20 years ago Updated 2 years ago

nsIWebNavigation.stop(STOP_CONTENT|STOP_ALL) doesn't cancel pending JavaScript timeouts

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

People

(Reporter: ma1, Unassigned)

References

()

Details

(Keywords: helpwanted)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 ***AND*** Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050620 Firefox/1.0+

According to specs (
http://lxr.mozilla.org/seamonkey/source/docshell/base/nsIWebNavigation.idl#239
), nsIWebNavigation.STOP_CONTENT and nsIWebNavigation.STOP_ALL flags, passed to
the nsIWebNavigation.stop() method, should cause pending JavaScript timeouts to
be cancelled. This doesn't happen in branch nor in trunk (even though in trunk a
cancelPendingEvents() is called on the UI event queue by nsWebNavigation.stop()
for STOP_CONTENT flag).

Reproducible: Always

Steps to Reproduce:
1. Open a page with a recurring Javascript timeout (e.g.
http://software.informaction.com/webnavtest.html )
2. Invoke stop(2) and/or stop(3) on the WebNavigation object hosting that page
3. check if timeout is running

Actual Results:  
The JavaScript timeout callback is executed again after the stop() calls

Expected Results:  
The callback should have not be invoked after the stop() calls
What behavior do we actually want here?  Brendan keeps saying we shouldn't be stopping stuff in various places, but maybe he means not calling Stop() at all?
Blocks: 99625
What behavior? How about what's documented at
http://lxr.cenzic.com/mozilla/source/docshell/base/nsIWebNavigation.idl#259
(killing all pending javascript timeouts).
Yeah, I'm fine with that happening.  Like I said, I think brendan just means we should just be calling Stop() in fewer places.

I'll be happy to review a patch to do this.
Keywords: helpwanted
Assignee: adamlock → g.maone
Status: NEW → ASSIGNED
QA Contact: adamlock → docshell

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: g.maone → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.