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

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
« no previous file with comments | « Source/core/layout/ClipRect.h ('k') | Source/core/paint/DeprecatedPaintLayerPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayerClipper.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerClipper.cpp b/Source/core/paint/DeprecatedPaintLayerClipper.cpp
index 441854efe3e3d20e384bd5b4fa181f3f8ad8644d..9295d4fc1fcaffb652696f024932e3f11c4a7073 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,23 @@ 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()));
+ {
+ const ClipRect& rect& = intersection(newClip, clipRects.posClipRect());
pdr. 2015/09/05 00:07:48 One too many ampersands!
chrishtr 2015/09/05 00:21:16 Fixed.
+ rect.setIsClippedByClipCss();
+ clipRects.setPosClipRect(rect);
+ }
+
+ {
+ const ClipRect& rect = intersection(newClip, clipRects.overflowClipRect());
+ rect.setIsClippedByClipCss();
+ clipRects.setOverflowClipRect(rect);
+ }
+
+ {
+ const ClipRect& rect = intersection(newClip, clipRects.fixedClipRect());
+ rect.setIsClippedByClipCss();
+ clipRects.setFixedClipRect(rect);
+ }
}
}
@@ -260,8 +275,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();
}
}
« no previous file with comments | « Source/core/layout/ClipRect.h ('k') | Source/core/paint/DeprecatedPaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698