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

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

Issue 2860433002: Update WebView/FrameView size from LayoutView::UpdateAfterLayout (Closed)
Patch Set: rebas Created 3 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
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..7f9dc5cef1df563dc96bae2d9e55c557f07499f1 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"
@@ -701,6 +702,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();
cbiesinger 2017/05/05 18:20:01 Shouldn't this be LayoutBlockFlow::?
szager1 2017/05/08 16:27:06 LayoutBlockFlow doesn't have an override for Updat
+}
+
void LayoutView::UpdateHitTestResult(HitTestResult& result,
const LayoutPoint& point) {
if (result.InnerNode())

Powered by Google App Engine
This is Rietveld 408576698