summaryrefslogtreecommitdiffstats
path: root/WebCore/page/FrameView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/page/FrameView.cpp')
-rw-r--r--WebCore/page/FrameView.cpp43
1 files changed, 33 insertions, 10 deletions
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 5314a32..422343d 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -515,11 +515,9 @@ void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, Scrollbar
Node* body = document->body();
if (body && body->renderer()) {
if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) {
-#if !defined(ANDROID_FLATTEN_IFRAME) && !defined(ANDROID_FLATTEN_FRAMESET)
body->renderer()->setChildNeedsLayout(true);
vMode = ScrollbarAlwaysOff;
hMode = ScrollbarAlwaysOff;
-#endif
} else if (body->hasTagName(bodyTag)) {
// It's sufficient to just check the X overflow,
// since it's illegal to have visible in only one direction.
@@ -928,7 +926,7 @@ void FrameView::layout(bool allowSubtree)
InspectorInstrumentation::didLayout(cookie);
m_nestedLayoutCount--;
-#if ENABLE(ANDROID_OVERFLOW_SCROLL) && !defined(ANDROID_FLATTEN_IFRAME)
+#if ENABLE(ANDROID_OVERFLOW_SCROLL)
// Reset to false each time we layout in case the overflow status changed.
bool hasOverflowScroll = false;
RenderObject* ownerRenderer = m_frame->ownerRenderer();
@@ -952,6 +950,15 @@ void FrameView::layout(bool allowSubtree)
}
m_hasOverflowScroll = hasOverflowScroll;
#endif
+#ifdef ANDROID_FLATTEN_FRAMESET
+ // Request a layout to use the content dimensions.
+ if (m_frame->ownerRenderer() && m_frame->ownerElement()->hasTagName(frameTag)) {
+ if (canHaveScrollbars() && layoutWidth() > 1 && layoutHeight() > 1) {
+ if (layoutWidth() < contentsWidth() || layoutHeight() < contentsHeight())
+ m_frame->ownerRenderer()->setNeedsLayout(true, true);
+ }
+ }
+#endif
}
void FrameView::addWidgetToUpdate(RenderEmbeddedObject* object)
@@ -1067,6 +1074,29 @@ void FrameView::removeFixedObject()
updateCanBlitOnScrollRecursively();
}
+#if PLATFORM(ANDROID)
+// When the screen size change, fixed positioned element should be updated.
+void FrameView::updatePositionedObjects()
+{
+ RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
+ if (RenderView* root = m_frame->contentRenderer())
+ positionedObjects = root->positionedObjects();
+
+ if (!positionedObjects || positionedObjects->isEmpty())
+ return;
+
+ RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+ for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBox* renderBox = *it;
+ if (renderBox->style()->position() != FixedPosition)
+ continue;
+
+ renderBox->computeLogicalWidth();
+ renderBox->computeLogicalHeight();
+ }
+}
+#endif
+
bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
{
const size_t fixedObjectThreshold = 5;
@@ -1533,13 +1563,6 @@ void FrameView::scheduleRelayout()
if (!m_frame->document()->shouldScheduleLayout())
return;
-#if defined(ANDROID_FLATTEN_IFRAME) || defined(ANDROID_FLATTEN_FRAMESET)
- // This is the Android frame flattening code. The common code below is not
- // used as frameSetFlatteningEnabled() is false on Android.
- if (m_frame->ownerRenderer())
- m_frame->ownerRenderer()->setNeedsLayoutAndPrefWidthsRecalc();
-#endif
-
// When frame flattening is enabled, the contents of the frame affects layout of the parent frames.
// Also invalidate parent frame starting from the owner element of this frame.
if (m_frame->settings() && m_frame->settings()->frameFlatteningEnabled() && m_frame->ownerRenderer()) {