diff options
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/android/ScrollViewAndroid.cpp | 21 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 6 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 1 |
3 files changed, 11 insertions, 17 deletions
diff --git a/WebCore/platform/android/ScrollViewAndroid.cpp b/WebCore/platform/android/ScrollViewAndroid.cpp index 74f9d6b..dec3183 100644 --- a/WebCore/platform/android/ScrollViewAndroid.cpp +++ b/WebCore/platform/android/ScrollViewAndroid.cpp @@ -54,21 +54,12 @@ namespace WebCore { IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const { - if (parent()) { - const ScrollView* sv = this; - int offsetX = 0; - int offsetY = 0; - while (sv->parent()) { - offsetX += sv->x(); - offsetY += sv->y(); - sv = sv->parent(); - } - IntRect rect = sv->platformWidget()->getVisibleBounds(); - rect.move(-offsetX, -offsetY); - rect.intersect(IntRect(0, 0, width(), height())); - return rect; - } - return platformWidget()->getVisibleBounds(); + // iframe's visible content rect is relative to its parent, not the viewport. + // As we auto expand the iframe, the frame rect is the content rect. + if (parent()) + return IntRect(0, 0, width(), height()); + else + return platformWidget()->getVisibleBounds(); } IntSize ScrollView::platformContentsSize() const diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 8403a03..1fb36ec 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -125,7 +125,8 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) : if (m_client) { RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_client); RenderLayer* renderLayer = backing->owningLayer(); - m_contentLayer->setIsRootLayer(renderLayer->isRootLayer()); + m_contentLayer->setIsRootLayer(renderLayer->isRootLayer() && + !(renderLayer->renderer()->frame()->ownerElement())); } gDebugGraphicsLayerAndroidInstances++; } @@ -350,7 +351,8 @@ void GraphicsLayerAndroid::setMasksToBounds(bool masksToBounds) void GraphicsLayerAndroid::setDrawsContent(bool drawsContent) { GraphicsLayer::setDrawsContent(drawsContent); - + if (m_contentLayer->isRootLayer()) + return; if (m_drawsContent) { m_haveContents = true; setNeedsDisplay(); diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index b6b6f70..b98d4dd 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -123,6 +123,7 @@ public: void setMasksToBounds(bool); void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; } + bool isRootLayer() const { return m_isRootLayer; } SkPicture* recordContext(); |