summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderFrame.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/rendering/RenderFrame.cpp
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_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.cpp34
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