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,14 +126,11 @@ void LayoutSVGBlock::StyleDidChange(StyleDifference diff,
SetNeedsTransformUpdate();
}
if (IsBlendingAllowed()) {
bool has_blend_mode_changed =
(old_style && old_style->HasBlendMode()) == !StyleRef().HasBlendMode();
if (Parent() && has_blend_mode_changed) {
Parent()->DescendantIsolationRequirementsChanged(
StyleRef().HasBlendMode() ? kDescendantIsolationRequired
: kDescendantIsolationNeedsUpdate);
}
if (diff.BlendModeChanged() && Parent()) {
DCHECK(IsBlendingAllowed());
Parent()->DescendantIsolationRequirementsChanged(
StyleRef().HasBlendMode() ? kDescendantIsolationRequired
: kDescendantIsolationNeedsUpdate);
}
if (diff.CompositingReasonsChanged())
......
......@@ -154,17 +154,11 @@ void LayoutSVGModelObject::StyleDidChange(StyleDifference diff,
SetNeedsTransformUpdate();
}
if (IsBlendingAllowed()) {
bool has_blend_mode_changed =
(old_style && old_style->HasBlendMode()) == !StyleRef().HasBlendMode();
if (Parent() && has_blend_mode_changed) {
Parent()->DescendantIsolationRequirementsChanged(
StyleRef().HasBlendMode() ? kDescendantIsolationRequired
: kDescendantIsolationNeedsUpdate);
}
if (has_blend_mode_changed)
SetNeedsPaintPropertyUpdate();
if (diff.BlendModeChanged() && Parent() && !IsSVGHiddenContainer()) {
DCHECK(IsBlendingAllowed());
Parent()->DescendantIsolationRequirementsChanged(
StyleRef().HasBlendMode() ? kDescendantIsolationRequired
: kDescendantIsolationNeedsUpdate);
}
if (diff.CompositingReasonsChanged())
......
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