Fix debug assertion on right-click context menu.

This commit is contained in:
Marshall Greenblatt 2016-09-16 12:00:34 -04:00
parent aab55437e2
commit 15d09c7592
2 changed files with 21 additions and 0 deletions

View File

@ -298,4 +298,10 @@ patches = [
'name': 'viewport_2150153002',
'path': '../',
},
{
# Fix debug assertion on right-click context menu.
# https://codereview.chromium.org/2288083002
'name': 'webkit_eventhandler_2288083002',
'path': '../',
},
]

View File

@ -0,0 +1,15 @@
diff --git third_party/WebKit/Source/core/input/EventHandler.cpp third_party/WebKit/Source/core/input/EventHandler.cpp
index a91217a..954df59 100644
--- third_party/WebKit/Source/core/input/EventHandler.cpp
+++ third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -2272,6 +2272,10 @@ WebInputEventResult EventHandler::sendContextMenuEvent(const PlatformMouseEvent&
LayoutPoint positionInContents = v->rootFrameToContents(event.position());
HitTestRequest request(HitTestRequest::Active);
MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(request, positionInContents, event);
+ // Since |Document::prepareMouseEvent()| modifies layout tree for setting
+ // hover element, we need to update layout tree for requirement of
+ // |SelectionController::sendContextMenuEvent()|.
+ m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
selectionController().sendContextMenuEvent(mev, positionInContents);