diff options
author | Ben Murdoch <benm@google.com> | 2011-03-15 12:47:30 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-03-15 12:49:04 +0000 |
commit | 115fa20e56568607490319cf8075fca19ae9112c (patch) | |
tree | bb5fb4eb48ab57fb1ae8918073531a80377132f6 | |
parent | 833c9ceaa300f52cf2d1b12a9b3482ad417a3c21 (diff) | |
download | external_webkit-115fa20e56568607490319cf8075fca19ae9112c.zip external_webkit-115fa20e56568607490319cf8075fca19ae9112c.tar.gz external_webkit-115fa20e56568607490319cf8075fca19ae9112c.tar.bz2 |
Fix scrolling on sites hosting content inside a single <frame>
Force a layout of the frameview when we detect that a frames
content post flattening is wider than the original frame.
Also force a relayout of the frame as necessary to sync the
correct dimensions (i.e. when navigation occurs inside the frame)
Bug:4051085
Change-Id: Ib2543601a71b6931bb3ec4bfda75a2cac26bb2a1
-rw-r--r-- | WebCore/page/FrameView.cpp | 14 | ||||
-rw-r--r-- | WebCore/rendering/RenderFrame.cpp | 5 |
2 files changed, 7 insertions, 12 deletions
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index 422343d..3517688 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -950,15 +950,6 @@ void FrameView::layout(bool allowSubtree) } m_hasOverflowScroll = hasOverflowScroll; #endif -#ifdef ANDROID_FLATTEN_FRAMESET - // Request a layout to use the content dimensions. - if (m_frame->ownerRenderer() && m_frame->ownerElement()->hasTagName(frameTag)) { - if (canHaveScrollbars() && layoutWidth() > 1 && layoutHeight() > 1) { - if (layoutWidth() < contentsWidth() || layoutHeight() < contentsHeight()) - m_frame->ownerRenderer()->setNeedsLayout(true, true); - } - } -#endif } void FrameView::addWidgetToUpdate(RenderEmbeddedObject* object) @@ -1563,6 +1554,11 @@ void FrameView::scheduleRelayout() if (!m_frame->document()->shouldScheduleLayout()) return; +#ifdef ANDROID_FLATTEN_FRAMESET + if (m_frame->ownerRenderer()) + m_frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc(); +#endif + // When frame flattening is enabled, the contents of the frame affects layout of the parent frames. // Also invalidate parent frame starting from the owner element of this frame. if (m_frame->settings() && m_frame->settings()->frameFlatteningEnabled() && m_frame->ownerRenderer()) { diff --git a/WebCore/rendering/RenderFrame.cpp b/WebCore/rendering/RenderFrame.cpp index bc40976..a773fbc 100644 --- a/WebCore/rendering/RenderFrame.cpp +++ b/WebCore/rendering/RenderFrame.cpp @@ -80,10 +80,9 @@ void RenderFrame::layout() setWidth(max(view->contentsWidth() + borderAndPaddingWidth(), width())); setHeight(max(view->contentsHeight() + borderAndPaddingHeight(), height())); - // This should trigger a layout of the FrameView which will schedule a - // relayout of this RenderFrame. + // Trigger a layout of the FrameView which will schedule a relayout of this RenderFrame. if (layoutWidth < width()) - setHeight(0); + view->layout(); setNeedsLayout(false); } |