This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25120 - Incorrect scope chain for window event handlers (should not include document)
Summary: Incorrect scope chain for window event handlers (should not include document)
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-21 19:10 UTC by contributor
Modified: 2014-05-05 22:56 UTC (History)
3 users (show)

See Also:


Attachments
Testcase (278 bytes, text/html)
2014-03-21 19:12 UTC, Boris Zbarsky
Details

Description contributor 2014-03-21 19:10:15 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html
Multipage: http://www.whatwg.org/C#event-handler-attributes
Complete: http://www.whatwg.org/c#event-handler-attributes
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
Incorrect scope chain for window event handlers (should not include document)

Posted from: 98.110.194.132 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Firefox/31.0
Comment 1 Boris Zbarsky 2014-03-21 19:12:18 UTC
Created attachment 1456 [details]
Testcase

This interoperably alerts "Body load handler scope chain: window" in Safari, IE, Firefox, and Chrome, while per the spec as written right now it should be alerting "Body load handler scope chain: document".  We need to fix the spec here.  The scope chain for the handler always starts with the event target, which in this case is the window.  Then if the event target is an element the scope chain includes the document and maybe the form.
Comment 2 contributor 2014-05-01 20:24:49 UTC
Checked in as WHATWG revision r8595.
Check-in comment: Try to make event handler scope chains more accurate.
http://html5.org/tools/web-apps-tracker?from=8594&to=8595
Comment 3 Ian 'Hixie' Hickson 2014-05-01 20:24:59 UTC
Is the new text sufficient? I'm not sure I'm using the JS spec terminology right.
Comment 4 Boris Zbarsky 2014-05-01 20:48:47 UTC
I don't know about that part either, offhand, but apart from that question looks good.
Comment 5 Ian 'Hixie' Hickson 2014-05-05 22:56:54 UTC
Marking fixed; anyone who sees a problem with the text should please feel free to reopen or file a new bug.