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

Unified Diff: Source/core/dom/Document.cpp

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: If text autosizing is enabled, only partial layout for the second of two layouts Created 7 years, 4 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
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 7be6a8e208b20d245e268a390d089f7f4c9e230b..7f7157724f2f5a43f9fa60be407cbefdaf51b0aa 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"
@@ -1748,6 +1749,9 @@ void Document::updateLayout()
if (frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout()))
frameView->layout();
+ if (frameView)
+ frameView->resetPartialLayoutState();
+
setNeedsFocusedElementCheck();
}
@@ -1794,6 +1798,29 @@ void Document::updateLayoutIgnorePendingStylesheets()
m_ignorePendingStylesheets = oldIgnore;
}
+void Document::tryPartialUpdateLayoutIgnorePendingStylesheets(RenderObject* stopLayoutAtRenderer)
esprehn 2013/08/18 03:43:15 This should take a Node, not a renderer. You need
pdr. 2013/08/20 06:19:10 Great catch! I refactored the common style recalc
+{
+ if (stopLayoutAtRenderer) {
+ // Non-overlay scrollbars can cause layout during layout.
+ // FIXME: Temporarily ignore non-overlay scrollbars for test coverage.
+ if (true || ScrollbarTheme::theme()->usesOverlayScrollbars()) {
esprehn 2013/08/18 03:43:15 true? You should probably delete this.
pdr. 2013/08/20 06:19:10 I'd like to leave this in for a bit longer since i
+ // 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()));
esprehn 2013/08/18 03:43:15 This is wrong, the style recalc inside updateLayou
pdr. 2013/08/20 06:19:10 Done.
+ if (canPartialLayout)
+ view()->setStopLayoutAtRenderer(stopLayoutAtRenderer);
esprehn 2013/08/18 03:43:15 You don't call any methods on it, but storing a re
pdr. 2013/08/20 06:19:10 No use so... just "after free"? :) Fixed.
+ }
+ }
+
+ updateLayoutIgnorePendingStylesheets();
+}
+
PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Element* element)
{
ASSERT_ARG(element, element->document() == this);

Powered by Google App Engine
This is Rietveld 408576698