Closed
Bug 380618
Opened 17 years ago
Closed 17 years ago
The function assigned to window.ononline gets called when the online event is fired (same for window.onoffline)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha8
People
(Reporter: asqueella, Assigned: jst)
References
Details
(Keywords: testcase)
Attachments
(2 files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
cajbir
:
review+
sicking
:
superreview+
|
Details | Diff | Splinter Review |
See bug 336682 comment 24 and the attached testcase.
From comment 24:
> Er, really? Does that break pages that try to have a |var ononline| or that
> assign something like a number to a global ononline variable? See bug 336359
> comment 12.
>
> If it does, is that really what we want?
The testcase here indicates that window.ononline/onoffline is treated like a handler when assigned a function, albeit with the quirkiness of bug 380538.
I don't see how this breaks pages that assign numbers/booleans to global vars named ononline/onoffline, but I could have missed something.
Comment 1•17 years ago
|
||
If it doesn't break such pages (i.e. if the properties are replaceable), then I don't think we have a problem, really... Need to figure out whether it does break them or not, basically.
Flags: blocking1.9?
Comment 2•17 years ago
|
||
If there are other ways for authors to do this, do we really want to pollute the global namespace every time we add new events?
Reporter | ||
Comment 3•17 years ago
|
||
(In reply to comment #1)
> If it doesn't break such pages (i.e. if the properties are replaceable)
Well, what I did was doing
var ononline = 1;
directly in a <script> and then checking the value later in a load handler (after the testcase triggers the events, not that it should matter). Anything else needs to be checked?
If you have a list of uses we shouldn't break with new window.on* handleres, they could be turned into a mochitest.
Jst will figure out what to do :)
Assignee: general → jst
Flags: blocking1.9? → blocking1.9+
Reporter | ||
Comment 5•17 years ago
|
||
content/events/test/test_bug336682.js has 'todo()'s because of this bug. However this bug is resolved, that test should be updated.
Flags: in-testsuite?
Comment 6•17 years ago
|
||
Setting to B1 per conversation with JST.
Target Milestone: --- → mozilla1.9beta1
Assignee | ||
Comment 7•17 years ago
|
||
Per discussion with Chris Double and Dave Camp, we'll be removing the support for window.ononline and window.onoffline in favor of the standard and more flexible window.addEventListener() method of registering listeners for these new events. Patch coming up.
Assignee | ||
Comment 8•17 years ago
|
||
Attachment #270792 -
Flags: superreview?(jonas)
Attachment #270792 -
Flags: review?(chris.double)
Updated•17 years ago
|
Attachment #270792 -
Flags: review?(chris.double) → review+
Attachment #270792 -
Flags: superreview?(jonas) → superreview+
Assignee | ||
Comment 9•17 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 10•17 years ago
|
||
With this patch, did we stop supporting |body.ononline = function () {}| as well? If so, is that what we want to do?
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•