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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipper.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/PaintLayerClipper.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index 600c75a3d0a78865a2c3fde9927bec84ffda81ff..c508e5e1f69e6fcfffa3a14bec750cbbeb5c22b5 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -410,9 +410,7 @@ void PaintLayerClipper::calculateClipRects(const ClipRectsContext& context,
adjustClipRectsForChildren(layoutObject, clipRects);
- if (shouldClipOverflow(context) || layoutObject.hasClip() ||
- (layoutObject.isSVGRoot() &&
- toLayoutSVGRoot(&layoutObject)->shouldApplyViewportClip())) {
+ if (shouldClipOverflow(context) || layoutObject.hasClip()) {
// This offset cannot use convertToLayerCoords, because sometimes our
// rootLayer may be across some transformed layer boundary, for example, in
// the PaintLayerCompositor overlapMap, where clipRects are needed in view
@@ -532,8 +530,11 @@ void PaintLayerClipper::getOrCalculateClipRects(const ClipRectsContext& context,
bool PaintLayerClipper::shouldClipOverflow(
const ClipRectsContext& context) const {
- return (m_layer.layoutObject()->hasOverflowClip() ||
- m_layer.layoutObject()->styleRef().containsPaint()) &&
+ LayoutObject* layoutObject = m_layer.layoutObject();
+ return (layoutObject->hasOverflowClip() ||
+ layoutObject->styleRef().containsPaint() ||
+ (layoutObject->isSVGRoot() &&
+ toLayoutSVGRoot(layoutObject)->shouldApplyViewportClip())) &&
shouldRespectOverflowClip(context);
}

Powered by Google App Engine
This is Rietveld 408576698