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 cb0862c9be5a8166ea29b843cbbb9601fbfd0f82..53f35eb79b0e8e65b3b9ac8f9d6100291e56e53c 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
@@ -11,6 +11,7 @@ |
#include "core/layout/LayoutView.h" |
#include "core/layout/compositing/CompositingReasonFinder.h" |
#include "core/layout/svg/LayoutSVGRoot.h" |
+#include "core/layout/svg/SVGLayoutSupport.h" |
#include "core/paint/FindPropertiesNeedingUpdate.h" |
#include "core/paint/ObjectPaintProperties.h" |
#include "core/paint/PaintLayer.h" |
@@ -396,10 +397,10 @@ void PaintPropertyTreeBuilder::updateEffect( |
PaintPropertyTreeBuilderContext& context) { |
const ComputedStyle& style = object.styleRef(); |
- // TODO(crbug.com/673500): style.isStackingContext() is only meaningful for |
- // HTML elements. What we really want to ask is whether the element starts |
- // an isolated group, and SVGs use a different rule. |
- if (!style.isStackingContext()) { |
+ const bool isCSSIsolatedGroup = |
+ object.isBoxModelObject() && style.isStackingContext(); |
+ const bool isSVGExceptRoot = object.isSVG() && !object.isSVGRoot(); |
+ if (!isCSSIsolatedGroup && !isSVGExceptRoot) { |
if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
if (auto* properties = object.getMutableForPainting().paintProperties()) |
context.forceSubtreeUpdate |= properties->clearEffect(); |
@@ -416,15 +417,17 @@ void PaintPropertyTreeBuilder::updateEffect( |
// Yes, including LayoutSVGRoot, because SVG layout objects don't create |
// PaintLayer so PaintLayer::hasNonIsolatedDescendantWithBlendMode() |
// doesn't catch SVG descendants. |
- if (object.hasNonIsolatedBlendingDescendants()) |
+ if (SVGLayoutSupport::isIsolationRequired(&object)) |
effectNodeNeeded = true; |
} else if (PaintLayer* layer = toLayoutBoxModelObject(object).layer()) { |
if (layer->hasNonIsolatedDescendantWithBlendMode()) |
effectNodeNeeded = true; |
} |
- SkBlendMode blendMode = |
- WebCoreCompositeToSkiaComposite(CompositeSourceOver, style.blendMode()); |
+ SkBlendMode blendMode = object.isBlendingAllowed() |
+ ? WebCoreCompositeToSkiaComposite( |
+ CompositeSourceOver, style.blendMode()) |
+ : SkBlendMode::kSrcOver; |
if (blendMode != SkBlendMode::kSrcOver) |
effectNodeNeeded = true; |