diff options
author | Steve Block <steveblock@google.com> | 2010-02-15 12:23:52 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-02-16 11:48:32 +0000 |
commit | 8a0914b749bbe7da7768e07a7db5c6d4bb09472b (patch) | |
tree | 73f9065f370435d6fde32ae129d458a8c77c8dff /WebCore/rendering/RenderFrame.cpp | |
parent | bf14be70295513b8076f3fa47a268a7e42b2c478 (diff) | |
download | external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.zip external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.gz external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.bz2 |
Merge webkit.org at r54731 : Initial merge by git
Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a
Diffstat (limited to 'WebCore/rendering/RenderFrame.cpp')
-rw-r--r-- | WebCore/rendering/RenderFrame.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
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<FrameView*>(widget()); + RenderView* childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->contentRenderer()) : 0; + HTMLFrameElement* element = static_cast<HTMLFrameElement*>(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 |