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

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

Issue 1126883002: Change all one-off lifecycle callers to FrameView::updateLayoutAndStyleForPainting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 // Do a new hit-test in case the mousemove event changed the DOM. 2406 // Do a new hit-test in case the mousemove event changed the DOM.
2407 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we 2407 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we
2408 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page 2408 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page
2409 // could have seen the event anyway). 2409 // could have seen the event anyway).
2410 // Also note that the position of the frame may have changed, so we need to recompute the content 2410 // Also note that the position of the frame may have changed, so we need to recompute the content
2411 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). 2411 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d).
2412 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2412 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2413 if (currentHitTest.innerNode()) { 2413 if (currentHitTest.innerNode()) {
2414 LocalFrame* mainFrame = m_frame->localFrameRoot(); 2414 LocalFrame* mainFrame = m_frame->localFrameRoot();
2415 if (mainFrame && mainFrame->view()) 2415 if (mainFrame && mainFrame->view())
2416 mainFrame->view()->updateLayoutAndStyleIfNeededRecursive(); 2416 mainFrame->view()->updateLayoutAndStyleForPainting();
2417 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); 2417 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position());
2418 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2418 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2419 } 2419 }
2420 m_clickNode = currentHitTest.innerNode(); 2420 m_clickNode = currentHitTest.innerNode();
2421 2421
2422 // Capture data for showUnhandledTapUIIfNeeded. 2422 // Capture data for showUnhandledTapUIIfNeeded.
2423 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; 2423 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode;
2424 IntPoint tappedPosition = gestureEvent.position(); 2424 IntPoint tappedPosition = gestureEvent.position();
2425 2425
2426 if (m_clickNode && m_clickNode->isTextNode()) 2426 if (m_clickNode && m_clickNode->isTextNode())
2427 m_clickNode = ComposedTreeTraversal::parent(*m_clickNode); 2427 m_clickNode = ComposedTreeTraversal::parent(*m_clickNode);
2428 2428
2429 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), 2429 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(),
2430 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), 2430 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(),
2431 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown), 2431 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown),
2432 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); 2432 PlatformMouseEvent::FromTouch, gestureEvent.timestamp());
2433 bool swallowMouseDownEvent = !dispatchMouseEvent(EventTypeNames::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown, true); 2433 bool swallowMouseDownEvent = !dispatchMouseEvent(EventTypeNames::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown, true);
2434 if (!swallowMouseDownEvent) 2434 if (!swallowMouseDownEvent)
2435 swallowMouseDownEvent = handleMouseFocus(MouseEventWithHitTestResults(fa keMouseDown, currentHitTest)); 2435 swallowMouseDownEvent = handleMouseFocus(MouseEventWithHitTestResults(fa keMouseDown, currentHitTest));
2436 if (!swallowMouseDownEvent) 2436 if (!swallowMouseDownEvent)
2437 swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResul ts(fakeMouseDown, currentHitTest)); 2437 swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResul ts(fakeMouseDown, currentHitTest));
2438 2438
2439 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2439 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2440 if (currentHitTest.innerNode()) { 2440 if (currentHitTest.innerNode()) {
2441 LocalFrame* mainFrame = m_frame->localFrameRoot(); 2441 LocalFrame* mainFrame = m_frame->localFrameRoot();
2442 if (mainFrame && mainFrame->view()) 2442 if (mainFrame && mainFrame->view())
2443 mainFrame->view()->updateLayoutAndStyleIfNeededRecursive(); 2443 mainFrame->view()->updateLayoutAndStyleForPainting();
2444 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); 2444 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position());
2445 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2445 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2446 } 2446 }
2447 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), 2447 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(),
2448 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), 2448 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(),
2449 static_cast<PlatformEvent::Modifiers>(modifiers), 2449 static_cast<PlatformEvent::Modifiers>(modifiers),
2450 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); 2450 PlatformMouseEvent::FromTouch, gestureEvent.timestamp());
2451 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); 2451 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false);
2452 2452
2453 bool swallowClickEvent = false; 2453 bool swallowClickEvent = false;
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4150 unsigned EventHandler::accessKeyModifiers() 4150 unsigned EventHandler::accessKeyModifiers()
4151 { 4151 {
4152 #if OS(MACOSX) 4152 #if OS(MACOSX)
4153 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4153 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4154 #else 4154 #else
4155 return PlatformEvent::AltKey; 4155 return PlatformEvent::AltKey;
4156 #endif 4156 #endif
4157 } 4157 }
4158 4158
4159 } // namespace blink 4159 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/ContextMenuControllerTest.cpp ('k') | Source/core/paint/DeprecatedPaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698