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 fd646a7bf936b593a30901d92f05eaf77b1d5fe7..1b8ff09449434fa096279407fa597bb003350993 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 { |