Closed
Bug 856413
Opened 12 years ago
Closed 12 years ago
Once UIEvent#view property is read, value of UIEvent#view property will be `null`
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
FIXED
mozilla23
Tracking | Status | |
---|---|---|
firefox21 | --- | unaffected |
firefox22 | + | fixed |
firefox23 | --- | fixed |
People
(Reporter: nobuoka+001, Assigned: smaug)
References
Details
(Keywords: regression)
Attachments
(1 file)
(deleted),
patch
|
Ms2ger
:
review+
akeybl
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:22.0) Gecko/20130330 Firefox/22.0
Build ID: 20130330030828
Steps to reproduce:
1. add an event listener for UI event (for example: "click" event) to an element by using `addEventListener`
2. emit event (for example: clicking the element)
3. remove the element (`evt.currentTarget`) from DOM tree in the event listener
4. check the `evt.view` property in the event listener
(`evt` is an argument of event listener)
please see: http://jsfiddle.net/nobuoka/qvJfH/ (sample code)
Actual results:
The value of `evt.view` is `null` (on Firefox 22 nightly 2013-03-30)
Expected results:
The value of `evt.view` is defaultView (window object)
see: http://www.w3.org/TR/DOM-Level-3-Events/#events-UIEvent-view
It says "The view attribute identifies the AbstractView from which the event was generated.", so I think it must not changed even when the eventTarget is removed from DOM tree.
Summary: UIEvent#view property is changed when event target is removed from DOM tree in event listener → Once UIEvent#view property is read, value of UIEvent#view property will be `null`
Sorry, comment #0 is wrong.
Instead, see below.
Steps to reproduce:
1. add an event listener for UI event (for example: "click" event) to an element by using `addEventListener`
2. emit event (for example: clicking the element)
3. read the `evt.view` property in the event listener (it should be correct value)
4. read the `evt.view` property again
(`evt` is an argument of event listener)
please see: http://jsfiddle.net/nobuoka/qvJfH/ (sample code)
Actual results:
The value of `evt.view` is `null` (on Firefox 22 nightly 2013-03-30)
Expected results:
The value of `evt.view` is defaultView (window object)
see: http://www.w3.org/TR/DOM-Level-3-Events/#events-UIEvent-view
Comment 2•12 years ago
|
||
Regression range:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=e23e43a2c14e&tochange=8156df33b757
I'll narrow this down.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 8 → All
Hardware: x86_64 → All
Comment 3•12 years ago
|
||
100 already_AddRefed<nsIDOMWindow> GetView()
101 {
102 nsCOMPtr<nsIDOMWindow> view = mView;
103 return mView.forget();
104 }
Assignee: nobody → bugs
Blocks: 847585
status-firefox21:
--- → unaffected
status-firefox22:
--- → affected
status-firefox23:
--- → affected
tracking-firefox22:
--- → ?
Component: Untriaged → DOM: Events
Product: Firefox → Core
Updated•12 years ago
|
Keywords: regression
Assignee | ||
Comment 4•12 years ago
|
||
uh, sorry. Patch coming.
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #732378 -
Flags: review?(Ms2ger)
Comment 6•12 years ago
|
||
Comment on attachment 732378 [details] [diff] [review]
patch
Review of attachment 732378 [details] [diff] [review]:
-----------------------------------------------------------------
I don't know why this needs to return already_AddRefed, but this works.
Attachment #732378 -
Flags: review?(Ms2ger) → review+
Assignee | ||
Comment 7•12 years ago
|
||
Assignee | ||
Comment 8•12 years ago
|
||
Comment on attachment 732378 [details] [diff] [review]
patch
[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 847585
User impact if declined: wrong behavior
Testing completed (on m-c, etc.): landed to m-i
Risk to taking this patch (and alternatives if risky): super-safe
String or IDL/UUID changes made by this patch: NA
Attachment #732378 -
Flags: approval-mozilla-aurora?
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Updated•12 years ago
|
Updated•12 years ago
|
Attachment #732378 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Assignee | ||
Comment 10•12 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•