Closed Bug 1878273 Opened 6 months ago Closed 6 months ago

Shift right clicking a webpage causes text selection

Categories

(Core :: DOM: Selection, defect)

Firefox 123
defect

Tracking

()

VERIFIED FIXED
124 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox122 --- wontfix
firefox123 --- wontfix
firefox124 --- verified
firefox125 --- verified

People

(Reporter: BalaM314, Assigned: masayuki)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0

Steps to reproduce:

  • Go to any web page
  • Left click somewhere in the text
  • Shift right click another part of the text

Actual results:

  • The context menu is opened, AND the text between the first and second clicks is selected

Expected results:

  • The context menu should have opened without selecting the text

Similar to bug 1715603

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Selection' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Selection
Product: Firefox → Core

:masayuki, since you are the author of the regressor, bug 1845241, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(masayuki)

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true

I did some quick test, it seems Chromium and Safari have the same behavior. Maybe it is expected behavior after bug 1845241?

Some websites block or override the right click context menu action. In Chrome, it is possible to completely disable the right click menu. Firefox makes shift+right click open the menu no matter what, which is very useful. I usually use shift+right click when I want to open the context menu.

Ah, interesting. Yeah, we have a special feature for Shift + click. So, the Shift should be "consumed" if the feature is enabled.

Assignee: nobody → masayuki
Severity: -- → S3
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)

We have a pref, dom.event.contextmenu.shift_suppresses_event, which is
default to make Shift + right click forcibly open the context menu without
dispatching contextmenu event to the web.

When user wants to use this feature, they may (or must) assume that it works
as a right click (without Shift) except whether it overrides contextmenu
event listener of the web app. Therefore, Selection should be collapsed
at the click point instead of expanding to the click point.

Unfortunately, we need to consider it at mousedown, not mouseup nor
contextmenu. Therefore, Shift state may mismatch with the actual state at
mouseup and mousedown/poinerdown listeners of web apps may assume it will
expand selection, but I think that we cannot solve these issues.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/043841d38933
Make `Shift` + right click should work as a right click without `Shift` if contextmenu should forcibly be open r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44535 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
Upstream PR merged by moz-wptsync-bot
Flags: qe-verify+

Reproducible on a 2024-02-10 Nightly build on macOS 12.
Verified as fixed on Firefox 124.0b4 and Firefox Nightly 125.0a1 on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: