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

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

Issue 1217943010: Add a FrameView lifecycle method that just updates layout, style and compositing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 // Do a new hit-test in case the mousemove event changed the DOM. 1994 // Do a new hit-test in case the mousemove event changed the DOM.
1995 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we 1995 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we
1996 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page 1996 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page
1997 // could have seen the event anyway). 1997 // could have seen the event anyway).
1998 // Also note that the position of the frame may have changed, so we need to recompute the content 1998 // Also note that the position of the frame may have changed, so we need to recompute the content
1999 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). 1999 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d).
2000 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2000 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2001 if (currentHitTest.innerNode()) { 2001 if (currentHitTest.innerNode()) {
2002 LocalFrame* mainFrame = m_frame->localFrameRoot(); 2002 LocalFrame* mainFrame = m_frame->localFrameRoot();
2003 if (mainFrame && mainFrame->view()) 2003 if (mainFrame && mainFrame->view())
2004 mainFrame->view()->updateLayoutAndStyleForPainting(); 2004 mainFrame->view()->updateAllLifecyclePhases();
2005 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); 2005 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position());
2006 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2006 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2007 } 2007 }
2008 m_clickNode = currentHitTest.innerNode(); 2008 m_clickNode = currentHitTest.innerNode();
2009 2009
2010 // Capture data for showUnhandledTapUIIfNeeded. 2010 // Capture data for showUnhandledTapUIIfNeeded.
2011 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; 2011 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode;
2012 IntPoint tappedPosition = gestureEvent.position(); 2012 IntPoint tappedPosition = gestureEvent.position();
2013 2013
2014 if (m_clickNode && m_clickNode->isTextNode()) 2014 if (m_clickNode && m_clickNode->isTextNode())
(...skipping 13 matching lines...) Expand all
2028 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); 2028 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap);
2029 HitTestResult result = currentHitTest; 2029 HitTestResult result = currentHitTest;
2030 result.setToShadowHostIfInUserAgentShadowRoot(); 2030 result.setToShadowHostIfInUserAgentShadowRoot();
2031 m_frame->chromeClient().onMouseDown(result.innerNode()); 2031 m_frame->chromeClient().onMouseDown(result.innerNode());
2032 } 2032 }
2033 2033
2034 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2034 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2035 if (currentHitTest.innerNode()) { 2035 if (currentHitTest.innerNode()) {
2036 LocalFrame* mainFrame = m_frame->localFrameRoot(); 2036 LocalFrame* mainFrame = m_frame->localFrameRoot();
2037 if (mainFrame && mainFrame->view()) 2037 if (mainFrame && mainFrame->view())
2038 mainFrame->view()->updateLayoutAndStyleForPainting(); 2038 mainFrame->view()->updateAllLifecyclePhases();
2039 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); 2039 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position());
2040 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2040 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2041 } 2041 }
2042 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), 2042 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(),
2043 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), 2043 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(),
2044 static_cast<PlatformEvent::Modifiers>(modifiers), 2044 static_cast<PlatformEvent::Modifiers>(modifiers),
2045 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); 2045 PlatformMouseEvent::FromTouch, gestureEvent.timestamp());
2046 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); 2046 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false);
2047 2047
2048 bool swallowClickEvent = false; 2048 bool swallowClickEvent = false;
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after
3866 unsigned EventHandler::accessKeyModifiers() 3866 unsigned EventHandler::accessKeyModifiers()
3867 { 3867 {
3868 #if OS(MACOSX) 3868 #if OS(MACOSX)
3869 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3869 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3870 #else 3870 #else
3871 return PlatformEvent::AltKey; 3871 return PlatformEvent::AltKey;
3872 #endif 3872 #endif
3873 } 3873 }
3874 3874
3875 } // namespace blink 3875 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2DTest.cpp ('k') | Source/core/input/EventHandlerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698