Bug Tracker

Ticket #13143 (closed bug: fixed)

Opened 22 months ago

Last modified 19 months ago

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:
Blocking: Blocked by:

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"

Change History

comment:1 Changed 22 months ago by anonymous

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

comment:2 Changed 22 months ago by dmethvin

  • Priority changed from undecided to high
  • Status changed from new to open
  • Component changed from unfiled to event
  • Milestone changed from None to 2.0

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

comment:3 Changed 22 months ago by Dave Methvin

  • Status changed from open to closed
  • Resolution set to fixed

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

comment:4 Changed 20 months ago by mkwst@…

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

comment:5 Changed 19 months ago by sp.shut@…

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.

comment:6 Changed 19 months ago by dmethvin

@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.

Note: See TracTickets for help on using tickets.