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

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2288083002: Call SelectionController().sendContextMenuEvent() with up-to-date layout tree (Closed)
Patch Set: 2016-08-29T15:45:26 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 { 2034 {
2035 FrameView* v = m_frame->view(); 2035 FrameView* v = m_frame->view();
2036 if (!v) 2036 if (!v)
2037 return WebInputEventResult::NotHandled; 2037 return WebInputEventResult::NotHandled;
2038 2038
2039 // Clear mouse press state to avoid initiating a drag while context menu is up. 2039 // Clear mouse press state to avoid initiating a drag while context menu is up.
2040 m_mousePressed = false; 2040 m_mousePressed = false;
2041 LayoutPoint positionInContents = v->rootFrameToContents(event.position()); 2041 LayoutPoint positionInContents = v->rootFrameToContents(event.position());
2042 HitTestRequest request(HitTestRequest::Active); 2042 HitTestRequest request(HitTestRequest::Active);
2043 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re quest, positionInContents, event); 2043 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re quest, positionInContents, event);
2044 // Since // |Document::prepareMouseEvent()| modifies layout tree for setting
tkent 2016/08/29 08:01:21 Is the second '//' unnecessary?
yosin_UTC9 2016/08/29 08:12:10 Done. No, removed.
2045 // hover element, we need to update layout tree for requirement of
2046 // |SelectionController::sendContextMenuEvent()|.
2047 m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2044 2048
2045 selectionController().sendContextMenuEvent(mev, positionInContents); 2049 selectionController().sendContextMenuEvent(mev, positionInContents);
2046 2050
2047 Node* targetNode = overrideTargetNode ? overrideTargetNode : mev.innerNode() ; 2051 Node* targetNode = overrideTargetNode ? overrideTargetNode : mev.innerNode() ;
2048 return dispatchMouseEvent(EventTypeNames::contextmenu, targetNode, 0, event) ; 2052 return dispatchMouseEvent(EventTypeNames::contextmenu, targetNode, 0, event) ;
2049 } 2053 }
2050 2054
2051 WebInputEventResult EventHandler::sendContextMenuEventForKey(Element* overrideTa rgetElement) 2055 WebInputEventResult EventHandler::sendContextMenuEventForKey(Element* overrideTa rgetElement)
2052 { 2056 {
2053 FrameView* view = m_frame->view(); 2057 FrameView* view = m_frame->view();
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 2606
2603 FrameHost* EventHandler::frameHost() const 2607 FrameHost* EventHandler::frameHost() const
2604 { 2608 {
2605 if (!m_frame->page()) 2609 if (!m_frame->page())
2606 return nullptr; 2610 return nullptr;
2607 2611
2608 return &m_frame->page()->frameHost(); 2612 return &m_frame->page()->frameHost();
2609 } 2613 }
2610 2614
2611 } // namespace blink 2615 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698