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

Unified Diff: Source/core/rendering/RenderView.cpp

Issue 15219003: Move updateLayout() call from RenderLayer to RenderView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add fixme 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/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderView.cpp
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index 5cb83eec3c388313602195bed1ee72a367b8c4b2..81b5595ba27f108931c255321ef2752709d0418f 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -87,6 +87,12 @@ bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result)
bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& location, HitTestResult& result)
{
+ // 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 RenderLayers
+ // 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()->updateLayoutAndStyleIfNeededRecursive();
return layer()->hitTest(request, location, result);
}
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698