Index: Source/core/dom/Document.cpp |
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
index 6952785f34e00eac2e3be70f87d1ea008ad848d3..145d5e9d351db9c47760a647bb8be3692155b08f 100644 |
--- a/Source/core/dom/Document.cpp |
+++ b/Source/core/dom/Document.cpp |
@@ -151,6 +151,7 @@ |
#include "core/platform/DateComponents.h" |
#include "core/platform/HistogramSupport.h" |
#include "core/platform/Language.h" |
+#include "core/platform/ScrollbarTheme.h" |
#include "core/platform/Timer.h" |
#include "core/platform/chromium/TraceEvent.h" |
#include "core/platform/network/HTTPParsers.h" |
@@ -1752,6 +1753,9 @@ void Document::updateLayout() |
if (frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout())) |
frameView->layout(); |
+ if (frameView) |
+ frameView->resetPartialLayoutState(); |
+ |
setNeedsFocusedElementCheck(); |
} |
@@ -1798,6 +1802,29 @@ void Document::updateLayoutIgnorePendingStylesheets() |
m_ignorePendingStylesheets = oldIgnore; |
} |
+void Document::tryPartialUpdateLayoutIgnorePendingStylesheets(RenderObject* stopLayoutAtRenderer) |
+{ |
+ if (stopLayoutAtRenderer) { |
+ // Non-overlay scrollbars can cause layout during layout. |
+ // FIXME: Temporarily ignore non-overlay scrollbars for test coverage. |
+ if (true || ScrollbarTheme::theme()->usesOverlayScrollbars()) { |
+ // FIXME: Text autosizing will not work with partial layout. |
+ bool canPartialLayout = true; |
+ RenderObject* renderer = stopLayoutAtRenderer; |
+ do { |
+ if (!renderer->supportsPartialLayout()) { |
+ canPartialLayout = false; |
+ break; |
+ } |
+ } while ((renderer = renderer->parent())); |
+ if (canPartialLayout) |
+ view()->setStopLayoutAtRenderer(stopLayoutAtRenderer); |
+ } |
+ } |
+ |
+ updateLayoutIgnorePendingStylesheets(); |
+} |
+ |
PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element* element) |
{ |
ASSERT_ARG(element, element->document() == this); |