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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index f158f9700059c75ffdd95941b30daf35a0f83709..fc4c24b96a17052cb21071c7a20c3bdcfa0da124 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -926,7 +926,13 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTe
HitTestResult result(point, padding.height(), padding.width(), padding.height(), padding.width());
- if (!m_frame->contentRenderer())
+ // RenderView::hitTest causes a layout, and we don't want to hit that until the first
+ // layout because until then, there is nothing shown on the screen - the user can't
+ // have intentionally clicked on something belonging to this page. Furthermore,
+ // mousemove events before the first layout should not lead to a premature layout()
+ // happening, which could show a flash of white.
+ // See also the similar code in Document::prepareMouseEvent.
+ if (!m_frame->contentRenderer() || !m_frame->view() || !m_frame->view()->didFirstLayout())
return result;
// hitTestResultAtPoint is specifically used to hitTest into all frames, thus it always allows child frame content.
« 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