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

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

Issue 2816873002: Update PaintLayer size during layout, not after.
Patch Set: s/UpdateICBAndViewportSize/ResizeFrameView/ Created 3 years, 8 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: third_party/WebKit/Source/core/layout/LayoutView.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 288b0a55a2924a03b036725e52a5658020feb0bf..509a6aa7d1083ea8bd13a2acdf78943263543d3e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -37,6 +37,7 @@
#include "core/layout/api/LayoutPartItem.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
+#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
#include "core/paint/PaintLayer.h"
#include "core/paint/ViewPaintInvalidator.h"
@@ -278,6 +279,25 @@ void LayoutView::UpdateLayout() {
!ShouldUsePrintingLayout() &&
(!frame_view_ || LogicalWidth() != ViewLogicalWidthForBoxSizing() ||
LogicalHeight() != ViewLogicalHeightForBoxSizing());
+
+ if (!relayout_children && GetDocument().IsSVGDocument()) {
+ for (LayoutObject* child = FirstChild(); child;
+ child = child->NextSibling()) {
+ if (!child->IsSVGRoot())
+ continue;
+ const Length& child_height = child->Style()->LogicalHeight();
+ if (!child_height.IsPercentOrCalc())
+ continue;
+ if (ToLayoutBox(child)->LogicalHeight() !=
+ ValueForLength(child_height,
+ AvailableLogicalHeightUsing(
+ child_height, kExcludeMarginBorderPadding))) {
+ relayout_children = true;
+ layout_scope.SetChildNeedsLayout(child);
+ }
+ }
+ }
+
if (relayout_children) {
layout_scope.SetChildNeedsLayout(this);
for (LayoutObject* child = FirstChild(); child;
@@ -701,6 +721,22 @@ float LayoutView::ZoomFactor() const {
return frame_view_->GetFrame().PageZoomFactor();
}
+void LayoutView::UpdateAfterLayout() {
+ // Unlike every other layer, the root PaintLayer takes its size from the
+ // layout viewport size. The call to AdjustViewSize() will update the
+ // frame's contents size, which will also update the page's minimum scale
+ // factor. The call to ResizeAfterLayout() will calculate the layout viewport
+ // size based on the page minimum scale factor, and then update the FrameView
+ // with the new size.
+ if (HasOverflowClip())
+ GetScrollableArea()->ClampScrollOffsetAfterOverflowChange();
+ LocalFrame& frame = GetFrameView()->GetFrame();
+ if (!GetDocument().Printing())
+ GetFrameView()->AdjustViewSize();
+ frame.GetChromeClient().ResizeAfterLayout(&frame);
+ LayoutBlock::UpdateAfterLayout();
+}
+
void LayoutView::UpdateHitTestResult(HitTestResult& result,
const LayoutPoint& point) {
if (result.InnerNode())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.h ('k') | third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698