Capture semantics for a node that moves between documents

Should the spec say something about how capture behaves on a node that
moves between document?

I came across a bug I filed for a real-world issue I saw here with touch
events (details below), and it's not clear to me if pointer events and the
explicit capture API make this any better.


---------- Forwarded message ----------
From: Rick Byers <>
Date: Wed, Jul 16, 2014 at 10:55 AM
Subject: Touch semantics when touched node changes documents (eg. polymer
To: "" <>
Cc: polymer-dev <>, input-dev <>

We've talked before about some of the implications of the implicit capture
targeting model used by touch events.  Eg. that removing a node while
touching it has surprising (but workable) behavior
<> [1].  And
we've also talked about how multiple active touches in separate documents
<> [2]
should behave.

But I've never heard any discussion about what browsers should do if a node
moves documents while the target of a touch.  Here's a test page
<> [3] that shows Safari and (prior to a
crash I accidentally introduced <> [4]) Chrome
appears to just stop sending any events in such a situation (not visible to
the target node, original document, or new document).

This seems problematic since the code handling the touch events may be
logically separate (in another component, even owned by a different
organization) than one that may be manipulating the DOM.  For example,
imagine some infinite news feed (facebook etc.) with JavaScript-driven
touch scrolling.  DOM elements may come and go (possibly to/from transient
documents for staging purposes or nested iframes for isolation reasons)
based on network activity disconnected from scrolling.  It shouldn't be
necessary (even if it's desirable for performance reasons) to
co-ordinate/suppress the DOM manipulation code with the touch handling code.

I'm surprised I've never heard anyone complain about this before.
Presumably it's one of those rare "touch doesn't work right but I don't
understand why" cases.  Polymer's implementation of <template> elements
(the scenario I saw this hit in) could make this more common.  I've filed a
bug <> to track addressing this in blink somehow.

What do you think.  Do you agree this is something that should be addressed
to improve rationality?  I've got a couple possible ideas, but I'd like to
here from others.



Received on Thursday, 30 April 2015 19:43:53 UTC