Index: Source/WebCore/rendering/RenderBoxModelObject.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderBoxModelObject.cpp (revision 141266) |
+++ Source/WebCore/rendering/RenderBoxModelObject.cpp (working copy) |
@@ -912,35 +912,37 @@ |
// Paint the color first underneath all images, culled if background image occludes it. |
// FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culling test |
// by verifying whether the background image covers the entire layout rect. |
- if (!bgLayer->next() && !(shouldPaintBackgroundImage && bgLayer->hasOpaqueImage(this) && bgLayer->hasRepeatXY())) { |
+ if (!bgLayer->next()) { |
IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); |
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box); |
- if (!boxShadowShouldBeAppliedToBackground) |
- backgroundRect.intersect(paintInfo.rect); |
+ if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || !bgLayer->hasOpaqueImage(this) || !bgLayer->hasRepeatXY()) { |
+ if (!boxShadowShouldBeAppliedToBackground) |
+ backgroundRect.intersect(paintInfo.rect); |
- // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. |
- Color baseColor; |
- bool shouldClearBackground = false; |
- if (isOpaqueRoot) { |
- baseColor = view()->frameView()->baseBackgroundColor(); |
- if (!baseColor.alpha()) |
- shouldClearBackground = true; |
- } |
+ // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. |
+ Color baseColor; |
+ bool shouldClearBackground = false; |
+ if (isOpaqueRoot) { |
+ baseColor = view()->frameView()->baseBackgroundColor(); |
+ if (!baseColor.alpha()) |
+ shouldClearBackground = true; |
+ } |
- GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground); |
- if (boxShadowShouldBeAppliedToBackground) |
- applyBoxShadowForBackground(context, style()); |
+ GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground); |
+ if (boxShadowShouldBeAppliedToBackground) |
+ applyBoxShadowForBackground(context, style()); |
- if (baseColor.alpha()) { |
- if (bgColor.alpha()) |
- baseColor = baseColor.blend(bgColor); |
+ if (baseColor.alpha()) { |
+ if (bgColor.alpha()) |
+ baseColor = baseColor.blend(bgColor); |
- context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy); |
- } else if (bgColor.alpha()) { |
- CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation(); |
- context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation); |
- } else if (shouldClearBackground) |
- context->clearRect(backgroundRect); |
+ context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy); |
+ } else if (bgColor.alpha()) { |
+ CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation(); |
+ context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation); |
+ } else if (shouldClearBackground) |
+ context->clearRect(backgroundRect); |
+ } |
} |
// no progressive loading of the background image |