summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMangesh Ghiware <mghiware@google.com>2012-03-16 14:29:18 -0700
committerMangesh Ghiware <mghiware@google.com>2012-03-19 17:39:28 -0700
commit696cf3d1df6a07f13757e175b190aae7dc2d405c (patch)
tree31f802be8c46f33e97779ec2e53d1baab6e27eb8 /Source
parent2b38e74b4a37bc93a0f2a21af60dd2ce4d01c5d8 (diff)
downloadexternal_webkit-696cf3d1df6a07f13757e175b190aae7dc2d405c.zip
external_webkit-696cf3d1df6a07f13757e175b190aae7dc2d405c.tar.gz
external_webkit-696cf3d1df6a07f13757e175b190aae7dc2d405c.tar.bz2
Fix scrolling on sites that use <frame>s
Update the dimensions of a frame before expanding it to fit the content width and height. Also, force a relayout of the frame as necessary to sync the correct dimensions (i.e. when navigation occurs inside the frame) Bug: 5978268 Change-Id: Ia282d6e5753fd38b32854e01ca58fa41b3814b21
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/page/FrameView.cpp5
-rw-r--r--Source/WebCore/rendering/RenderFrame.cpp16
2 files changed, 17 insertions, 4 deletions
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index f332074..8f2958c 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -1745,6 +1745,11 @@ void FrameView::scheduleRelayout()
m_frame->ownerRenderer()->setNeedsLayout(true, true);
}
+#ifdef ANDROID_FLATTEN_FRAMESET
+ if (m_frame->ownerRenderer() && m_frame->ownerElement()->hasTagName(frameTag))
+ m_frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc();
+#endif
+
int delay = m_frame->document()->minimumLayoutDelay();
if (m_layoutTimer.isActive() && m_delayedLayout && !delay)
unscheduleRelayout();
diff --git a/Source/WebCore/rendering/RenderFrame.cpp b/Source/WebCore/rendering/RenderFrame.cpp
index 4b1444b..0ae6eda 100644
--- a/Source/WebCore/rendering/RenderFrame.cpp
+++ b/Source/WebCore/rendering/RenderFrame.cpp
@@ -64,7 +64,12 @@ void RenderFrame::layout()
{
FrameView* view = static_cast<FrameView*>(widget());
RenderView* root = view ? view->frame()->contentRenderer() : 0;
+
+ // Do not expand frames which has zero width or height
if (!width() || !height() || !root) {
+ updateWidgetPosition();
+ if (view)
+ view->layout();
setNeedsLayout(false);
return;
}
@@ -75,14 +80,17 @@ void RenderFrame::layout()
return;
}
- int layoutWidth = width();
+ // Update the dimensions to get the correct width and height
+ updateWidgetPosition();
+ if (root->preferredLogicalWidthsDirty())
+ root->computePreferredLogicalWidths();
+ // Expand the frame by setting frame height = content height
setWidth(max(view->contentsWidth() + borderAndPaddingWidth(), width()));
setHeight(max(view->contentsHeight() + borderAndPaddingHeight(), height()));
- // Trigger a layout of the FrameView which will schedule a relayout of this RenderFrame.
- if (layoutWidth < width())
- view->layout();
+ // Update one more time
+ updateWidgetPosition();
setNeedsLayout(false);
}