From 8a0914b749bbe7da7768e07a7db5c6d4bb09472b Mon Sep 17 00:00:00 2001 From: Steve Block Date: Mon, 15 Feb 2010 12:23:52 +0000 Subject: Merge webkit.org at r54731 : Initial merge by git Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a --- WebCore/rendering/RenderFrame.cpp | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'WebCore/rendering/RenderFrame.cpp') diff --git a/WebCore/rendering/RenderFrame.cpp b/WebCore/rendering/RenderFrame.cpp index 482d10d..8f704e3 100644 --- a/WebCore/rendering/RenderFrame.cpp +++ b/WebCore/rendering/RenderFrame.cpp @@ -26,6 +26,7 @@ #include "FrameView.h" #include "HTMLFrameElement.h" +#include "RenderView.h" #ifdef FLATTEN_FRAMESET #include "Frame.h" @@ -64,6 +65,7 @@ void RenderFrame::viewCleared() view->setMarginHeight(marginh); } +<<<<<<< HEAD #ifdef FLATTEN_FRAMESET void RenderFrame::layout() { @@ -92,5 +94,58 @@ void RenderFrame::layout() setNeedsLayout(false); } #endif +======= +void RenderFrame::layoutWithFlattening(bool fixedWidth, bool fixedHeight) +{ + // NOTE: The width and height have been set at this point by + // RenderFrameSet::positionFramesWithFlattening() + + FrameView* childFrameView = static_cast(widget()); + RenderView* childRoot = childFrameView ? static_cast(childFrameView->frame()->contentRenderer()) : 0; + HTMLFrameElement* element = static_cast(node()); + + // Do not expand framesets which has zero width or height + if (!width() || !height() || !childRoot) { + updateWidgetPosition(); + if (childFrameView) + childFrameView->layout(); + setNeedsLayout(false); + return; + } + + // need to update to calculate min/max correctly + updateWidgetPosition(); + if (childRoot->prefWidthsDirty()) + childRoot->calcPrefWidths(); + + // if scrollbars are off, and the width or height are fixed + // we obey them and do not expand. With frame flattening + // no subframe much ever become scrollable. + + bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff; + + // make sure minimum preferred width is enforced + if (isScrollable || !fixedWidth || childRoot->isFrameSet()) + setWidth(max(width(), childRoot->minPrefWidth())); + + // update again to pass the width to the child frame + updateWidgetPosition(); + childFrameView->layout(); + + // expand the frame by setting frame height = content height + if (isScrollable || !fixedHeight || childRoot->isFrameSet()) + setHeight(max(height(), childFrameView->contentsHeight())); + if (isScrollable || !fixedWidth || childRoot->isFrameSet()) + setWidth(max(width(), childFrameView->contentsWidth())); + + updateWidgetPosition(); + + ASSERT(!childFrameView->layoutPending()); + ASSERT(!childRoot->needsLayout()); + ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChild() || !childRoot->firstChild()->firstChild()->needsLayout()); + + setNeedsLayout(false); +} +>>>>>>> webkit.org at r54731 } // namespace WebCore -- cgit v1.1