Closed Bug 973849 Opened 10 years ago Closed 10 years ago

clearTimeout / clearInterval now throw when called without arguments

Categories

(Core :: DOM: Core & HTML, defect)

27 Branch
x86_64
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30
Tracking Status
firefox27 - wontfix
firefox28 + fixed
firefox29 + fixed
firefox30 --- fixed
firefox-esr24 --- unaffected
b2g-v1.3 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed

People

(Reporter: dobbs.troy, Assigned: bzbarsky)

References

()

Details

(Keywords: regression, site-compat, Whiteboard: [qa-])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140212131424

Steps to reproduce:

Firefox automatically upgraded from 27.0.0 to 27.0.1 and now the second step of complicated javascript on http://thegatheringinlittlerock.com/ will no longer run in canvas.


Actual results:

First step of js shows the loading clock, but when the site is loaded and runs, the canvas "growing tree" no longer functions.


Expected results:

The tree should have grown in canvas as it did with previous version...
An error shown in Error console:

Error: TypeError: Not enough arguments to Window.clearTimeout.
Source File: http://thegatheringinlittlerock.com/js/gathering.js
Line: 348

Regression window:
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/5717dfc80960
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 ID:20131026184508
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/508288a2b62c
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 ID:20131027021707
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=5717dfc80960&tochange=508288a2b62c
Regressed by:
508288a2b62c	Peter Van der Beken — Bug 918345 - Turn on WebIDL binding generation for Window and hook it up to quickstubs. r=bz.
Blocks: 918345
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
Keywords: regression
Chrome didn't throw, but IE11 throws like our new behavior.
Summary: Complicated JS no longer functioning → clearTimeout / clearInterval now throw when called without arguments
The relevant line in the script is:

	clearTimeout();

The old (XPCOM) implementation explicitly listed the argument as optional here, and ignored the no-op call if no argument was passed.  Wish we'd had tests for that bit..

Our new behavior is following the spec, like IE11 is, but maybe the spec just needs changing here.

As data, I just tested the IE behavior on http://fiddle.jshell.net/DXPN4/1/show/ and a no-arguments call to clearTimeout is a no-op in IE8, but throws in IE9+ in standards mode.  Presumably this site was never tested in IE.  :(
I assume, btw, that the page meant to call "timeoutClear", not "clearTimeout", on that line.  But of course that wouldn't do much good, since that would only clear one timeout, not all 10 it wants to clear.  So this page is generally just pretty broken in terms of its timeout handling...
If we're following the current spec, and the page is broken in handling timeouts, this doesn't look like a release-blocker (or even a valid bug).
This is breaking other sites too.  I've filed a spec bug at https://www.w3.org/Bugs/Public/show_bug.cgi?id=24778 and I think we should revert this change on our end, though probably not for 27 at this point.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Whiteboard: [need review]
Comment on attachment 8380242 [details] [diff] [review]
Allow clearInterval/clearTimeout calls with no arguments; just treat them as no-ops.

ah, we special case 0 in the implementation.
Attachment #8380242 - Flags: review?(bugs) → review+
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → mozilla30
Comment on attachment 8380242 [details] [diff] [review]
Allow clearInterval/clearTimeout calls with no arguments; just treat them as no-ops.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 918345 
User impact if declined: Some websites are broken
Testing completed (on m-c, etc.): Passes tests.
Risk to taking this patch (and alternatives if risky): Low risk.  Just restores
   the Firefox 26 behavior for clearInterval/clearTimeout.
String or IDL/UUID changes made by this patch:  None
Attachment #8380242 - Flags: approval-mozilla-beta?
Attachment #8380242 - Flags: approval-mozilla-aurora?
I will wait for the patch in m-c to approve the uplift
https://hg.mozilla.org/mozilla-central/rev/6d22d19bcd2f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Attachment #8380242 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Attachment #8380242 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Deprioritizing this for QA testing given in-testsuite coverage. Please remove the [qa-] whiteboard tag and add the verifyme keyword if this needs manual testing before release.
Whiteboard: [qa-]
Keywords: site-compat
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: