New issue
Advanced search Search tips

Issue 751142 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

"contextmenu" in Chrome OS occurs differently than in Chrome for Windows

Reported by ivan.kuc...@gmail.com, Aug 1 2017

Issue description

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

Steps to reproduce the problem:
1. Set the page zoom e.g. to 125% to change devicePixelRatio. Go to https://www.Photopea.com and click "Demo: pea.psd".
2. Right-click multiple times inside the Layers panel on the right.

What is the expected behavior?

What went wrong?
My editor prevents the default "contextmenu" and shows a custom context menu instead.

In Chrome for Windows, everything works as expected ("contextmenu" is fired after releasing the right mouse button). But I get reports, that in Chrome OS, "contextmenu" is fired right after pressing the right mouse button, before releasing it. This can cause many problems to web developers.

Did this work before? N/A 

Chrome version: 60.0.3112.78  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 26.0 r0
 
Components: -Blink Blink>Input
When the context menu is fired depends on what the native OS does.

ChromeOS every other operating system model and displays the context menu on the mouse down (mac, linux are the same).

Windows is the only platform that dispatches it after the mouse up.

See https://cs.chromium.org/chromium/src/content/public/common/web_preferences.cc?sq=package:chromium&l=72
Many developers show a custom context menu on "contextmenu". The items in that custom menu have "mouseup" event for choosing an item.

In Linux / Chrome OS, user may press the right button - the custom context menu is shown. Then releases the mouse button, and since the mouse is at the corner of a custom context menu, "mouseup" is fred on that context menu, resulting into choosing an item. The custom menu is shown and hidden within a single right-click.

Many developers are not aware of these differences between OSs. Since the user is always inside a web browser, maybe we should unify the "contextmenu" behavior for all browsers? Or, if it can not be made to work the same, maybe we should remove that event completely (developers can use mousedown / mouseup and check the Event.button property)? 
Labels: Needs-Triage-M60
You seem to be mixing the logical events and the physical events.

"click", "contextmenu" are logical events with "mousedown", "mouseup" being physical events.

Mixing them is just a cause for issues and won't in fact work very well with touch either. Is there a reason why you can't use click as the activator for the items in the custom memu?
Yes, I can use "click" in the custom menu. But it took me several hours to understand what is going on and to solve it. I am afraid, that hundreds of developers may run into the same problem in the future, and will waste a lot of time because of it.

It is quite shocking to me, that the web standard contains a feature, which is OS-dependent. Can't browsers "override" it from OS and do the right click the same way?

Comment 6 by woxxom@gmail.com, Aug 2 2017

>Can't browsers "override" it from OS and do the right click the same way?

You're suggesting the browsers ignore the platform behavior? This would confuse and irritate millions of users who use other apps in addition to the browser. So the hundreds of developers will have to adapt.
Status: WontFix (was: Unconfirmed)
There are certain decisions that are made to make the application feel native to the host OS. Being that different operating systems work in different fashions things like this are attempted to be hidden from the web developer.

The fact that contextmenu and click events exist are this hiding. Think of what you'd have to write if you didn't know which platform put up the context menu on mousedown vs mouseup? 

Likewise most pages will work based on the logical events for touch screens. ie; long pressing can execute the context menu item and you will get click events for touches.

Sign in to add a comment