Bug 135628 - TouchEvent listeners do not trigger from nodes created from different document
Summary: TouchEvent listeners do not trigger from nodes created from different document
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad iOS 7.0
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-05 16:43 PDT by Daniel Freedman
Modified: 2019-02-06 09:18 PST (History)
3 users (show)

See Also:


Attachments
Minimal reproduction case (1.05 KB, text/html)
2014-08-05 16:43 PDT, Daniel Freedman
no flags Details
Version with <template> (1.11 KB, text/html)
2014-08-05 16:58 PDT, Daniel Freedman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Freedman 2014-08-05 16:43:03 PDT
If a node is created in a document that is not the main document (document.implementation.createHTMLDocument), has touch event listeners added, and then is added to the main document, those listeners do not trigger from touches.
The event listeners show up in the inspector, but the handler function is not called.
A synthetic event of the same name (touchstart, touchmove, touchend), will trigger the listener, as expected.
If the event listeners are added after the node is imported into the main document, then the listeners trigger as expected.

However, if a global touch listener is added, say to document.body, then the event listeners on the imported nodes trigger correctly.

This scenario is encountered when using a polyfill for <template>, and with native <template> in iOS 7 and iOS 8 respectively.
In addition, only touch listeners are affected by this, mouse listeners on the same nodes with trigger as expected.

Attached is a minimized repro case.
Comment 1 Daniel Freedman 2014-08-05 16:43:29 PDT
Created attachment 236064 [details]
Minimal reproduction case
Comment 2 Daniel Freedman 2014-08-05 16:58:58 PDT
Created attachment 236065 [details]
Version with <template>
Comment 3 Lucas Forschler 2019-02-06 09:18:25 PST
Mass move bugs into the DOM component.