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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 380303003: Enable resize and layout for frames with RemoteFrame ancestors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 5 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
« Source/web/WebViewImpl.h ('K') | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index ec01217dbf366abedbba8663cff2d3220623c8fa..0287f32cf713845c29477fc0a5304c4bc2e843d5 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -1589,12 +1589,26 @@ void WebViewImpl::resizePinchViewport(const WebSize& newSize)
page()->frameHost().pinchViewport().setSize(newSize);
}
+WebLocalFrameImpl* WebViewImpl::localFrameRoot()
+{
+ // FIXME: This is a temporary method that finds the first localFrame in a traversal.
+ // This is equivalent to mainFrame() if the mainFrame is in-process. We need to create
+ // separate WebWidgets to be created by RenderWidgets, which are associated with *all*
+ // local frame roots, not just the first one in the tree. Until then, this limits us
+ // to having only one functioning connected LocalFrame subtree per process.
+ for (WebCore::Frame* frame = page()->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (frame->isLocalRoot())
+ return WebLocalFrameImpl::fromFrame(toLocalFrame(frame));
+ }
+ return 0;
+}
+
void WebViewImpl::resize(const WebSize& newSize)
{
if (m_shouldAutoResize || m_size == newSize)
return;
- FrameView* view = mainFrameImpl()->frameView();
+ FrameView* view = localFrameRoot()->frameView();
if (!view)
return;
@@ -1614,18 +1628,21 @@ void WebViewImpl::resize(const WebSize& newSize)
}
{
- // Avoids unnecessary invalidations while various bits of state in FastTextAutosizer are updated.
- FastTextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page());
+ // FIXME: FastTextAutosizer does not yet support out-of-process frames.
+ if (!mainFrameImpl()->frame()->isLocalFrame()) {
+ // Avoids unnecessary invalidations while various bits of state in FastTextAutosizer are updated.
+ FastTextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page());
+ }
m_pageScaleConstraintsSet.didChangeViewSize(m_size);
- updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->viewportDescription());
+ updatePageDefinedViewportConstraints(localFrameRoot()->frame()->document()->viewportDescription());
updateMainFrameLayoutSize();
// If the virtual viewport pinch mode is enabled, the main frame will be resized
// after layout so it can be sized to the contentsSize.
- if (!pinchVirtualViewportEnabled() && mainFrameImpl()->frameView())
- mainFrameImpl()->frameView()->resize(m_size);
+ if (!pinchVirtualViewportEnabled() && localFrameRoot()->frameView())
+ localFrameRoot()->frameView()->resize(m_size);
if (pinchVirtualViewportEnabled())
page()->frameHost().pinchViewport().setSize(m_size);
@@ -1636,7 +1653,7 @@ void WebViewImpl::resize(const WebSize& newSize)
// and thus will not be invalidated in |FrameView::performPreLayoutTasks|.
// Therefore we should force explicit media queries invalidation here.
if (page()->inspectorController().deviceEmulationEnabled()) {
- if (Document* document = mainFrameImpl()->frame()->document())
+ if (Document* document = localFrameRoot()->frame()->document())
document->mediaQueryAffectingValueChanged();
}
}
@@ -1735,7 +1752,7 @@ void WebViewImpl::animate(double monotonicFrameBeginTime)
void WebViewImpl::layout()
{
TRACE_EVENT0("blink", "WebViewImpl::layout");
- PageWidgetDelegate::layout(m_page.get());
+ PageWidgetDelegate::layout(m_page.get(), localFrameRoot()->frame());
updateLayerTreeBackgroundColor();
for (size_t i = 0; i < m_linkHighlights.size(); ++i)
« Source/web/WebViewImpl.h ('K') | « Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698