Polymer thoughts on passive event listeners?

143 views
Skip to first unread message

Rick Byers

unread,
Jan 7, 2016, 4:06:35 PM1/7/16
to Taylor Savage, Daniel Freedman, input-dev
Hey guys,
I realized I've been missing a great source of valuable information by not always soliciting feedback from the polymer team on web platform changes we're working on.

So here's one I'd love your input on: passive event listeners. Daniel, I'm sure this will raise all sorts of emotions for you wrt. pointer events (basically it's designed to bring the good perf properties of pointer events to touch and wheel events).  Are there scenarios today where Polymer is blocking scroll unnecessarily via it's event listeners?  Could you, in theory, make ALL your touch and wheel listeners 'passive'?  Any feedback on the API or solutions you think would be better?

Feel free to file issues on GitHub if you like.

Thanks,
   Rick

Daniel Freedman

unread,
Jan 7, 2016, 5:15:03 PM1/7/16
to Rick Byers, Taylor Savage, input-dev, Emmanuel Garcia, Chris Joel
+ egarciad, cdata

I think most of the touch listeners for polymer could be made passive, except for the one handler that emulates touch-action: none|pan-x|pan-y.

Chris, Emmanuel, are there any other listeners (mousewheel, scroll, etc) you think might be made passive?

--
You received this message because you are subscribed to the Google Groups "input-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+...@chromium.org.

Emmanuel Garcia

unread,
Jan 7, 2016, 7:57:25 PM1/7/16
to Daniel Freedman, Rick Byers, Taylor Savage, input-dev, Chris Joel
1. paper-slider uses preventDefault to prevent selection. https://github.com/Polymer/paper-slider/blob/master/paper-slider.html#L305-L311  Technically speaking the workaround is to set -webkit-user-select:none to the document element, but that may require coordination.


3.  Polymer.IronDropdownScrollManager owned by Chris.


Emmanuel

Rick Byers

unread,
Jan 8, 2016, 9:03:37 AM1/8/16
to Emmanuel Garcia, Daniel Freedman, Taylor Savage, input-dev, Chris Joel
On Thu, Jan 7, 2016 at 7:57 PM, Emmanuel Garcia <egar...@google.com> wrote:
1. paper-slider uses preventDefault to prevent selection. https://github.com/Polymer/paper-slider/blob/master/paper-slider.html#L305-L311  Technically speaking the workaround is to set -webkit-user-select:none to the document element, but that may require coordination.

Is this for mouse or touch or both?  passive listeners don't really apply to mousedown/mousemove etc since there's no conflict there between an app action and scrolling (only 'wheel' and touch events have this problem).


3.  Polymer.IronDropdownScrollManager owned by Chris.


Emmanuel


On Thu, Jan 7, 2016 at 2:14 PM, Daniel Freedman <dfr...@chromium.org> wrote:
+ egarciad, cdata

I think most of the touch listeners for polymer could be made passive, except for the one handler that emulates touch-action: none|pan-x|pan-y.

Yep, that makes sense.  Do you still use that handler on browsers with native touch-action support (Chrome, IE, Edge)?

Chris, Emmanuel, are there any other listeners (mousewheel, scroll, etc) you think might be made passive?

Note that scroll events are always uncancelable (async), so not an issue here. 

Emmanuel Garcia

unread,
Jan 11, 2016, 1:05:11 PM1/11/16
to Rick Byers, Daniel Freedman, Taylor Savage, input-dev, Chris Joel

Is this for mouse or touch or both?  passive listeners don't really apply to mousedown/mousemove etc since there's no conflict there between an app action and scrolling (only 'wheel' and touch events have this problem).

I believe the `down` event is fired from `toushstart` on mobile. +dfreedm for confirmation.

Other than that, the only one I can see that may want to block scrolling is IronDropdownScrollManager  https://github.com/PolymerElements/iron-dropdown/blob/master/iron-dropdown-scroll-manager.html#L181  +cdata

Thanks

Emmanuel

Reply all
Reply to author
Forward
0 new messages