Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c4c7d4d56e3e663789bbcff34edd163b45eed345
      
https://github.com/WebKit/WebKit/commit/c4c7d4d56e3e663789bbcff34edd163b45eed345
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-09-29 (Tue, 29 Sep 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLOptionElement-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLOptionElement.html
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLOptionsCollection-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLOptionsCollection.html
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLSelectElement-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/custom-elements/reactions/HTMLSelectElement.html
    M 
LayoutTests/imported/w3c/web-platform-tests/dom/nodes/moveBefore/select-option-optgroup-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-attribute-change-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-attribute-change.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-insertion-removal-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-movebefore-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-mutations-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-nested-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-nested-select-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-nested-select.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-option-insertion-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-option-insertion.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-subtree-mutations.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/w3c-import.log
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-ancestor-subtree-removal-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-ancestor-subtree-removal.html
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-attribute-change-reset-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-attribute-change-reset.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/w3c-import.log
    M 
LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-mutations-expected.txt
    M Source/WebCore/html/HTMLOptGroupElement.idl
    M Source/WebCore/html/HTMLOptionElement.cpp
    M Source/WebCore/html/HTMLOptionElement.h
    M Source/WebCore/html/HTMLOptionElement.idl
    M Source/WebCore/html/HTMLOptionsCollection.idl
    M Source/WebCore/html/HTMLSelectElement.cpp
    M Source/WebCore/html/HTMLSelectElement.h
    M Source/WebCore/html/HTMLSelectElement.idl
    M Source/WebCore/html/HTMLSelectedContentElement.cpp
    M Source/WebCore/html/HTMLSelectedContentElement.h

  Log Message:
  -----------
  Keep all descendant selectedcontent elements up to date
https://bugs.webkit.org/show_bug.cgi?id=320187
rdar://183736776

Reviewed by Ryosuke Niwa.

Align <selectedcontent> with https://github.com/whatwg/html/pull/12263

A <selectedcontent> element now works out whether it is disabled when it is
inserted, not only once it is connected. That way a <selectedcontent> nested in
another one is never updated, and those of a disconnected <select> are. When a
<selectedcontent> is connected, it only updates itself.

Inserting a selected <option> now updates <selectedcontent> from the option's
post-connection steps, which also covers options inside wrapper elements.
Removing or moving a selected <option>, or moving a <selectedcontent>, updates
it in a microtask instead. The moving steps of <option> now also run when an
ancestor of the option is moved, so it follows its new <select>. That lets
dom/nodes/moveBefore/select-option-optgroup.html run again.

A form reset now updates <selectedcontent> as well.

Updating <selectedcontent> in response to size and disabled changes is left for
a follow-up. selectedcontent-subtree-mutations.html is skipped because
moveBefore() of a <select> double-registers the named slot in its shadow tree.

Tests: 
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-attribute-change.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-nested-select.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-option-insertion.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/selectedcontent-subtree-mutations.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-ancestor-subtree-removal.html
       
imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/select-attribute-change-reset.html

Tests upstream: https://github.com/web-platform-tests/wpt/pull/62242

Canonical link: https://commits.webkit.org/322148@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to