summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderLayerBacking.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
commitd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch)
treeb318cf594dc1da2fa48224005945c9157f35bb41 /Source/WebCore/rendering/RenderLayerBacking.cpp
parent6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff)
downloadqtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/WebCore/rendering/RenderLayerBacking.cpp')
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp35
1 files changed, 4 insertions, 31 deletions
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 917d2869e..aa617f6bd 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -777,40 +777,13 @@ static bool hasBoxDecorationsOrBackgroundImage(const RenderStyle* style)
return hasBoxDecorations(style) || style->hasBackgroundImage();
}
-bool RenderLayerBacking::rendererHasBackground() const
-{
- // FIXME: share more code here
- if (renderer()->node() && renderer()->node()->isDocumentNode()) {
- RenderObject* htmlObject = renderer()->firstChild();
- if (!htmlObject)
- return false;
-
- if (htmlObject->hasBackground())
- return true;
-
- RenderObject* bodyObject = htmlObject->firstChild();
- if (!bodyObject)
- return false;
-
- return bodyObject->hasBackground();
- }
-
- return renderer()->hasBackground();
-}
-
Color RenderLayerBacking::rendererBackgroundColor() const
{
- // FIXME: share more code here
- if (renderer()->node() && renderer()->node()->isDocumentNode()) {
- RenderObject* htmlObject = renderer()->firstChild();
- if (htmlObject->hasBackground())
- return htmlObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
-
- RenderObject* bodyObject = htmlObject->firstChild();
- return bodyObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
- }
+ RenderObject* backgroundRenderer = renderer();
+ if (backgroundRenderer->isRoot())
+ backgroundRenderer = backgroundRenderer->rendererForRootBackground();
- return renderer()->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ return backgroundRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
}
void RenderLayerBacking::updateBackgroundColor()