New issue
Advanced search Search tips

Issue 823247 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Cannot reliably prevent browser zoom with Ctrl + Mousewheel

Reported by a...@scirra.com, Mar 19 2018

Issue description

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

Steps to reproduce the problem:
1. Visit demo URL: https://www.scirra.com/labs/bugs/browser-zoom.html
2. While scrolling the mouse wheel, press control.

Note: the bug does not reproduce if you press control, then scroll the mouse wheel. You must first be scrolling the mouse wheel, and then hold control while turning the wheel.

What is the expected behavior?
The page calls preventDefault() on all wheel events with ctrlKey set. Therefore, the browser zoom should never change.

What went wrong?
Sometimes the browser zoom changes.

This blocks web apps implementing their own shortcut for this, e.g. zooming a WebGL view.

Did this work before? N/A 

Does this work in other browsers? Yes

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

This affects our PWA at editor.construct.net. It was first reported here: https://github.com/Scirra/Construct-3-bugs/issues/1396
 
Labels: Needs-Triage-M67

Comment 2 by woxxom@gmail.com, Mar 19 2018

Bisect info: 497480 (good) - 497496 (bad)
https://chromium.googlesource.com/chromium/src/+log/8acbd144..234a4ebf?pretty=fuller
Suspecting r497483 = f53825a1fb92e74b9a889b9501243e03de57094d = https://crrev.com/c/619248 by sahel@chromium.org
"Wheel scroll latching and async wheel events flags enabled in testing config."
Landed in 62.0.3197.0

Confirmed by disabling the CL via the following command line and observing the bug is gone:
chrome --disable-features=TouchpadAndWheelScrollLatching
Components: Blink>Scroll
Owner: sahel@chromium.org
Status: Assigned (was: Unconfirmed)
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 27 2018

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

commit b36f1701c605a1f60d1da657649a8f36f313903f
Author: Sahel Sharify <sahel@chromium.org>
Date: Tue Mar 27 21:33:20 2018

Timer based wheel scroll latching breaks when event modifiers change.

This cl changes mouse_wheel_phase_handler to  start a new scroll
sequence when the new wheel event has different modifiers. This change
lets web pages to reliably prevent ctrl+wheel zooming since the wheel
event with different modifiers will be the first event in the new
sequence and will be handled blocking.

Bug:  823247 
Test: *.TimerBasedLatchingBreaksWithModifiersChange
Change-Id: Ie0e5c120f1ccfa57d14fdeba9f388cdbbf679099
Reviewed-on: https://chromium-review.googlesource.com/975985
Commit-Queue: Sahel Sharifymoghaddam <sahel@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546267}
[modify] https://crrev.com/b36f1701c605a1f60d1da657649a8f36f313903f/content/browser/renderer_host/input/mouse_wheel_phase_handler.cc
[modify] https://crrev.com/b36f1701c605a1f60d1da657649a8f36f313903f/content/browser/renderer_host/input/mouse_wheel_phase_handler.h
[modify] https://crrev.com/b36f1701c605a1f60d1da657649a8f36f313903f/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Comment 5 by sahel@chromium.org, Mar 28 2018

Status: Fixed (was: Assigned)

Comment 6 by a...@scirra.com, Mar 28 2018

Great stuff, thanks for the quick fix. Verified no longer reproduces in Canary.

Sign in to add a comment