Skip to main content

Bug Tracker

Side navigation

#13143 closed bug (fixed)

Opened January 01, 2013 09:14PM UTC

Closed January 06, 2013 03:27PM UTC

Last modified April 08, 2013 03:49PM UTC

e.target can be a text node on mousewheel

Reported by: anonymous Owned by:
Priority: high Milestone: 2.0
Component: event Version: git
Keywords: Cc:
Blocked by: Blocking:
Description

A recent change removed the code that normalized e.target to the parent element node in case it is a text node. This was removed because it apparently was an old Safari bug. However, it's still present in current Chrome.

Demo: http://jsfiddle.net/sbrjL/1/

Hover the text node and see the inconsistency:

  • IE9 shows "HTMLDivElement"
  • Chrome shows "Text"
Attachments (0)
Change History (6)

Changed January 01, 2013 09:16PM UTC by anonymous comment:1

Err, I meant "**scroll** the text node", of course.

Changed January 01, 2013 10:19PM UTC by dmethvin comment:2

component: unfiledevent
milestone: None2.0
priority: undecidedhigh
status: newopen

Thanks for testing and for the report! Well it looks like this check needs to go back in for now. Unfortunately we didn't have a unit test for it, and I'm still not sure we can make a non-contrived one.

For future reference, I don't see that a text node can be the target for any non-deprecated event listed here: http://www.w3.org/TR/DOM-Level-3-Events/#event-types-list

Changed January 06, 2013 03:27PM UTC by Dave Methvin comment:3

resolution: → fixed
status: openclosed

Fix #13143. Event target cannot be a text node.

Check removed in the initial 2.0 refactor but Chrome still needs it. No effective way to unit test; see the test case in #13143.

Changeset: c61150427fc8ccc8e884df8f221a6c9bb5477929

Changed February 16, 2013 10:10AM UTC by mkwst@chromium.org comment:4

Filed https://bugs.webkit.org/show_bug.cgi?id=109939 upstream in WebKit. I've got a patch out for review.

Changed April 08, 2013 03:43PM UTC by sp.shut@gmail.com comment:5

I get a 'Cannot read property nodeType of null' in jQuery.event.fix method when run inside cordova in android 2.3 device when deviceready event fires. A simple check for event.target && event.target.nodeType === 3 fixes the issue.

Changed April 08, 2013 03:49PM UTC by dmethvin comment:6

@sp.shut, this is a closed bug and fixed in the current beta. If you have a different bug to report please create a new ticket and *include a test case* in addition to your description.