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

Issue 725005 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 715889



Sign in to add a comment

Context menu targets unfocused contenteditable-element

Reported by hu...@opera.com, May 22 2017

Issue description

Chrome Version: ... 56.0.2906.0, 58.0.3029.110

What steps will reproduce the problem?
1. Select "hej" in <div contenteditable>hej</div>.
2. Let JavaScript do alink.focus().
3. Hit "context menu" key on a PC keyboard.

What is the expected result?
Context menu for <a> is shown. 

What happens instead?
Context menu for "hej" is shown.


 

Comment 1 by yosin@chromium.org, May 23 2017

Blocking: 715889
Project Member

Comment 2 by bugdroid1@chromium.org, May 23 2017

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

commit 48496741476caaedc14e16c9e4e4c90373b6e47e
Author: hugoh <hugoh@opera.com>
Date: Tue May 23 09:47:50 2017

Correct logic "Should ContextMenu target the selection?"

If the selection doesn't have focus, it shouldn't be the target
of the context menu.

For example, an _unfocused_ range selection should not be the
context menu's target (the focused element should be the target).

BUG= 725005 ,  725022 

Review-Url: https://codereview.chromium.org/2880313002
Cr-Commit-Position: refs/heads/master@{#473842}

[modify] https://crrev.com/48496741476caaedc14e16c9e4e4c90373b6e47e/third_party/WebKit/LayoutTests/fast/events/contextmenu-follows-focus.html
[modify] https://crrev.com/48496741476caaedc14e16c9e4e4c90373b6e47e/third_party/WebKit/Source/core/input/EventHandler.cpp

Comment 3 by hu...@opera.com, May 23 2017

Status: Fixed (was: Started)

Sign in to add a comment