summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/WebCore/page/DOMWindow.cpp16
-rw-r--r--Source/WebCore/platform/ScrollView.cpp24
-rw-r--r--Source/WebCore/platform/ScrollView.h11
-rw-r--r--Source/WebCore/platform/android/ScrollViewAndroid.cpp28
-rw-r--r--Source/WebCore/platform/android/WidgetAndroid.cpp9
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp35
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h4
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp18
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h1
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp14
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h5
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp7
-rw-r--r--Source/WebCore/rendering/RenderObject.cpp17
-rw-r--r--Source/WebCore/rendering/RenderObject.h2
-rw-r--r--Source/WebCore/rendering/RenderRuby.cpp12
-rw-r--r--Source/WebCore/rendering/RenderRuby.h6
-rw-r--r--Source/WebCore/rendering/RenderTable.cpp1
-rw-r--r--Source/WebCore/rendering/RenderTableRow.cpp6
-rw-r--r--Source/WebCore/rendering/RenderTableSection.cpp10
-rw-r--r--Source/WebCore/rendering/RenderTableSection.h3
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp2
-rw-r--r--Source/WebKit/android/nav/WebView.cpp4
25 files changed, 218 insertions, 33 deletions
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index ee2206b..c7f162a 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -1095,7 +1095,11 @@ int DOMWindow::innerHeight() const
if (!view)
return 0;
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualHeight() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->height() / m_frame->pageZoomFactor());
+#endif
}
int DOMWindow::innerWidth() const
@@ -1107,7 +1111,11 @@ int DOMWindow::innerWidth() const
if (!view)
return 0;
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualWidth() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->width() / m_frame->pageZoomFactor());
+#endif
}
int DOMWindow::screenX() const
@@ -1145,7 +1153,11 @@ int DOMWindow::scrollX() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualScrollX() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->scrollX() / m_frame->pageZoomFactor());
+#endif
}
int DOMWindow::scrollY() const
@@ -1159,7 +1171,11 @@ int DOMWindow::scrollY() const
m_frame->document()->updateLayoutIgnorePendingStylesheets();
+#if PLATFORM(ANDROID)
+ return static_cast<int>(view->actualScrollY() / m_frame->pageZoomFactor());
+#else
return static_cast<int>(view->scrollY() / m_frame->pageZoomFactor());
+#endif
}
bool DOMWindow::closed() const
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index 140c8e5..864fdc5 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -308,6 +308,30 @@ void ScrollView::setContentsSize(const IntSize& newSize)
}
#if PLATFORM(ANDROID)
+int ScrollView::actualWidth() const {
+ if (platformWidget())
+ return platformActualWidth();
+ return width();
+}
+
+int ScrollView::actualHeight() const {
+ if (platformWidget())
+ return platformActualHeight();
+ return height();
+}
+
+int ScrollView::actualScrollX() const {
+ if (platformWidget())
+ return platformActualScrollX();
+ return scrollX();
+}
+
+int ScrollView::actualScrollY() const {
+ if (platformWidget())
+ return platformActualScrollY();
+ return scrollY();
+}
+
FrameView* ScrollView::frameView() {
if (this->isFrameView()) {
FrameView* frameView = reinterpret_cast<FrameView*>(this);
diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h
index e58d025..3228870 100644
--- a/Source/WebCore/platform/ScrollView.h
+++ b/Source/WebCore/platform/ScrollView.h
@@ -172,6 +172,10 @@ public:
virtual void setContentsSize(const IntSize&);
#if PLATFORM(ANDROID)
+ int actualWidth() const;
+ int actualHeight() const;
+ int actualScrollX() const;
+ int actualScrollY() const;
FrameView* frameView();
#endif
@@ -401,6 +405,13 @@ private:
void platformSetScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously);
+#if PLATFORM(ANDROID)
+ int platformActualWidth() const;
+ int platformActualHeight() const;
+ int platformActualScrollX() const;
+ int platformActualScrollY() const;
+#endif
+
#if PLATFORM(MAC) && defined __OBJC__
public:
NSView* documentView() const;
diff --git a/Source/WebCore/platform/android/ScrollViewAndroid.cpp b/Source/WebCore/platform/android/ScrollViewAndroid.cpp
index cc1c09e..e7300a1 100644
--- a/Source/WebCore/platform/android/ScrollViewAndroid.cpp
+++ b/Source/WebCore/platform/android/ScrollViewAndroid.cpp
@@ -68,6 +68,34 @@ IntSize ScrollView::platformContentsSize() const
return m_contentsSize;
}
+int ScrollView::platformActualWidth() const
+{
+ if (parent())
+ return width();
+ return platformWidget()->visibleWidth();
+}
+
+int ScrollView::platformActualHeight() const
+{
+ if (parent())
+ return height();
+ return platformWidget()->visibleHeight();
+}
+
+int ScrollView::platformActualScrollX() const
+{
+ if (parent())
+ return scrollX();
+ return platformWidget()->visibleX();
+}
+
+int ScrollView::platformActualScrollY() const
+{
+ if (parent())
+ return scrollY();
+ return platformWidget()->visibleY();
+}
+
void ScrollView::platformSetScrollPosition(const WebCore::IntPoint& pt)
{
PlatformBridge::setScrollPosition(this, m_scrollOrigin.x() + pt.x(),
diff --git a/Source/WebCore/platform/android/WidgetAndroid.cpp b/Source/WebCore/platform/android/WidgetAndroid.cpp
index 6858f29..3c5b1c8 100644
--- a/Source/WebCore/platform/android/WidgetAndroid.cpp
+++ b/Source/WebCore/platform/android/WidgetAndroid.cpp
@@ -49,7 +49,9 @@ Widget::~Widget()
IntRect Widget::frameRect() const
{
- return m_frame;
+ if (!platformWidget())
+ return m_frame;
+ return platformWidget()->getBounds();
}
void Widget::setFocus(bool focused)
@@ -89,6 +91,11 @@ void Widget::hide()
void Widget::setFrameRect(const IntRect& rect)
{
m_frame = rect;
+ // platformWidget() is 0 when called from Scrollbar
+ if (!platformWidget())
+ return;
+ platformWidget()->setLocation(rect.x(), rect.y());
+ platformWidget()->setSize(rect.width(), rect.height());
}
void Widget::setIsSelected(bool isSelected)
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 3975545..ef355c7 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -124,7 +124,7 @@ GraphicsLayerAndroid::~GraphicsLayerAndroid()
if (m_image)
m_image->deref();
- m_contentLayer->unref();
+ SkSafeUnref(m_contentLayer);
SkSafeUnref(m_fixedBackgroundLayer);
SkSafeUnref(m_foregroundLayer);
SkSafeUnref(m_foregroundClipLayer);
@@ -591,10 +591,10 @@ void GraphicsLayerAndroid::updateFixedBackgroundLayers() {
return;
if (!view->style()->hasFixedBackgroundImage())
return;
- if (m_contentLayer->isFixedBackground())
- return;
- if (m_fixedBackgroundLayer) // already created
- return;
+
+ SkSafeUnref(m_foregroundClipLayer);
+ SkSafeUnref(m_fixedBackgroundLayer);
+ SkSafeUnref(m_foregroundLayer);
// we will have:
// m_contentLayer
@@ -602,11 +602,10 @@ void GraphicsLayerAndroid::updateFixedBackgroundLayers() {
// \- m_fixedBackgroundLayer
// \- m_foregroundLayer
- // Grab the background image and create a layer for it
+ // use the background image and create a layer for it
// the layer will be fixed positioned.
Image* image = FixedBackgroundImageLayerAndroid::GetCachedImage(view->style());
-
if (!image)
return;
@@ -634,15 +633,23 @@ void GraphicsLayerAndroid::updateFixedBackgroundLayers() {
m_foregroundLayer->setIntrinsicallyComposited(true);
// Finally, let's assemble all the layers under a FixedBackgroundLayerAndroid layer
- LayerAndroid* layer = new FixedBackgroundLayerAndroid(*m_contentLayer);
- m_contentLayer->unref();
- m_contentLayer = layer;
-
- m_contentLayer->addChild(m_foregroundClipLayer);
- m_contentLayer->addChild(m_foregroundLayer);
+ if (!m_contentLayer->isFixedBackground()) {
+ m_contentLayer->removeChildren();
+ LayerAndroid* layer = new FixedBackgroundLayerAndroid(*m_contentLayer);
+ m_contentLayer->unref();
+ m_contentLayer = layer;
+ }
- m_needsRepaint = true;
+ if (m_parent) {
+ // The content layer has changed so the parent needs to sync
+ // children.
+ static_cast<GraphicsLayerAndroid*>(m_parent)->m_needsSyncChildren = true;
+ }
+ // Children are all re-parented.
m_needsSyncChildren = true;
+
+ setNeedsDisplay();
+ askForSync();
}
void GraphicsLayerAndroid::updateScrollOffset() {
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
index 0fc0790..460e00f 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
@@ -29,13 +29,13 @@
#include "SkBitmapRef.h"
#include "Vector.h"
-class FloatPoint3D;
-class Image;
class SkBitmapRef;
class SkRegion;
namespace WebCore {
+class FloatPoint3D;
+class Image;
class LayerAndroid;
class FixedBackgroundImageLayerAndroid;
class ScrollableLayerAndroid;
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
index 3241a61..283fa58 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
@@ -31,6 +31,7 @@
#include "AndroidLog.h"
#include "CachedImage.h"
+#include "ClassTracker.h"
#include "DrawQuadData.h"
#include "FixedPositioning.h"
#include "GLWebViewState.h"
@@ -117,6 +118,10 @@ FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(PassRefPtr<Re
setFixedPosition(position);
position->setPosition(left, top);
+
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("FixedBackgroundImageLayerAndroid");
+#endif
}
FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(const FixedBackgroundImageLayerAndroid& layer)
@@ -124,6 +129,16 @@ FixedBackgroundImageLayerAndroid::FixedBackgroundImageLayerAndroid(const FixedBa
, m_width(layer.m_width)
, m_height(layer.m_height)
{
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("FixedBackgroundImageLayerAndroid");
+#endif
+}
+
+FixedBackgroundImageLayerAndroid::~FixedBackgroundImageLayerAndroid()
+{
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->decrement("FixedBackgroundImageLayerAndroid");
+#endif
}
static bool needToDisplayImage(bool repeatX, bool repeatY, float dx, float dy)
@@ -229,6 +244,9 @@ Image* FixedBackgroundImageLayerAndroid::GetCachedImage(PassRefPtr<RenderStyle>
Image* image = cachedImage->image();
+ if (image && !image->nativeImageForCurrentFrame())
+ return 0;
+
if (image == Image::nullImage())
return 0;
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
index 9ce8a07..55b4b21 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
@@ -65,6 +65,7 @@ class FixedBackgroundImageLayerAndroid : public LayerAndroid {
public:
FixedBackgroundImageLayerAndroid(PassRefPtr<RenderStyle> style, int w, int h);
FixedBackgroundImageLayerAndroid(const FixedBackgroundImageLayerAndroid& layer);
+ virtual ~FixedBackgroundImageLayerAndroid();
virtual LayerAndroid* copy() const { return new FixedBackgroundImageLayerAndroid(*this); }
virtual bool needsTexture() { return true; }
virtual SubclassType subclassType() const { return LayerAndroid::FixedBackgroundImageLayer; }
diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
index 95e6825..6e88081 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
@@ -601,7 +601,7 @@ void LayerAndroid::showLayer(int indent)
int count = this->countChildren();
for (int i = 0; i < count; i++)
- this->getChild(i)->showLayer(indent + 1);
+ this->getChild(i)->showLayer(indent + 2);
}
void LayerAndroid::mergeInvalsInto(LayerAndroid* replacementTree)
diff --git a/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp b/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp
index 87096b0..3fcbdb2 100644
--- a/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/PaintTileOperation.cpp
@@ -30,6 +30,7 @@
#include "PaintTileOperation.h"
#include "AndroidLog.h"
+#include "ClassTracker.h"
#include "GLWebViewState.h"
#include "ImageTexture.h"
#include "ImagesManager.h"
@@ -49,6 +50,9 @@ PaintTileOperation::PaintTileOperation(Tile* tile, TilePainter* painter,
if (m_tile)
m_tile->setRepaintPending(true);
SkSafeRef(m_painter);
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("PaintTileOperation");
+#endif
}
PaintTileOperation::~PaintTileOperation()
@@ -64,6 +68,9 @@ PaintTileOperation::~PaintTileOperation()
} else {
SkSafeUnref(m_painter);
}
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->decrement("PaintTileOperation");
+#endif
}
bool PaintTileOperation::operator==(const QueuedOperation* operation)
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
index 78a9861..fcd9655 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
@@ -31,6 +31,7 @@
#include "AndroidLog.h"
#include "Color.h"
+#include "ClassTracker.h"
#include "GLWebViewState.h"
#include "LayerAndroid.h"
@@ -46,6 +47,9 @@ SurfaceBacking::SurfaceBacking(bool isBaseSurface)
m_scale = -1;
m_futureScale = -1;
m_zooming = false;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->increment("SurfaceBacking");
+#endif
}
SurfaceBacking::~SurfaceBacking()
@@ -53,6 +57,9 @@ SurfaceBacking::~SurfaceBacking()
delete m_frontTileGrid;
delete m_backTileGrid;
delete m_lowResTileGrid;
+#ifdef DEBUG_COUNT
+ ClassTracker::instance()->decrement("SurfaceBacking");
+#endif
}
void SurfaceBacking::prepareGL(GLWebViewState* state, bool allowZoom,
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
index 77b238e..f577d46 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
@@ -33,7 +33,7 @@
#include "BaseLayerAndroid.h"
#include "ClassTracker.h"
#include "GLWebViewState.h"
-#include "BaseLayerAndroid.h"
+#include "PaintTileOperation.h"
#include "Surface.h"
#include "ScrollableLayerAndroid.h"
#include "TilesManager.h"
@@ -164,21 +164,23 @@ bool SurfaceCollection::isReady()
bool SurfaceCollection::isBaseSurfaceReady()
{
- if (!m_compositedRoot || !m_surfaces[0])
- return false;
+ // m_surfaces[0] should be the base surface when in single surface mode.
return m_surfaces[0]->isReady();
}
bool SurfaceCollection::isMissingBackgroundContent()
{
- if (!m_compositedRoot)
- return true;
-
// return true when the first surface is missing content (indicating the
// entire viewport isn't covered)
return m_surfaces[0]->isMissingContent();
}
+void SurfaceCollection::removePainterOperations()
+{
+ for (unsigned int i = 0; i < m_surfaces.size(); i++)
+ TilesManager::instance()->removeOperationsForFilter(new TilePainterFilter(m_surfaces[i]));
+}
+
void SurfaceCollection::computeTexturesAmount(TexturesResult* result)
{
for (unsigned int i = 0; i < m_surfaces.size(); i++)
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
index 5eb5d65..ff4195f 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
@@ -47,7 +47,7 @@ public:
SurfaceCollection(BaseLayerAndroid* compositedRoot);
virtual ~SurfaceCollection();
- // Tiled painting methods (executed on groups)
+ // Tiled painting methods (executed on Surfaces)
void prepareGL(const SkRect& visibleContentRect, bool tryToFastBlit = false);
bool drawGL(const SkRect& visibleContentRect);
Color getBackgroundColor();
@@ -56,6 +56,7 @@ public:
bool isReady();
bool isBaseSurfaceReady();
bool isMissingBackgroundContent();
+ void removePainterOperations();
void computeTexturesAmount(TexturesResult* result);
// Recursive tree methods (animations, invals, etc)
@@ -73,7 +74,7 @@ public:
private:
void updateLayerPositions(const SkRect& visibleContentRect);
- BaseLayerAndroid* m_compositedRoot;
+ BaseLayerAndroid* const m_compositedRoot;
WTF::Vector<Surface*> m_surfaces;
};
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
index 5abca02..724bf89 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
@@ -69,6 +69,7 @@ void SurfaceCollectionManager::swap()
if (m_drawingCollection) {
ALOGV("destroying drawing collection %p", m_drawingCollection);
m_drawingCollection->addFrameworkInvals();
+ m_drawingCollection->removePainterOperations();
SkSafeUnref(m_drawingCollection);
}
@@ -93,6 +94,12 @@ void SurfaceCollectionManager::swap()
// clear all of the content in the three collections held by the collection manager
void SurfaceCollectionManager::clearCollections()
{
+ // remove all painting operations, since they're no longer relevant
+ if (m_drawingCollection)
+ m_drawingCollection->removePainterOperations();
+ if (m_paintingCollection)
+ m_paintingCollection->removePainterOperations();
+
SkSafeUnref(m_drawingCollection);
m_drawingCollection = 0;
SkSafeUnref(m_paintingCollection);
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index f37753e..012427c 100644
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -1787,6 +1787,23 @@ void RenderObject::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
}
}
+void RenderObject::propagateStyleToAnonymousChildren()
+{
+ for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+ if (child->isAnonymous() && !child->isBeforeOrAfterContent()) {
+ RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyle(style());
+ if (style()->specifiesColumns()) {
+ if (child->style()->specifiesColumns())
+ newStyle->inheritColumnPropertiesFrom(style());
+ if (child->style()->columnSpan())
+ newStyle->setColumnSpan(true);
+ }
+ newStyle->setDisplay(child->style()->display());
+ child->setStyle(newStyle.release());
+ }
+ }
+}
+
void RenderObject::updateFillImages(const FillLayer* oldLayers, const FillLayer* newLayers)
{
// Optimize the common case
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index f5fe562..18086c9 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -315,6 +315,7 @@ public:
inline bool isBeforeOrAfterContent() const;
static inline bool isBeforeContent(const RenderObject* obj) { return obj && obj->isBeforeContent(); }
static inline bool isAfterContent(const RenderObject* obj) { return obj && obj->isAfterContent(); }
+ static inline bool isBeforeOrAfterContent(const RenderObject* obj) { return obj && obj->isBeforeOrAfterContent(); }
bool childrenInline() const { return m_childrenInline; }
void setChildrenInline(bool b = true) { m_childrenInline = b; }
@@ -777,6 +778,7 @@ protected:
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
// Overrides should call the superclass at the start
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+ void propagateStyleToAnonymousChildren();
void drawLineForBoxSide(GraphicsContext*, int x1, int y1, int x2, int y2, BoxSide,
Color, EBorderStyle, int adjbw1, int adjbw2, bool antialias = false);
diff --git a/Source/WebCore/rendering/RenderRuby.cpp b/Source/WebCore/rendering/RenderRuby.cpp
index e0137de..41604d6 100644
--- a/Source/WebCore/rendering/RenderRuby.cpp
+++ b/Source/WebCore/rendering/RenderRuby.cpp
@@ -119,6 +119,12 @@ RenderRubyAsInline::~RenderRubyAsInline()
{
}
+void RenderRubyAsInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderInline::styleDidChange(diff, oldStyle);
+ propagateStyleToAnonymousChildren();
+}
+
void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Insert :before and :after content before/after the RenderRubyRun(s)
@@ -220,6 +226,12 @@ RenderRubyAsBlock::~RenderRubyAsBlock()
{
}
+void RenderRubyAsBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderBlock::styleDidChange(diff, oldStyle);
+ propagateStyleToAnonymousChildren();
+}
+
void RenderRubyAsBlock::addChild(RenderObject* child, RenderObject* beforeChild)
{
// Insert :before and :after content before/after the RenderRubyRun(s)
diff --git a/Source/WebCore/rendering/RenderRuby.h b/Source/WebCore/rendering/RenderRuby.h
index 24ac0db..2ab964c 100644
--- a/Source/WebCore/rendering/RenderRuby.h
+++ b/Source/WebCore/rendering/RenderRuby.h
@@ -59,6 +59,9 @@ public:
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual void removeChild(RenderObject* child);
+protected:
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+
private:
virtual bool isRuby() const { return true; }
virtual const char* renderName() const { return "RenderRuby (inline)"; }
@@ -75,6 +78,9 @@ public:
virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
virtual void removeChild(RenderObject* child);
+protected:
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+
private:
virtual bool isRuby() const { return true; }
virtual const char* renderName() const { return "RenderRuby (block)"; }
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index e9db5ad..072519e 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -79,6 +79,7 @@ RenderTable::~RenderTable()
void RenderTable::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBlock::styleDidChange(diff, oldStyle);
+ propagateStyleToAnonymousChildren();
ETableLayout oldTableLayout = oldStyle ? oldStyle->tableLayout() : TAUTO;
diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp
index 2edcfc4..686bc3a 100644
--- a/Source/WebCore/rendering/RenderTableRow.cpp
+++ b/Source/WebCore/rendering/RenderTableRow.cpp
@@ -74,10 +74,10 @@ void RenderTableRow::updateBeforeAndAfterContent()
void RenderTableRow::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
RenderBox::styleDidChange(diff, oldStyle);
+ propagateStyleToAnonymousChildren();
if (parent())
updateBeforeAndAfterContent();
-
}
void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
@@ -90,7 +90,7 @@ void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
RenderObject* last = beforeChild;
if (!last)
last = lastChild();
- if (last && last->isAnonymous() && last->isTableCell()) {
+ if (last && last->isAnonymous() && last->isTableCell() && !last->isBeforeOrAfterContent()) {
if (beforeChild == last)
beforeChild = last->firstChild();
last->addChild(child, beforeChild);
@@ -98,7 +98,7 @@ void RenderTableRow::addChild(RenderObject* child, RenderObject* beforeChild)
}
// If beforeChild is inside an anonymous cell, insert into the cell.
- if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous()) {
+ if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous() && !last->parent()->isBeforeOrAfterContent()) {
last->parent()->addChild(child, beforeChild);
return;
}
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index 06d326f..daa0a92 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -78,6 +78,12 @@ RenderTableSection::~RenderTableSection()
clearGrid();
}
+void RenderTableSection::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderBox::styleDidChange(diff, oldStyle);
+ propagateStyleToAnonymousChildren();
+}
+
void RenderTableSection::destroy()
{
RenderTable* recalcTable = table();
@@ -100,7 +106,7 @@ void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
RenderObject* last = beforeChild;
if (!last)
last = lastChild();
- if (last && last->isAnonymous()) {
+ if (last && last->isAnonymous() && !last->isBeforeOrAfterContent()) {
if (beforeChild == last)
beforeChild = last->firstChild();
last->addChild(child, beforeChild);
@@ -112,7 +118,7 @@ void RenderTableSection::addChild(RenderObject* child, RenderObject* beforeChild
RenderObject* lastBox = last;
while (lastBox && lastBox->parent()->isAnonymous() && !lastBox->isTableRow())
lastBox = lastBox->parent();
- if (lastBox && lastBox->isAnonymous()) {
+ if (lastBox && lastBox->isAnonymous() && !lastBox->isBeforeOrAfterContent()) {
lastBox->addChild(child, beforeChild);
return;
}
diff --git a/Source/WebCore/rendering/RenderTableSection.h b/Source/WebCore/rendering/RenderTableSection.h
index cc969e8..db6edc2 100644
--- a/Source/WebCore/rendering/RenderTableSection.h
+++ b/Source/WebCore/rendering/RenderTableSection.h
@@ -118,6 +118,9 @@ public:
int getBaseline(int row) { return m_grid[row].baseline; }
+protected:
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+
private:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index 8838f14..d07b00e 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -877,6 +877,8 @@ BaseLayerAndroid* WebViewCore::createBaseLayer(GraphicsLayerAndroid* root)
realBase->setSize(content->width(), content->height());
realBase->addChild(baseBackground);
realBase->addChild(base);
+ baseBackground->unref();
+ base->unref();
} else {
realBase = new BaseLayerAndroid(content);
base = realBase;
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 473efdb..7485e83 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -530,7 +530,7 @@ bool setBaseLayer(BaseLayerAndroid* newBaseLayer, bool showVisualIndicator,
void copyBaseContentToPicture(SkPicture* picture)
{
- if (!m_baseLayer)
+ if (!m_baseLayer || !m_baseLayer->content())
return;
LayerContent* content = m_baseLayer->content();
content->draw(picture->beginRecording(content->width(), content->height(),
@@ -539,7 +539,7 @@ void copyBaseContentToPicture(SkPicture* picture)
}
bool hasContent() {
- if (!m_baseLayer)
+ if (!m_baseLayer || !m_baseLayer->content())
return false;
return !m_baseLayer->content()->isEmpty();
}