Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Issue 2880313002: Correct logic "Should ContextMenu target the selection?" (Closed)

Created:
3 years, 7 months ago by hugoh_UTC2
Modified:
3 years, 7 months ago
Reviewers:
tkent, yosin_UTC9, Xiaocheng
CC:
blink-reviews, chromium-reviews, dtapuska+blinkwatch_chromium.org, Navid Zolghadr
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/chromium/src/+/48496741476caaedc14e16c9e4e4c90373b6e47e

Patch Set 1 #

Total comments: 2

Patch Set 2 : PS2 #

Total comments: 4

Patch Set 3 : Use SelectionHasFocus() to fix unfocused contenteditable #

Total comments: 5

Patch Set 4 : Adds tests for bug 725005 and 725022 #

Total comments: 1

Patch Set 5 : Add a const #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -13 lines) Patch
M third_party/WebKit/LayoutTests/fast/events/contextmenu-follows-focus.html View 1 2 3 2 chunks +40 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 2 3 4 2 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 37 (23 generated)
hugoh_UTC2
yosin@ do you think this simplification is OK ?
3 years, 7 months ago (2017-05-16 06:48:02 UTC) #12
yosin_UTC9
https://codereview.chromium.org/2880313002/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2880313002/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1827 third_party/WebKit/Source/core/input/EventHandler.cpp:1827: if (!override_target_element && selection.SelectionHasFocus()) { It seems |start.AnchorNode() && ...
3 years, 7 months ago (2017-05-16 09:45:22 UTC) #13
hugoh_UTC2
https://codereview.chromium.org/2880313002/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2880313002/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1827 third_party/WebKit/Source/core/input/EventHandler.cpp:1827: if (!override_target_element && selection.SelectionHasFocus()) { On 2017/05/16 09:45:22, yosin_UTC9 ...
3 years, 7 months ago (2017-05-16 12:48:14 UTC) #15
yosin_UTC9
+xiaochengh@, who also reviewed FS::IsHidden(), for second eye https://codereview.chromium.org/2880313002/diff/20001/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2880313002/diff/20001/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1830 third_party/WebKit/Source/core/input/EventHandler.cpp:1830: (selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange() ...
3 years, 7 months ago (2017-05-17 01:54:59 UTC) #17
Xiaocheng
https://codereview.chromium.org/2880313002/diff/20001/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (left): https://codereview.chromium.org/2880313002/diff/20001/third_party/WebKit/Source/core/input/EventHandler.cpp#oldcode1831 third_party/WebKit/Source/core/input/EventHandler.cpp:1831: if (!override_target_element && start.AnchorNode() && !selection.IsHidden() && The current ...
3 years, 7 months ago (2017-05-17 02:06:27 UTC) #18
hugoh_UTC2
https://codereview.chromium.org/2880313002/diff/20001/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (left): https://codereview.chromium.org/2880313002/diff/20001/third_party/WebKit/Source/core/input/EventHandler.cpp#oldcode1831 third_party/WebKit/Source/core/input/EventHandler.cpp:1831: if (!override_target_element && start.AnchorNode() && !selection.IsHidden() && On 2017/05/17 ...
3 years, 7 months ago (2017-05-17 09:07:47 UTC) #20
Xiaocheng
Code change looks fine. Please add a regression test for the case of unfocused range ...
3 years, 7 months ago (2017-05-17 19:20:26 UTC) #21
yosin_UTC9
https://codereview.chromium.org/2880313002/diff/40001/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2880313002/diff/40001/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1805 third_party/WebKit/Source/core/input/EventHandler.cpp:1805: static bool ShouldShowContextMenuAtSelection(const LocalFrame& frame) { On 2017/05/17 at ...
3 years, 7 months ago (2017-05-18 01:17:15 UTC) #22
hugoh_UTC2
PTAL https://codereview.chromium.org/2880313002/diff/40001/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2880313002/diff/40001/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1805 third_party/WebKit/Source/core/input/EventHandler.cpp:1805: static bool ShouldShowContextMenuAtSelection(const LocalFrame& frame) { On 2017/05/18 ...
3 years, 7 months ago (2017-05-22 12:26:12 UTC) #26
Xiaocheng
lgtm
3 years, 7 months ago (2017-05-22 17:50:22 UTC) #28
yosin_UTC9
lgtm +tkent@ for core/input/EventHandler.cpp https://codereview.chromium.org/2880313002/diff/100001/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2880313002/diff/100001/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode1806 third_party/WebKit/Source/core/input/EventHandler.cpp:1806: VisibleSelection visible_selection = nit: s/VisibleSelection/const ...
3 years, 7 months ago (2017-05-23 01:28:24 UTC) #30
tkent
lgtm
3 years, 7 months ago (2017-05-23 01:48:32 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2880313002/120001
3 years, 7 months ago (2017-05-23 07:49:07 UTC) #34
commit-bot: I haz the power
3 years, 7 months ago (2017-05-23 09:48:06 UTC) #37
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/48496741476caaedc14e16c9e4e4...

Powered by Google App Engine
This is Rietveld 408576698