Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 498cdeb54915897996f55c8eb5cac655021a74ce
https://github.com/WebKit/WebKit/commit/498cdeb54915897996f55c8eb5cac655021a74ce
Author: Ahmad Saleem <[email protected]>
Date: 2025-12-20 (Sat, 20 Dec 2025)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-002-expected.txt
M
LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt
M
LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-002-expected.txt
M
LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt
M
LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-002-expected.txt
M
LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt
M Source/WebCore/mathml/MathMLRootElement.cpp
M Source/WebCore/mathml/MathMLRootElement.h
M Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
M Source/WebCore/rendering/mathml/RenderMathMLRoot.h
Log Message:
-----------
RenderMathMLRoot does not reset radical operator when children change
dynamically
https://bugs.webkit.org/show_bug.cgi?id=304194
rdar://166556627
Reviewed by Frédéric Wang.
When children are dynamically removed from msqrt or mroot elements, the radical
operator retains its previously stretched width from the larger content,
causing the element to be wider than necessary for the remaining children.
The issue occurs because the renderer is not notified when the child list
changes. While styleDidChange() properly resets m_radicalOperator for style
changes, there was no corresponding mechanism to reset it when children are
added or removed from the DOM.
Fix by overriding childrenChanged() in MathMLRootElement to notify the
renderer when the child list changes. The renderer resets m_radicalOperator
and marks itself as needing layout and preferred width recalculation, ensuring
width calculations reflect the current children rather than stale cached state.
* Source/WebCore/mathml/MathMLRootElement.cpp:
(WebCore::MathMLRootElement::childrenChanged):
* Source/WebCore/mathml/MathMLRootElement.h:
* Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::styleDidChange):
* Source/WebCore/rendering/mathml/RenderMathMLRoot.h:
> Progressions:
*
LayoutTests/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-002-expected.txt:
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt:
*
LayoutTests/platform/glib/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-002-expected.txt:
*
LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt:
*
LayoutTests/platform/ios/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-002-expected.txt:
*
LayoutTests/platform/mac/imported/w3c/web-platform-tests/mathml/relations/html5-tree/dynamic-childlist-001-expected.txt:
Canonical link: https://commits.webkit.org/304822@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications