You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 24, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 24, 2022. It is now read-only.
Default to passive: true on root document touch scroll blocking event listeners #35
Chromium/Blink would like to propose an intervention where touch scroll blocking event listeners (touchstart and touchmove) added to Document Level objects would default the AddEventListenerOptions passive field to true.
Document Level objects are defined to be the window, document and body.
Touch scroll blocking event listeners are touchstart and touchmove.
Empirically we have determined that over 80% of touch event listeners invoked don't end up preventing scrolling. There are two opt outs that developers can use:
By placing this in the wicg we are hoping that we can solicit feedback from our colleagues at Microsoft and Apple.
#18 covers more than just this root document intervention it also covers making it by default for everything and making events non-blocking during fling. So this is a concrete implementation of a example used in #18 .
Thanks for filing this specific concrete issue Dave. Note that there's also an active intent thread on blink-dev. We'll do the cross-vendor discussion here and bring any conclusions to the intent discussion.
hmm, target.document == target? What does that mean? Or target.document.documentElement == target? Is this only for events dispatched to Window, Document or Body or what?
I thought this was about listeners on Window, Document or Body.
And does this mean any document, or only documents which have .defaultView != null ?
And any body or only body elements which are in document which has defaultView != null?
Maybe I missed a merge request but is there a property exposed anywhere to query and/or change the default behavior? Or is it all in w3c/touch-events#75?
Note that I have not worked in WebCore for a few years. It would be good to contact Beth Dakin for an official position.
What is the status of getting this behavior into a spec? In whatwg/dom#365 (comment) it was noted that we have tests for this in WPT, but seemingly no spec, so I've renamed the test in web-platform-tests/wpt#29039.
Activity
dtapuska commentedon Oct 25, 2016
/cc @teddink, @smaug----, @RByers, @foolip, @BenjaminPoulain
PTAL as I value feedback from everyone.
smaug---- commentedon Oct 25, 2016
So how is this different to #18 ?
or w3c/touch-events#74 ?
dtapuska commentedon Oct 26, 2016
By placing this in the wicg we are hoping that we can solicit feedback from our colleagues at Microsoft and Apple.
#18 covers more than just this root document intervention it also covers making it by default for everything and making events non-blocking during fling. So this is a concrete implementation of a example used in #18 .
foolip commentedon Oct 26, 2016
Doing it in this venue makes sense, but showing the changes as a patch in DOM would I think make it easier to review.
RByers commentedon Oct 26, 2016
Thanks for filing this specific concrete issue Dave. Note that there's also an active intent thread on blink-dev. We'll do the cross-vendor discussion here and bring any conclusions to the intent discussion.
RByers commentedon Oct 26, 2016
And to be concrete, the precise effect of this change is:
addEventListenertypeistouchstartortouchmove, ANDpassiveoption is unspecified, ANDtargetiswindow,document,document.documentElementordocument.body, THENpassivetotrue.foolip commentedon Oct 26, 2016
Is that any Window, Document or HTMLBodyElement, or some specific ones?
dtapuska commentedon Oct 26, 2016
In Blink the code is here.
foolip commentedon Oct 26, 2016
I guess that's if the target is a Node, and using the "node document". That's unambiguous to me, thanks.
@smaug----, thoughts on that?
RByers commentedon Oct 26, 2016
I've filed this WebKit bug in the hopes that we can get some public signal on whether this is something WebKit would ever consider doing.
smaug---- commentedon Oct 26, 2016
hmm, target.document == target? What does that mean? Or target.document.documentElement == target? Is this only for events dispatched to Window, Document or Body or what?
I thought this was about listeners on Window, Document or Body.
smaug---- commentedon Oct 26, 2016
And does this mean any document, or only documents which have .defaultView != null ?
And any body or only body elements which are in document which has defaultView != null?
dtapuska commentedon Oct 26, 2016
target is instance of EventTarget to which the addEventListener is being called on. It has nothing to do with dispatch target at all.
bzbarsky commentedon Oct 26, 2016
Sure, but what exactly is
target.document? That doesn't make any sense.I think what you mean is something more like (based on looking at the Blink implementation):
dtapuska commentedon Oct 26, 2016
Yes there was an implicit predicate if target is a node on 2, 3, 4.
6 remaining items
dtapuska commentedon Nov 10, 2016
@BenjaminPoulain; do you have any feelings on whatwg/dom#365 ?
@teddink; do you have any feelings on whatwg/dom#365, w3c/touch-events#75 ?
Olli has promised it's on his todo list; I really value other vendors input in this space.
BenjaminPoulain commentedon Nov 10, 2016
Maybe I missed a merge request but is there a property exposed anywhere to query and/or change the default behavior? Or is it all in w3c/touch-events#75?
Note that I have not worked in WebCore for a few years. It would be good to contact Beth Dakin for an official position.
RByers commentedon Jan 12, 2017
Note that this is on track to ship in Chrome 56 - hitting stable in a few weeks.
Sorry I missed this question. No there's no way to change the default, just override it by specifying
{passive:false}.Default passive touch event listeners on the root
Make 2 passive-by-default tests tentative
foolip commentedon May 19, 2021
What is the status of getting this behavior into a spec? In whatwg/dom#365 (comment) it was noted that we have tests for this in WPT, but seemingly no spec, so I've renamed the test in web-platform-tests/wpt#29039.
Make 2 passive-by-default tests tentative (#29039)
Bug 1711851 [wpt PR 29039] - Make 2 passive-by-default tests tentativ…
johannhof commentedon Jun 16, 2022
(As noted in #72, we intend to archive this repository and are thus triaging and resolving all open issues)
Standardization of this particular intervention is tracked in whatwg/dom#365 and Domenic added a comment summarizing the latest status. There's some wpt work going on in web-platform-tests/wpt#34464 now and I think we can close this issue here.