Intent to Implement and Ship: Remove propagation of mouse wheel events to parent iframe.

247 views
Skip to first unread message

Dave Tapuska

unread,
Feb 24, 2016, 1:30:55 PM2/24/16
to blink-dev
dtap...@chromium.org None
This specific behavior is not covered by any specification :-(.
When an iframe does not handle a mouse wheel event it is currently dispatched to the parent iframe. Mouse wheel events are unique in this dispatching aspect and other vendors FireFox and Microsoft both don't dispatch the event to the parent iframe. This request is to make Chrome match FF and Edge.
Ideally this should be removed it because it interferes with the separation of Scrolling events from MouseWheel events. Right now mouse wheel events are conflated with scroll events; in preparation of passive event listeners for wheel we need to decouple them. Likely it was written this way in order to handle scroll chaining without the desire of actually firing the event at the parent iframe.

The request by a web developer for Firefox to match Chrome's behavior raises some concern that people in fact are relying on this. But it should be noted that the use case that the web developer highlights indicates that it in fact doesn't work for touch based scroll events on all browsers either. Ideally what the web developer wants is Scroll Customization.
Firefox: Public support (Already supported; request filed to change) Edge: No public signals (Already supported) Safari: No public signals Web developers: Mixed signals Some developers might feel some pain if they were relying on propagation of events. None.
https://bugs.chromium.org/p/chromium/issues/detail?id=564042 https://www.chromestatus.com/features/5678869528969216
Yes

Rick Byers

unread,
Feb 24, 2016, 2:05:49 PM2/24/16
to Dave Tapuska, blink-dev
I guess this is more like removing non-standard behavior than "shipping" something new.  The DOM spec and the UI Events spec don't explicitly provide a facility for one logical DOM event to be dispatched to multiple iframes. I suspect this behavior is (possibly accidentally) due to how WebKit implemented mouse wheel scrolling on top of wheel events.  In order to get unhandled scrolls to correctly chain upwards to the parent document we just passed the wheel event around.  So this is kind of a blurry case - it's really just an implementation bug, but there's a chance that some site is relying on it so good to discuss here.

Any site that's relying on this will be broken in Edge and Firefox.  Also it's definitely not possible to do this with touch scrolling (touch events are only dispatched to the inner most frame), so anything relying on this would be broken on touch.  So I think it's pretty safe to eliminate this.  At the same time, this has become urgent because this odd behavior is blocking a valuable refactoring (where we're teasing wheel events and scrolling apart, enabling scroll perf optimizations for passive wheel listeners).  So it's definitely time to fix this IMHO.

LGTM1


Dimitri Glazkov

unread,
Feb 24, 2016, 2:15:09 PM2/24/16
to Rick Byers, Dave Tapuska, blink-dev
LGTM2

Steve Kobes

unread,
Feb 24, 2016, 2:15:52 PM2/24/16
to Rick Byers, Dave Tapuska, blink-dev
Just to be clear: this doesn't affect scroll chaining, right?  The parent frame will still scroll, just without any DOM event firing?

On Wed, Feb 24, 2016 at 11:05 AM, Rick Byers <rby...@chromium.org> wrote:

Elliott Sprehn

unread,
Feb 24, 2016, 2:17:57 PM2/24/16
to Steve Kobes, Rick Byers, Dave Tapuska, blink-dev
This should remove touch gesture (ex. fling) chaining, but I think wheel chaining would stay since each wheel scroll is an independent gesture?

Dave Tapuska

unread,
Feb 24, 2016, 2:33:45 PM2/24/16
to Steve Kobes, Rick Byers, blink-dev
Scroll chaining will still work fine. We just won't dispatch the event inside the parent iframe's DOM but ultimately propagate it up the EventHandlers of the frames.

Here is a proposed change: https://codereview.chromium.org/1731353003

Steve Kobes

unread,
Feb 24, 2016, 2:40:15 PM2/24/16
to Dave Tapuska, Rick Byers, blink-dev
Non-owner lgtm. :)

Chris Harrelson

unread,
Feb 24, 2016, 6:59:41 PM2/24/16
to Steve Kobes, Dave Tapuska, Rick Byers, blink-dev
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages