Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index d4cada873fd79db991be809ab741937cbd2e69d6..9438070d270c70773ab277db525c65a61eaec337 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -1744,6 +1744,9 @@ void Document::updateLayout() |
if (frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout())) |
frameView->layout(); |
+ if (frameView) |
+ frameView->resetPartialLayoutState(); |
+ |
setNeedsFocusedElementCheck(); |
} |
@@ -1790,6 +1793,26 @@ void Document::updateLayoutIgnorePendingStylesheets() |
m_ignorePendingStylesheets = oldIgnore; |
} |
+void Document::tryPartialUpdateLayoutIgnorePendingStylesheets(RenderObject* stopLayoutAtRenderer) |
+{ |
+ if (stopLayoutAtRenderer) { |
+ // Look for parents that are css regions, flexbox, grid, or flow and prevent partial layout. |
+ // FIXME: should this be a whitelist? |
+ bool canDoPartialLayout = true; |
+ RenderObject* renderer = stopLayoutAtRenderer; |
+ do { |
+ if (renderer->isFlexibleBoxIncludingDeprecated() || renderer->isRenderGrid() || renderer->isRenderRegion() || renderer->isRenderNamedFlowThread() || renderer->isRenderFlowThread()) { |
+ canDoPartialLayout = false; |
+ break; |
+ } |
+ } while ((renderer = renderer->parent())); |
+ if (canDoPartialLayout) |
+ view()->setStopLayoutAtRenderer(stopLayoutAtRenderer); |
+ } |
+ |
+ updateLayoutIgnorePendingStylesheets(); |
+} |
+ |
PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element* element) |
{ |
ASSERT_ARG(element, element->document() == this); |