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

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

Issue 2308333002: Call SelectionController().sendContextMenuEvent() with up-to-date layout tree (Closed)
Patch Set: 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 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after
2032 { 2032 {
2033 FrameView* v = m_frame->view(); 2033 FrameView* v = m_frame->view();
2034 if (!v) 2034 if (!v)
2035 return WebInputEventResult::NotHandled; 2035 return WebInputEventResult::NotHandled;
2036 2036
2037 // Clear mouse press state to avoid initiating a drag while context menu is up. 2037 // Clear mouse press state to avoid initiating a drag while context menu is up.
2038 m_mousePressed = false; 2038 m_mousePressed = false;
2039 LayoutPoint positionInContents = v->rootFrameToContents(event.position()); 2039 LayoutPoint positionInContents = v->rootFrameToContents(event.position());
2040 HitTestRequest request(HitTestRequest::Active); 2040 HitTestRequest request(HitTestRequest::Active);
2041 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re quest, positionInContents, event); 2041 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re quest, positionInContents, event);
2042 // Since |Document::prepareMouseEvent()| modifies layout tree for setting
2043 // hover element, we need to update layout tree for requirement of
2044 // |SelectionController::sendContextMenuEvent()|.
2045 m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
2042 2046
2043 selectionController().sendContextMenuEvent(mev, positionInContents); 2047 selectionController().sendContextMenuEvent(mev, positionInContents);
2044 2048
2045 Node* targetNode = overrideTargetNode ? overrideTargetNode : mev.innerNode() ; 2049 Node* targetNode = overrideTargetNode ? overrideTargetNode : mev.innerNode() ;
2046 return dispatchMouseEvent(EventTypeNames::contextmenu, targetNode, 0, event) ; 2050 return dispatchMouseEvent(EventTypeNames::contextmenu, targetNode, 0, event) ;
2047 } 2051 }
2048 2052
2049 WebInputEventResult EventHandler::sendContextMenuEventForKey(Element* overrideTa rgetElement) 2053 WebInputEventResult EventHandler::sendContextMenuEventForKey(Element* overrideTa rgetElement)
2050 { 2054 {
2051 FrameView* view = m_frame->view(); 2055 FrameView* view = m_frame->view();
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 2604
2601 FrameHost* EventHandler::frameHost() const 2605 FrameHost* EventHandler::frameHost() const
2602 { 2606 {
2603 if (!m_frame->page()) 2607 if (!m_frame->page())
2604 return nullptr; 2608 return nullptr;
2605 2609
2606 return &m_frame->page()->frameHost(); 2610 return &m_frame->page()->frameHost();
2607 } 2611 }
2608 2612
2609 } // namespace blink 2613 } // 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