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

Unified Diff: third_party/WebKit/Source/core/paint/BoxClipper.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/BoxClipper.cpp
diff --git a/third_party/WebKit/Source/core/paint/BoxClipper.cpp b/third_party/WebKit/Source/core/paint/BoxClipper.cpp
index 17ca2c8c1a28de154603cee5932ff6d1cc5ea56a..a56f6897530626165a274265f286c8e98d23881f 100644
--- a/third_party/WebKit/Source/core/paint/BoxClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxClipper.cpp
@@ -16,13 +16,20 @@
namespace blink {
+// Clips for boxes are applied by the box's PaintLayerClipper, if the box has
+// a self-painting PaintLayer. Otherwise the box clips itself.
+// Note that this method is very similar to
+// PaintLayerClipper::shouldClipOverflow for that reason.
+//
+// An exception is control clip, which is currently never applied by
+// PaintLayerClipper.
static bool boxNeedsClip(const LayoutBox& box) {
if (box.hasControlClip())
return true;
- if (box.isSVGRoot() && toLayoutSVGRoot(box).shouldApplyViewportClip())
- return true;
if (box.hasLayer() && box.layer()->isSelfPaintingLayer())
return false;
+ if (box.isSVGRoot() && toLayoutSVGRoot(box).shouldApplyViewportClip())
+ return true;
return box.hasOverflowClip() || box.styleRef().containsPaint();
}

Powered by Google App Engine
This is Rietveld 408576698