Commit 592410c0 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Simplify LayoutSVGModelObject/Block blend-mode style-change handling

Use StyleDifference::BlendModeChanged() to check for changes. The
initial isolation notification will be handled by the AddChild() on the
container.

Switch the call to IsBlendingAllowed() to a more targeted call (or no
call at all).

drop that from LayoutSVGModelObject.

LayoutObject: :SetStyle() already marks paint properties for updating, so
Change-Id: I2d43d6b314509db0881003809375aaf0d8f3a292
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463829Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#816475}
parent 8ebb42e6
...@@ -126,15 +126,12 @@ void LayoutSVGBlock::StyleDidChange(StyleDifference diff, ...@@ -126,15 +126,12 @@ void LayoutSVGBlock::StyleDidChange(StyleDifference diff,
SetNeedsTransformUpdate(); SetNeedsTransformUpdate();
} }
if (IsBlendingAllowed()) { if (diff.BlendModeChanged() && Parent()) {
bool has_blend_mode_changed = DCHECK(IsBlendingAllowed());
(old_style && old_style->HasBlendMode()) == !StyleRef().HasBlendMode();
if (Parent() && has_blend_mode_changed) {
Parent()->DescendantIsolationRequirementsChanged( Parent()->DescendantIsolationRequirementsChanged(
StyleRef().HasBlendMode() ? kDescendantIsolationRequired StyleRef().HasBlendMode() ? kDescendantIsolationRequired
: kDescendantIsolationNeedsUpdate); : kDescendantIsolationNeedsUpdate);
} }
}
if (diff.CompositingReasonsChanged()) if (diff.CompositingReasonsChanged())
SVGLayoutSupport::NotifySVGRootOfChangedCompositingReasons(this); SVGLayoutSupport::NotifySVGRootOfChangedCompositingReasons(this);
......
...@@ -154,19 +154,13 @@ void LayoutSVGModelObject::StyleDidChange(StyleDifference diff, ...@@ -154,19 +154,13 @@ void LayoutSVGModelObject::StyleDidChange(StyleDifference diff,
SetNeedsTransformUpdate(); SetNeedsTransformUpdate();
} }
if (IsBlendingAllowed()) { if (diff.BlendModeChanged() && Parent() && !IsSVGHiddenContainer()) {
bool has_blend_mode_changed = DCHECK(IsBlendingAllowed());
(old_style && old_style->HasBlendMode()) == !StyleRef().HasBlendMode();
if (Parent() && has_blend_mode_changed) {
Parent()->DescendantIsolationRequirementsChanged( Parent()->DescendantIsolationRequirementsChanged(
StyleRef().HasBlendMode() ? kDescendantIsolationRequired StyleRef().HasBlendMode() ? kDescendantIsolationRequired
: kDescendantIsolationNeedsUpdate); : kDescendantIsolationNeedsUpdate);
} }
if (has_blend_mode_changed)
SetNeedsPaintPropertyUpdate();
}
if (diff.CompositingReasonsChanged()) if (diff.CompositingReasonsChanged())
SVGLayoutSupport::NotifySVGRootOfChangedCompositingReasons(this); SVGLayoutSupport::NotifySVGRootOfChangedCompositingReasons(this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment