diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch) | |
tree | d49911209b132da58d838efa852daf28d516df21 /WebCore/rendering/RenderFrame.cpp | |
parent | 87eb0cb35bad8784770ebc807e6c982432e47107 (diff) | |
download | external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2 |
Initial Contribution
Diffstat (limited to 'WebCore/rendering/RenderFrame.cpp')
-rw-r--r-- | WebCore/rendering/RenderFrame.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/WebCore/rendering/RenderFrame.cpp b/WebCore/rendering/RenderFrame.cpp index 15bd24e..c996138 100644 --- a/WebCore/rendering/RenderFrame.cpp +++ b/WebCore/rendering/RenderFrame.cpp @@ -30,6 +30,12 @@ #include "HTMLFrameSetElement.h" #include "HTMLNames.h" +#ifdef FLATTEN_FRAMESET +#include "Frame.h" +#include "Document.h" +#include "RenderView.h" +#endif + namespace WebCore { using namespace HTMLNames; @@ -59,4 +65,32 @@ void RenderFrame::viewCleared() } } +#ifdef FLATTEN_FRAMESET +void RenderFrame::layout() +{ + if (m_widget && m_widget->isFrameView()) { + FrameView* view = static_cast<FrameView*>(m_widget); + RenderView* root = NULL; + if (view->frame() && view->frame()->document() && + view->frame()->document()->renderer() && view->frame()->document()->renderer()->isRenderView()) + root = static_cast<RenderView*>(view->frame()->document()->renderer()); + if (root) { + // Resize the widget so that the RenderView will layout according to those dimensions. + view->resize(m_width, m_height); + view->layout(); + // We can only grow in width and height because if positionFrames gives us a width and we become smaller, + // then the fixup process of forcing the frame to fill extra space will fail. + if (m_width > root->docWidth()) { + view->resize(root->docWidth(), 0); + view->layout(); + } + // Honor the height set by RenderFrameSet::positionFrames unless our document height is larger. + m_height = max(root->docHeight(), m_height); + m_width = max(root->docWidth(), m_width); + } + } + setNeedsLayout(false); +} +#endif + } // namespace WebCore |