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

Unified Diff: Source/core/layout/LayoutView.cpp

Issue 1194473003: Make updateLayoutAndStyleForPainting() O(N) in terms of frame number in LayoutView::hitTest() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebasae layout test result because the order of the when the tracing runs changed Created 5 years, 6 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/layout/LayoutView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutView.cpp
diff --git a/Source/core/layout/LayoutView.cpp b/Source/core/layout/LayoutView.cpp
index 5e23df84c7df259ca348d2fc1a3affc5f916711c..7ce7b13975e77e3ae08e1c3ba583ad8a77d68716 100644
--- a/Source/core/layout/LayoutView.cpp
+++ b/Source/core/layout/LayoutView.cpp
@@ -83,17 +83,21 @@ LayoutView::~LayoutView()
bool LayoutView::hitTest(HitTestResult& result)
{
- TRACE_EVENT_BEGIN0("blink,devtools.timeline", "HitTest");
- m_hitTestCount++;
-
- ASSERT(!result.hitTestLocation().isRectBasedTest() || result.hitTestRequest().listBased());
-
// We have to recursively update layout/style here because otherwise, when the hit test recurses
// into a child document, it could trigger a layout on the parent document, which can destroy DeprecatedPaintLayer
// that are higher up in the call stack, leading to crashes.
// Note that Document::updateLayout calls its parent's updateLayout.
- // FIXME: It should be the caller's responsibility to ensure an up-to-date layout.
frameView()->updateLayoutAndStyleForPainting();
+ return hitTestNoLayoutAndStyleUpdate(result);
+}
+
+bool LayoutView::hitTestNoLayoutAndStyleUpdate(HitTestResult& result)
+{
+ TRACE_EVENT_BEGIN0("blink,devtools.timeline", "HitTest");
+ m_hitTestCount++;
+
+ ASSERT(!result.hitTestLocation().isRectBasedTest() || result.hitTestRequest().listBased());
+
commitPendingSelection();
uint64_t domTreeVersion = document().domTreeVersion();
« no previous file with comments | « Source/core/layout/LayoutView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698