Chromium Code Reviews
DescriptionMenuController Do Not SetSelection to Empty Items on Drag
There is a Chrome crash caused by the following:
- Menu opened
- Submenu of the above opened, with only an empty menu item
- Context menu nested above the empty menu item
- A dragging right-click outside of the context menu, and within the empty
menu item
- Pressing ESC once the context menu has relaunched
Empty menu items cannot be set as selection targets, and we do not allow arrow
keys to select them. In a normal mouse over they are ignored.
MenuController::OnMouseDragged however was not handling the result of
GetMenuPart which signified an empty menu item. It would attempt to update the
selection to an invalid state, and would hide the current menu.
The subsequent OnMouseReleased would bring back the context menu, as the drag
was only hiding the menu, not closing.
The subsequent ESC key would then attempt to be processed by the invalid menu
set in OnMouseDragged.
This change update OnMouseDragged to properly ingore mouse targets of empty menu
items. Bringing it inline with the behaviours of OnMouseMoved.
TEST=MenuControllerTest.RepostEventToEmptyMenuItem
BUG=704846
Review-Url: https://codereview.chromium.org/2778383002
Cr-Commit-Position: refs/heads/master@{#460449}
Committed: https://chromium.googlesource.com/chromium/src/+/1f74ed2b7c59a6202072a0ceee38bbfb922bfb61
Patch Set 1 #
Total comments: 2
Patch Set 2 : fix test #Patch Set 3 : Fix Windows Test #Patch Set 4 : Make logic readible #
Messages
Total messages: 22 (17 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||