summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2012-03-06 17:10:29 -0800
committerNicolas Roard <nicolasroard@google.com>2012-03-07 15:10:47 -0800
commit47b8a953ab1b71113b605fd84489f63938bd7dd7 (patch)
tree88647e8ac2b779805910a0464a57870f7344457a /Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
parentbb78287b9586253a7ae7d5d8b1a7a0326643c7ce (diff)
downloadexternal_webkit-47b8a953ab1b71113b605fd84489f63938bd7dd7.zip
external_webkit-47b8a953ab1b71113b605fd84489f63938bd7dd7.tar.gz
external_webkit-47b8a953ab1b71113b605fd84489f63938bd7dd7.tar.bz2
Refactor LayerAndroid to add iframe subclasses
Change-Id: Ia3810e83a2d919ff5fa37b8fcd92e6cbbb63d569
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 0ee6443..447ab28 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -24,6 +24,8 @@
#include "FloatRect.h"
#include "FixedLayerAndroid.h"
#include "GraphicsContext.h"
+#include "IFrameContentLayerAndroid.h"
+#include "IFrameLayerAndroid.h"
#include "Image.h"
#include "ImagesManager.h"
#include "Layer.h"
@@ -233,8 +235,12 @@ void GraphicsLayerAndroid::updateFixedPosition()
return;
// We will need the Iframe flag in the LayerAndroid tree for fixed position
- if (view->isRenderIFrame())
- m_contentLayer->setIsIframe(true);
+ if (view->isRenderIFrame() && !m_contentLayer->isIFrame()) {
+ LayerAndroid* layer = new IFrameLayerAndroid(*m_contentLayer);
+ m_contentLayer->unref();
+ m_contentLayer = layer;
+ }
+
// If we are a fixed position layer, just set it
if (view->isPositioned() && view->style()->position() == FixedPosition) {
// We need to get the passed CSS properties for the element
@@ -533,8 +539,7 @@ void GraphicsLayerAndroid::updateScrollingLayers()
// No need to copy the children as they will be removed and synced.
m_contentLayer->removeChildren();
// Replace the content layer with a scrollable layer.
- LayerAndroid* layer = new ScrollableLayerAndroid(*m_contentLayer);
- layer->setIsIframe(true);
+ LayerAndroid* layer = new IFrameContentLayerAndroid(*m_contentLayer);
m_contentLayer->unref();
m_contentLayer = layer;
if (m_parent) {
@@ -578,10 +583,10 @@ void GraphicsLayerAndroid::updateScrollOffset() {
if (m_foregroundLayer) {
IntSize scroll = layer->scrolledContentOffset();
m_foregroundLayer->setScrollOffset(IntPoint(scroll.width(), scroll.height()));
- } else if (m_contentLayer->contentIsScrollable()) {
+ } else if (m_contentLayer->isIFrameContent()) {
IntPoint p(layer->renderer()->frame()->view()->scrollX(),
layer->renderer()->frame()->view()->scrollY());
- static_cast<ScrollableLayerAndroid*>(m_contentLayer)->setIFrameScrollOffset(p);
+ static_cast<IFrameContentLayerAndroid*>(m_contentLayer)->setIFrameScrollOffset(p);
}
askForSync();
}
@@ -668,9 +673,9 @@ bool GraphicsLayerAndroid::repaint()
m_contentLayer->checkForPictureOptimizations();
// Check for a scrollable iframe and report the scrolling
// limits based on the view size.
- if (m_contentLayer->contentIsScrollable()) {
+ if (m_contentLayer->isIFrameContent()) {
FrameView* view = layer->renderer()->frame()->view();
- static_cast<ScrollableLayerAndroid*>(m_contentLayer)->setScrollLimits(
+ static_cast<IFrameContentLayerAndroid*>(m_contentLayer)->setScrollLimits(
m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight());
LOG("setScrollLimits(%.2f, %.2f, w: %d h: %d) layer %d, frame scroll position is %d, %d",
m_position.x(), m_position.y(), view->layoutWidth(), view->layoutHeight(),