diff --git a/third_party/blink/renderer/core/layout/layout_block.cc b/third_party/blink/renderer/core/layout/layout_block.cc index eb6e5a17e7912..13ca971c6e9ba 100644 --- a/third_party/blink/renderer/core/layout/layout_block.cc +++ b/third_party/blink/renderer/core/layout/layout_block.cc @@ -288,8 +288,12 @@ void LayoutBlock::StyleDidChange(StyleDifference diff, Layer() ? Layer()->Transform() : nullptr); // Compare local scale before and after. if (old_squared_scale != new_squared_scale) { - for (LayoutBox* box : *View()->SvgTextDescendantsMap().at(this)) + for (LayoutBox* box : *View()->SvgTextDescendantsMap().at(this)) { To(box)->SetNeedsTextMetricsUpdate(); + if (GetNode() == GetDocument().documentElement()) { + box->SetNeedsLayout(layout_invalidation_reason::kStyleChange); + } + } } } } diff --git a/third_party/blink/web_tests/external/wpt/svg/text/reftests/transform-dynamic-change-root-ref.html b/third_party/blink/web_tests/external/wpt/svg/text/reftests/transform-dynamic-change-root-ref.html new file mode 100644 index 0000000000000..179cbb128dd6c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/text/reftests/transform-dynamic-change-root-ref.html @@ -0,0 +1,6 @@ + + + +Text + + diff --git a/third_party/blink/web_tests/external/wpt/svg/text/reftests/transform-dynamic-change-root.html b/third_party/blink/web_tests/external/wpt/svg/text/reftests/transform-dynamic-change-root.html new file mode 100644 index 0000000000000..dd8a22d05db1f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/svg/text/reftests/transform-dynamic-change-root.html @@ -0,0 +1,20 @@ + + + + + + + +Text + + +