Index: third_party/WebKit/Source/core/paint/BoxPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/BoxPainter.cpp b/third_party/WebKit/Source/core/paint/BoxPainter.cpp |
index a58f9ca85b05d3bed0faf68caef6146940198add..a23a5f337d63d83334d4ba6a6a8d424c8ef96a74 100644 |
--- a/third_party/WebKit/Source/core/paint/BoxPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/BoxPainter.cpp |
@@ -522,6 +522,9 @@ inline bool paintFastBottomLayer(const LayoutBoxModelObject& obj, |
SkBlendMode op, |
const LayoutObject* backgroundObject, |
Optional<BackgroundImageGeometry>& geometry) { |
+ // Painting a background image from an ancestor onto a cell is a complex case. |
+ if (obj.isTableCell() && backgroundObject && !backgroundObject->isTableCell()) |
+ return false; |
// Complex cases not handled on the fast path. |
if (!info.isBottomLayer || !info.isBorderFill || |
info.isClippedWithLocalScrolling) |
@@ -537,7 +540,7 @@ inline bool paintFastBottomLayer(const LayoutBoxModelObject& obj, |
if (info.shouldPaintImage) { |
DCHECK(!geometry); |
geometry.emplace(); |
- geometry->calculate(obj, paintInfo.paintContainer(), |
+ geometry->calculate(obj, backgroundObject, paintInfo.paintContainer(), |
paintInfo.getGlobalPaintFlags(), layer, rect); |
if (!geometry->destRect().isEmpty()) { |
@@ -747,7 +750,7 @@ void BoxPainter::paintFillLayer(const LayoutBoxModelObject& obj, |
if (info.shouldPaintImage) { |
if (!geometry) { |
geometry.emplace(); |
- geometry->calculate(obj, paintInfo.paintContainer(), |
+ geometry->calculate(obj, backgroundObject, paintInfo.paintContainer(), |
paintInfo.getGlobalPaintFlags(), bgLayer, |
scrolledPaintRect); |
} else { |