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

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

Issue 2624383002: Apply SVG viewport clips in PaintLayer; paint background of replaced like boxes. (Closed)
Patch Set: none 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/ReplacedPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp
index b1378a22ed757360e68a313697d904653ad20667..d4c1255d55d95df576817d2270a6ea268b6d3755 100644
--- a/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ReplacedPainter.cpp
@@ -31,12 +31,16 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo,
LayoutRect borderRect(adjustedPaintOffset, m_layoutReplaced.size());
- if (m_layoutReplaced.style()->visibility() == EVisibility::kVisible &&
- m_layoutReplaced.hasBoxDecorationBackground() &&
- (paintInfo.phase == PaintPhaseForeground ||
- paintInfo.phase == PaintPhaseSelection))
- m_layoutReplaced.paintBoxDecorationBackground(paintInfo,
- adjustedPaintOffset);
+ if (shouldPaintSelfBlockBackground(paintInfo.phase)) {
+ if (m_layoutReplaced.style()->visibility() == EVisibility::kVisible &&
+ m_layoutReplaced.hasBoxDecorationBackground()) {
+ m_layoutReplaced.paintBoxDecorationBackground(paintInfo,
+ adjustedPaintOffset);
+ }
+ // We're done. We don't bother painting any children.
+ if (paintInfo.phase == PaintPhaseSelfBlockBackgroundOnly)
+ return;
+ }
if (paintInfo.phase == PaintPhaseMask) {
m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset);
@@ -130,7 +134,8 @@ bool ReplacedPainter::shouldPaint(
!shouldPaintSelfOutline(paintInfo.phase) &&
paintInfo.phase != PaintPhaseSelection &&
paintInfo.phase != PaintPhaseMask &&
- paintInfo.phase != PaintPhaseClippingMask)
+ paintInfo.phase != PaintPhaseClippingMask &&
+ !shouldPaintSelfBlockBackground(paintInfo.phase))
return false;
// If we're invisible or haven't received a layout yet, just bail.

Powered by Google App Engine
This is Rietveld 408576698