summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
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);
}