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

Unified Diff: Source/core/paint/DeprecatedPaintLayerClipper.cpp

Issue 1318963006: Add a UseCounter for clip CSS or -webkit-clip-path that clips positioned descendants. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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: Source/core/paint/DeprecatedPaintLayerClipper.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerClipper.cpp b/Source/core/paint/DeprecatedPaintLayerClipper.cpp
index 441854efe3e3d20e384bd5b4fa181f3f8ad8644d..ed7694c46974e4bd520ddb56704cead2b9922220 100644
--- a/Source/core/paint/DeprecatedPaintLayerClipper.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerClipper.cpp
@@ -65,6 +65,7 @@ static void adjustClipRectsForChildren(const LayoutObject& layoutObject, ClipRec
clipRects.setOverflowClipRect(clipRects.posClipRect());
}
}
+
static void applyClipRects(const ClipRectsContext& context, LayoutObject& layoutObject, LayoutPoint offset, ClipRects& clipRects)
{
ASSERT(layoutObject.hasOverflowClip() || layoutObject.hasClip());
@@ -83,9 +84,22 @@ static void applyClipRects(const ClipRectsContext& context, LayoutObject& layout
}
if (layoutObject.hasClip()) {
LayoutRect newClip = toLayoutBox(layoutObject).clipRect(offset);
- clipRects.setPosClipRect(intersection(newClip, clipRects.posClipRect()));
- clipRects.setOverflowClipRect(intersection(newClip, clipRects.overflowClipRect()));
- clipRects.setFixedClipRect(intersection(newClip, clipRects.fixedClipRect()));
+ {
+ ClipRect rect = intersection(newClip, clipRects.posClipRect());
pdr. 2015/09/04 22:55:14 Please use some ampersands here.
chrishtr 2015/09/04 23:39:00 Done
+ rect.setIsClippedByClipCss();
+ clipRects.setPosClipRect(rect);
+ }
pdr. 2015/09/04 22:55:14 nit: newline
chrishtr 2015/09/04 23:39:00 Done
+ {
+ ClipRect rect = intersection(newClip, clipRects.overflowClipRect());
+ rect.setIsClippedByClipCss();
+ clipRects.setOverflowClipRect(rect);
+ }
+
+ {
+ ClipRect rect = intersection(newClip, clipRects.fixedClipRect());
+ rect.setIsClippedByClipCss();
+ clipRects.setFixedClipRect(rect);
+ }
}
}
@@ -260,8 +274,11 @@ void DeprecatedPaintLayerClipper::calculateRects(const ClipRectsContext& context
// Clip applies to *us* as well, so go ahead and update the damageRect.
LayoutRect newPosClip = toLayoutBox(m_layoutObject).clipRect(offset);
backgroundRect.intersect(newPosClip);
+ backgroundRect.setIsClippedByClipCss();
foregroundRect.intersect(newPosClip);
+ foregroundRect.setIsClippedByClipCss();
outlineRect.intersect(newPosClip);
+ outlineRect.setIsClippedByClipCss();
}
}

Powered by Google App Engine
This is Rietveld 408576698