Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: third_party/WebKit/Source/core/paint/BoxPainter.cpp

Issue 2600903002: Paint the whole of a table-part background image behind the cells in a table (Closed)
Patch Set: Paint the whole of an image behind the cells in a table Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698