diff options
author | Mangesh Ghiware <mghiware@google.com> | 2012-03-16 14:29:18 -0700 |
---|---|---|
committer | Mangesh Ghiware <mghiware@google.com> | 2012-03-19 17:39:28 -0700 |
commit | 696cf3d1df6a07f13757e175b190aae7dc2d405c (patch) | |
tree | 31f802be8c46f33e97779ec2e53d1baab6e27eb8 /Source/WebCore/rendering | |
parent | 2b38e74b4a37bc93a0f2a21af60dd2ce4d01c5d8 (diff) | |
download | external_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/WebCore/rendering')
-rw-r--r-- | Source/WebCore/rendering/RenderFrame.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
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); } |