diff options
author | Patrick Scott <> | 2009-04-15 07:09:41 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-15 07:09:41 -0700 |
commit | 7ad55b5af9aa00b7903d3a73b0ac2555db6a4e91 (patch) | |
tree | 92dde4f11bf46002cb61fe815b0089b1d411edf3 /WebCore | |
parent | d349bb080a83b7e5ba8f59d82395bbf41228a6eb (diff) | |
download | external_webkit-7ad55b5af9aa00b7903d3a73b0ac2555db6a4e91.zip external_webkit-7ad55b5af9aa00b7903d3a73b0ac2555db6a4e91.tar.gz external_webkit-7ad55b5af9aa00b7903d3a73b0ac2555db6a4e91.tar.bz2 |
AI 146317: Traverse the frame tree and compute the largest rectangle that holds all
the frames. If this rectangle is larger than the computed content, make
the frame's view size equal to the computed total so that the content
will be the correct size.
When expanded iframes, set the width and height to the content width and
height plus the padding and border.
BUG=1719555
Automated import of CL 146317
Diffstat (limited to 'WebCore')
-rw-r--r-- | WebCore/rendering/RenderPartObject.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp index 828026e..47a5954 100644 --- a/WebCore/rendering/RenderPartObject.cpp +++ b/WebCore/rendering/RenderPartObject.cpp @@ -349,10 +349,11 @@ void RenderPartObject::layout() // Update the dimensions to get the correct minimum preferred width updateWidgetPosition(); - // Use the preferred width if it is larger. - setWidth(max(w, root->minPrefWidth())); int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); + // Use the preferred width if it is larger. + setWidth(max(w, root->minPrefWidth()) + extraWidth); + // Resize the view to recalc the height. int height = h - extraHeight; int width = w - extraWidth; @@ -367,10 +368,10 @@ void RenderPartObject::layout() view->layout(); int contentHeight = view->contentsHeight(); int contentWidth = view->contentsWidth(); - // Do not shrink iframes with specified sizes - if (contentHeight > h || style()->height().isAuto()) - setHeight(contentHeight); - setWidth(contentWidth); + // Do not shrink iframes with a specified height. + if (contentHeight > (h - extraHeight) || style()->height().isAuto()) + setHeight(contentHeight + extraHeight); + setWidth(contentWidth + extraWidth); // Update one last time updateWidgetPosition(); @@ -404,8 +405,9 @@ void RenderPartObject::calcWidth() { // width updateWidgetPosition(); + int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight(); // Set the width - setWidth(max(width(), root->minPrefWidth())); + setWidth(max(width(), root->minPrefWidth()) + extraWidth); // Update based on the new width updateWidgetPosition(); @@ -414,7 +416,7 @@ void RenderPartObject::calcWidth() { while (view->needsLayout()) view->layout(); - setWidth(view->contentsWidth()); + setWidth(view->contentsWidth() + extraWidth); // Update one last time to ensure the dimensions. updateWidgetPosition(); @@ -437,8 +439,9 @@ void RenderPartObject::calcHeight() { // Do not shrink the height if the size is specified int h = view->contentsHeight(); - if (h > height() || style()->height().isAuto()) - setHeight(h); + int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom(); + if (h > height() - extraHeight || style()->height().isAuto()) + setHeight(h + extraHeight); // Update one last time to ensure the dimensions. updateWidgetPosition(); |