Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bb5913e37d019186e368a72dbde122306da9d75d
https://github.com/WebKit/WebKit/commit/bb5913e37d019186e368a72dbde122306da9d75d
Author: Luke Warlow <[email protected]>
Date: 2026-10-11 (Sun, 11 Oct 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup-crash.html
A
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup.html
A
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-select-hr-crash.html
M Source/WebCore/html/HTMLHRElement.cpp
M Source/WebCore/html/HTMLHRElement.h
M Source/WebCore/html/HTMLOptGroupElement.cpp
M Source/WebCore/html/HTMLOptGroupElement.h
Log Message:
-----------
Implement moving steps for optgroup and hr
https://bugs.webkit.org/show_bug.cgi?id=326810
Reviewed by Ryosuke Niwa.
HTMLOptGroupElement and HTMLHRElement keep a pointer to their owner select,
which is set in
insertionSteps() and cleared in removingSteps().
Neither had moving steps, so after a moveBefore() the pointer kept referring to
the old select.
That left a stale optgroup label rendered outside a select, and hit the owner
select assertion in removingSteps() when the element was later removed.
This adds moving steps to both, matching HTMLOptionElement, they update the
owner select and
recalculate the list items of the old and new selects.
The optgroup also invalidates its shadow tree so its label updates.
Tests:
imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup-crash.html
imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup.html
imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-select-hr-crash.html
*
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup-crash.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-optgroup.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/moveBefore-select-hr-crash.html:
Added.
* Source/WebCore/html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::movingSteps):
* Source/WebCore/html/HTMLHRElement.h:
* Source/WebCore/html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::movingSteps):
* Source/WebCore/html/HTMLOptGroupElement.h:
Canonical link: https://commits.webkit.org/323397@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications