New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 770678 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Cannot block browser zoom in mousewheel event

Reported by a...@scirra.com, Oct 2 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3230.0 Safari/537.36

Steps to reproduce the problem:
1. Visit https://editor.construct.net/#open=ghost-shooter-tut
2. Click OK if a beta warning appears and wait for project to load
3. Hold control and scroll the mouse wheel

What is the expected behavior?
The middle view should zoom, and the browser should not scale the page. This is the behavior in Chrome 61.0.3163.100 (stable).

What went wrong?
The middle view zooms, but the browser also scales the entire page, which breaks the ability to zoom with this shortcut in our PWA. This is the behavior in Chrome 63.0.3230.0 (canary), so it appears to be a regression.

Did this work before? Yes 61.0.3163.100

Does this work in other browsers? Yes

Chrome version: 63.0.3230.0  Channel: canary
OS Version: 10.0
Flash Version: 

We listen for "mousewheel" events when the control/meta key is held down, and call preventDefault() to stop the browser scaling the page so our PWA can handle the zoom and scale the main view instead (rendered with WebGL). This does not appear to work in Canary.

We don't want to block page scaling entirely: we know it's an important accessibility feature. However users can still reach this feature via Chrome's menu and clicking the Zoom options. It is only the Ctrl+Mousewheel shortcut we want to handle ourselves.
 

Comment 1 by woxxom@gmail.com, Oct 2 2017

1. open the attached test.html
2. hold Ctrl and scroll the mouse wheel
Expected: the text size remains the same; no "zoom lens" icon in the address bar
Observed: the text size changes; "zoom lens" icon appears in the address bar

Bisect info: 497480 (good) - 497484 (bad)
https://chromium.googlesource.com/chromium/src/+log/8acbd144..faa11d38?pretty=fuller
Suspecting r497483 "Wheel scroll latching and async wheel events flags enabled in testing config"
Landed in 62.0.3197.0

Confirmed by disabling scroll latching via command line and observing the bug is gone:
chrome --disable-features=TouchpadAndWheelScrollLatching
test.html
314 bytes View Download
Labels: Needs-Triage-M61 Needs-Bisect
Cc: sahel@chromium.org brajkumar@chromium.org
Components: Blink>Scroll
Labels: -Pri-2 -Needs-Bisect M-63 hasbisect Pri-1
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Windows-10 using chrome latest canary #63.0.3232.2 by following test case provided in the comment #1, but unable to reproduce the same on equivalent dev build #63.0.3232.2. Unable to reproduce on Ubuntu 14.04 as well.

As per bisect info provided in comment #1 adding @sahel for more updates on this issue.

sahel@ Could you please take a look in to this issue? If it's not related to your change please feel free to reassign to the concerned dev.

Thanks! 
Cc: bokan@chromium.org dtapu...@chromium.org
Owner: sahel@chromium.org
Status: Assigned (was: Untriaged)
Labels: Hotlist-Input-Dev
 Issue 771798  has been merged into this issue.
Labels: -Needs-Triage-M61 Needs-Triage-M63
I think we need to check the modifier flags on the event here:

https://cs.chromium.org/chromium/src/content/browser/renderer_host/input/mouse_wheel_event_queue.cc?sq=package:chromium&l=291

And make sure ctrl is not set.

Comment 9 by a...@scirra.com, Oct 5 2017

Is it possible to have this fixed in M62? This is likely to cause serious usability issues in our PWA if 62 ships to stable with this issue.
I don't think this issue exists in 61 or 62. Unless do you have experimental web platform features enabled locally?

Comment 11 by a...@scirra.com, Oct 5 2017

Oh, is it behind a flag in M62? If so that's OK, I've only checked M61 and M63 so far.
Status: Started (was: Assigned)
Project Member

Comment 13 by bugdroid1@chromium.org, Oct 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5df9af55ac33d5b1bd4e0b14e01b7938fab94b16

commit 5df9af55ac33d5b1bd4e0b14e01b7938fab94b16
Author: Sahel Sharify <sahel@chromium.org>
Date: Fri Oct 06 13:35:32 2017

Synthetic wheel end event shouldn't have any wheel ticks.

The synthetic wheel end event is not sent to JS and it cannot get
preventDefaulted based on its modifiers. This can cause a regression
when ctrl-zoom is prevented by checking the event modifiers in
mouseWheelListeners. This cl fixes the issue by explicitly assigning
zero wheel ticks to the synthetic wheel end event instead of getting the
ticks of the last real wheel event.

TimerBasedWheelEventPhaseInfo

Bug:  770678 
Test: RenderWidgetHostViewAuraWheelScrollLatchingEnabledTest.
Change-Id: I8b294f6e35516ba6e5a30cac4d0f06fe5dba3311
Reviewed-on: https://chromium-review.googlesource.com/701734
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507045}
[modify] https://crrev.com/5df9af55ac33d5b1bd4e0b14e01b7938fab94b16/content/browser/renderer_host/input/mouse_wheel_phase_handler.cc
[modify] https://crrev.com/5df9af55ac33d5b1bd4e0b14e01b7938fab94b16/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment