From 1fababc2ee1e86a63e47dc54fe77e7e04cdc6fc8 Mon Sep 17 00:00:00 2001 From: Anna Sato Date: Thu, 18 Jun 2026 20:21:11 -0700 Subject: [PATCH] Revert "Use slot fallback to render optgroup label attr" This reverts commit db609514c367c1018fccbea7e3e78c8036fc1ae4. Reason for revert: Consistent test failures on Fuchsia bots due to accessibility tree expectation mismatches. Affected tests include: - DumpAccessibilityTreeTest.AccessibilityComboboxOptgroup - DumpAccessibilityTreeTest.AccessibilityModalDialogClosed - DumpAccessibilityTreeTest.AccessibilityModalDialogOpened - DumpAccessibilityTreeTest.AccessibilityModalDialogStack - DumpAccessibilityTreeTest.AccessibilityOptgroup ... and others. Failure Link: https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-x64-cast-receiver-rel/30173/overview https://ci.chromium.org/ui/p/chromium/builders/ci/fuchsia-arm64-cast-receiver-rel/30278/test-results Original change's description: > Use slot fallback to render optgroup label attr > > Instead of setting display:none on the element which holds the label > attribute when a legend element is present, we can put the label > attribute holding element as a child of a new slot for the legend > element, so it automatically gets rendered when there is no legend > element. > > The legend element is only supposed to be the first element in the > optgroup as per the content model in the HTML spec, so this patch also > enforces that by only slotting the legend element in when it is the > first child element. Allowing or using the legend element inside of > optgroups was a new feature with customizable select, so compat risk is > low. > > Context: https://github.com/whatwg/html/pull/12201#discussion_r2862689322 > > There are a11y test expectations because the UA shadowroot is being > changed, but this should not be visible to ATs because the new nodes are > marked as invisible and ignored, and only appear in the internal "blink" > a11y trees as opposed to real platform trees. > > Change-Id: I776fee963146abbad2028638479df7d3362c35ac > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7629416 > Reviewed-by: Joey Arhar > Reviewed-by: David Baron > Commit-Queue: Joey Arhar > Cr-Commit-Position: refs/heads/main@{#1649235} No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iae750043c09be7dede4b8fbea417995de96ec9cb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7961701 Owners-Override: Anna Sato Commit-Queue: rubber-stamper@appspot.gserviceaccount.com Auto-Submit: Anna Sato Bot-Commit: rubber-stamper@appspot.gserviceaccount.com Cr-Commit-Position: refs/heads/main@{#1649473} --- ...earance-optgroup-legend-and-label-ref.html | 22 ------------------- ...-appearance-optgroup-legend-and-label.html | 6 +---- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label-ref.html diff --git a/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label-ref.html b/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label-ref.html deleted file mode 100644 index 4d630b14161cf0..00000000000000 --- a/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label-ref.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -
-
one
-
-
legend
-
two
-
-
-
label
-
three
-
legend after option
-
-
- - diff --git a/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label.html b/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label.html index e692f32e421172..78447d7644102f 100644 --- a/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label.html +++ b/html/semantics/forms/the-select-element/customizable-select/select-appearance-optgroup-legend-and-label.html @@ -2,7 +2,7 @@ - + @@ -23,10 +23,6 @@ legend - - - legend after option -