Closed
Bug 333262
Opened 19 years ago
Closed 18 years ago
In <inspector.xml>, strict warning "reference to undefined property event.originalTarget.nodeType", filling JS Console
Categories
(Other Applications :: DOM Inspector, defect)
Other Applications
DOM Inspector
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla1.9beta3
People
(Reporter: kairo, Assigned: smaug)
References
Details
Attachments
(1 file, 1 obsolete file)
1.03 KB,
patch
|
sdwilsh
:
review+
neil
:
superreview+
damons
:
approval1.9+
|
Details | Diff | Splinter Review |
When using DOM Inspector on a trunk build from today to debug some pref panel weirdness, I had my JS Console filled with identical warnings from DOMI code:
Warning: reference to undefined property event.originalTarget.nodeType
Source File: chrome://inspector/content/inspector.xml
Line: 455
And that's what I was told in #developers about this:
<NeilAway> KaiRo: yeah, that's smaug's fault
<NeilAway> KaiRo: some events now fire on windows, when they didn't use to
<NeilAway> KaiRo: and of course windows aren't nodes
A bugzilla search didn't turn up an existing bug (only bug 331926 comment #3 telling that it "existed before this patch"), so I think it's a good idea to have a new bug for that :)
Assignee | ||
Comment 2•19 years ago
|
||
So earlier focus and blur events which were dispatched to window had
document as their target, now the target is the window itself.
There are separate events dispatched to document as before.
Do we want to revert back the old behaviour?
I don't like having events dispatched to something which is not the same as the
event.originalTarget. For me all those cases are bugs (which unfortunately can't
always be fixed because of backward compatibility)
Comment 3•19 years ago
|
||
A quick look at the event handler in question suggests that it's only interested in focus events on elements so it should just be a case of tweaking the check.
Assignee | ||
Comment 4•19 years ago
|
||
Could someone tell how to reproduce the bug?
Or provide a patch - this should fix it: s/!event.originalTarget/!("nodeType" in event.originalTarget)/ ;)
Btw, according to http://dev.w3.org/cvsweb/~checkout~/2006/webapi/Window/publish/Window.html event handling with window object won't be specified, though that is just a draft.
![]() |
||
Comment 5•19 years ago
|
||
As a side note, could we just attach the blur/focus listeners in question to the document instead of the window? And could someone post some LXR URIs to the listeners?
Assignee | ||
Comment 6•19 years ago
|
||
sicking, has WepAPI WG discussed about Window and events? What should be the event target?
And Kairo, could you tell me how to reproduce this? I think I want to
make that small change to inspector.xml, but it'd be great to be able to test even
that patch.
We have not talked about this in the WebAPI group no.
Assignee | ||
Comment 8•19 years ago
|
||
Kairo, could you test this?
Attachment #218689 -
Flags: review?(kairo)
Attachment #218689 -
Flags: review?(kairo)
![]() |
Reporter | |
Comment 9•19 years ago
|
||
Comment on attachment 218689 [details] [diff] [review]
untested
I guess one review request is enough :)
Actually, I can't reproduce the original problem any more in an un-patched build (perhaps I needed the broken locales panel to trigger it, not sure) and so I have a problem in testing this.
I also see no error messages in the console with the patch applied, in any case.
Attachment #218689 -
Flags: review?(kairo)
![]() |
Reporter | |
Comment 10•18 years ago
|
||
Comment on attachment 218689 [details] [diff] [review]
untested
Clearing review flag. Sorry, I can't reprocude the problem an more, so I can't test if it gets fixed. Maybe something else fixed the problem, not sure...
Attachment #218689 -
Flags: review?(kairo)
Updated•18 years ago
|
Assignee: dom-inspector → nobody
QA Contact: timeless → dom-inspector
Comment 11•18 years ago
|
||
I can reproduce it consistently by launching DOM Inspector and trying to put focus on it. Very painful with Venkman launched too.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a9pre) Gecko/2007102312 Minefield/3.0a9pre
Comment 12•18 years ago
|
||
(In reply to comment #4)
> Could someone tell how to reproduce the bug?
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a5pre) Gecko/20070515 SeaMonkey/1.5a] (nightly) (W2Ksp4)
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9b3pre) Gecko/2008012302 SeaMonkey/2.0a1pre] (nightly) (W2Ksp4)
Steps:
1. "Tools > Web Development > DOM Inspector".
1r. Get this error, twice.
> Or provide a patch - this should fix it: s/!event.originalTarget/!("nodeType"
> in event.originalTarget)/ ;)
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9b3pre) Gecko/2008012302 SeaMonkey/2.0a1pre] (nightly) (W2Ksp4)
FWIW, this (patch) fixes the error(s).
Now, the discussion seems open as to how best fix this issue...
OS: Linux → All
Summary: reference to undefined property event.originalTarget.nodeType filling JS Console → In <inspector.xml>, strict warning "reference to undefined property event.originalTarget.nodeType", filling JS Console
Version: unspecified → Trunk
Assignee | ||
Comment 13•18 years ago
|
||
Who does DOMi reviews nowadays? If the patch fixes the problem, it IMO should be used. We don't want to special case too many events (load/unload is enough, and those ones are pretty impossible to change because of web compatibility).
Comment 14•18 years ago
|
||
(In reply to comment #13)
> Who does DOMi reviews nowadays? If the patch fixes the problem, it IMO should
> be used. We don't want to special case too many events (load/unload is enough,
> and those ones are pretty impossible to change because of web compatibility).
me, timeless, db48x
needs sr from neil
Assignee | ||
Comment 15•18 years ago
|
||
Attachment #218689 -
Attachment is obsolete: true
Attachment #299569 -
Flags: review?(sdwilsh)
Comment 16•18 years ago
|
||
Comment on attachment 299569 [details] [diff] [review]
event.originalTarget instanceof Element
r=sdwilsh
Attachment #299569 -
Flags: superreview?(neil)
Attachment #299569 -
Flags: review?(sdwilsh)
Attachment #299569 -
Flags: review+
Updated•18 years ago
|
Assignee: nobody → Olli.Pettay
Updated•18 years ago
|
Attachment #299569 -
Flags: superreview?(neil) → superreview+
Assignee | ||
Updated•18 years ago
|
Attachment #299569 -
Flags: approval1.9?
Comment 17•18 years ago
|
||
Comment on attachment 299569 [details] [diff] [review]
event.originalTarget instanceof Element
a1.9+=damons
Attachment #299569 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment 18•18 years ago
|
||
{{
2008-01-29 11:01 Olli.Pettay%helsinki.fi mozilla/extensions/inspector/resources/content/inspector.xml 1.22
}}
Hardware: PC → All
Target Milestone: --- → mozilla1.9beta3
Comment 19•18 years ago
|
||
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9b3pre) Gecko/2008013002 SeaMonkey/2.0a1pre] (nightly) (W2Ksp4)
V.Fixed, per comment 12 steps.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•