Commit 1b3e75b8 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Fix DCHECK failure when starting an SVG animation

Bug: 1126782
Change-Id: Ib13adc90f6807750e14fbb3ff6a6606f85800eb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404154Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806461}
parent b3c4e563
......@@ -2251,7 +2251,8 @@ void LayoutObject::SetStyle(scoped_refptr<const ComputedStyle> style,
(diff.TransformChanged() || diff.OpacityChanged() ||
diff.ZIndexChanged() || diff.FilterChanged() ||
diff.BackdropFilterChanged() || diff.CssClipChanged() ||
diff.BlendModeChanged() || diff.MaskChanged())) {
diff.BlendModeChanged() || diff.MaskChanged() ||
diff.CompositingReasonsChanged())) {
SetNeedsPaintPropertyUpdate();
}
}
......
......@@ -1821,4 +1821,24 @@ TEST_P(PaintPropertyTreeUpdateTest, InlineFilterReferenceBoxChange) {
properties->Filter()->Filter().ReferenceBox().Location());
}
TEST_P(PaintPropertyTreeUpdateTest, StartSVGAnimation) {
SetBodyInnerHTML(R"HTML(
<style>line {transition: transform 1s; transform: translateY(1px)}</style>
<svg width="200" height="200" stroke="black">
<line id="line" x1="0" y1="0" x2="150" y2="50">
</svg>
)HTML");
const auto* properties = PaintPropertiesForElement("line");
ASSERT_TRUE(properties);
ASSERT_TRUE(properties->Transform());
EXPECT_FALSE(properties->Transform()->HasDirectCompositingReasons());
GetDocument().getElementById("line")->setAttribute(
html_names::kStyleAttr, "transform: translateY(100px)");
UpdateAllLifecyclePhasesForTest();
ASSERT_EQ(properties, PaintPropertiesForElement("line"));
EXPECT_TRUE(properties->Transform()->HasDirectCompositingReasons());
}
} // namespace blink
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