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

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

Issue 2736463002: [SPv2] Fix property node invalidation for CSS masks (Closed)
Patch Set: Avoid SVGRoot can of worms Created 3 years, 9 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/PaintPropertyTreeBuilder.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index cecdb95c06cbeb13622c5175cc32a92ac58f7823..348b3b97a63bdd04add3dd3e34c13f17bb192690 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -1069,6 +1069,11 @@ void PaintPropertyTreeBuilder::updateForObjectLocationAndSize(
if (box.size() == box.previousSize())
return;
+ // CSS mask and clip-path comes with an implicit clip to the border box.
+ // Currently only SPv2 generate and take advantage of those.
+ const bool boxGeneratesPropertyNodesForMaskAndClipPath =
+ RuntimeEnabledFeatures::slimmingPaintV2Enabled() &&
+ (box.hasMask() || box.hasClipPath());
// The overflow clip paint property depends on the border box rect through
// overflowClipRect(). The border box rect's size equals the frame rect's
// size so we trigger a paint property update when the frame rect changes.
@@ -1080,7 +1085,8 @@ void PaintPropertyTreeBuilder::updateForObjectLocationAndSize(
// transform-origin, and perspective-origin can depend on the size of the
// frame rect, so force a property update if it changes. TODO(pdr): We
// only need to update properties if there are relative lengths.
- box.styleRef().hasTransform() || box.styleRef().hasPerspective())
+ box.styleRef().hasTransform() || box.styleRef().hasPerspective() ||
+ boxGeneratesPropertyNodesForMaskAndClipPath)
box.getMutableForPainting().setNeedsPaintPropertyUpdate();
}

Powered by Google App Engine
This is Rietveld 408576698