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

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

Issue 15425005: Don't force layout for mouse event hit tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: touch adjustment in window.internals also needs layout Created 7 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/testing/Internals.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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 FrameView* mainView = mainFrame->view(); 919 FrameView* mainView = mainFrame->view();
920 if (frameView && mainView) { 920 if (frameView && mainView) {
921 IntPoint mainFramePoint = mainView->rootViewToContents(frameView ->contentsToRootView(roundedIntPoint(point))); 921 IntPoint mainFramePoint = mainView->rootViewToContents(frameView ->contentsToRootView(roundedIntPoint(point)));
922 return mainFrame->eventHandler()->hitTestResultAtPoint(mainFrame Point, hitType, padding); 922 return mainFrame->eventHandler()->hitTestResultAtPoint(mainFrame Point, hitType, padding);
923 } 923 }
924 } 924 }
925 } 925 }
926 926
927 HitTestResult result(point, padding.height(), padding.width(), padding.heigh t(), padding.width()); 927 HitTestResult result(point, padding.height(), padding.width(), padding.heigh t(), padding.width());
928 928
929 if (!m_frame->contentRenderer()) 929 // RenderView::hitTest causes a layout, and we don't want to hit that until the first
930 // layout because until then, there is nothing shown on the screen - the use r can't
931 // have intentionally clicked on something belonging to this page. Furthermo re,
932 // mousemove events before the first layout should not lead to a premature l ayout()
933 // happening, which could show a flash of white.
934 // See also the similar code in Document::prepareMouseEvent.
935 if (!m_frame->contentRenderer() || !m_frame->view() || !m_frame->view()->did FirstLayout())
930 return result; 936 return result;
931 937
932 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content. 938 // hitTestResultAtPoint is specifically used to hitTest into all frames, thu s it always allows child frame content.
933 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); 939 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent);
934 m_frame->contentRenderer()->hitTest(request, result); 940 m_frame->contentRenderer()->hitTest(request, result);
935 if (!request.readOnly()) 941 if (!request.readOnly())
936 m_frame->document()->updateHoverActiveState(request, result.innerElement ()); 942 m_frame->document()->updateHoverActiveState(request, result.innerElement ());
937 943
938 if (request.disallowsShadowContent()) 944 if (request.disallowsShadowContent())
939 result.setToNodesInDocumentTreeScope(); 945 result.setToNodesInDocumentTreeScope();
(...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after
3899 unsigned EventHandler::accessKeyModifiers() 3905 unsigned EventHandler::accessKeyModifiers()
3900 { 3906 {
3901 #if OS(DARWIN) 3907 #if OS(DARWIN)
3902 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3908 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3903 #else 3909 #else
3904 return PlatformEvent::AltKey; 3910 return PlatformEvent::AltKey;
3905 #endif 3911 #endif
3906 } 3912 }
3907 3913
3908 } // namespace WebCore 3914 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698