Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6cbbd3d85350fa3de395e431af5d71895877b95a
https://github.com/WebKit/WebKit/commit/6cbbd3d85350fa3de395e431af5d71895877b95a
Author: Chris Dumez <[email protected]>
Date: 2026-04-23 (Thu, 23 Apr 2026)
Changed paths:
M LayoutTests/accessibility/crash-table-recursive-layout-expected.txt
M
LayoutTests/fast/dom/HTMLFormElement/associated-elements-after-index-assertion-fail2-expected.txt
M LayoutTests/fast/dom/HTMLLabelElement/label-control-expected.txt
M LayoutTests/fast/forms/label/labelable-elements-expected.txt
M LayoutTests/fast/forms/label/labels-add-htmlFor-label-expected.txt
M LayoutTests/fast/forms/label/labels-add-parent-label-expected.txt
M LayoutTests/fast/forms/label/labels-change-htmlFor-attribute-expected.txt
M LayoutTests/fast/forms/label/labels-multiple-sibling-labels-expected.txt
M LayoutTests/fast/forms/label/labels-parent-and-sibling-labels-expected.txt
M LayoutTests/fast/forms/label/labels-remove-htmlFor-attribute-expected.txt
M LayoutTests/fast/forms/label/labels-remove-htmlFor-label-expected.txt
M LayoutTests/fast/forms/label/labels-remove-parent-label-expected.txt
M LayoutTests/fast/forms/select/menulist-focusable-items-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/editing/other/editing-around-select-element.tentative_delete-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/editing/other/editing-around-select-element.tentative_forwardDelete-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/dom/aria-element-reflection-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/getter-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/form-controls/resets-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-option-element/option-index-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/standalone-optgroup-no-shadow-tree-after-select-expected.html
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/standalone-optgroup-no-shadow-tree-expected.html
M
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/standalone-optgroup-no-shadow-tree-ref.html
M LayoutTests/platform/glib/fast/frames/iframe-option-crash-expected.txt
M LayoutTests/platform/ios/fast/frames/iframe-option-crash-expected.txt
M LayoutTests/platform/mac/fast/frames/iframe-option-crash-expected.txt
M Source/WebCore/css/html.css
Log Message:
-----------
Add `display: block` UA style rules for optgroup and option elements
https://bugs.webkit.org/show_bug.cgi?id=312964
Reviewed by Anne van Kesteren (OOPS\!).
Previously, WebKit only applied `display: block` to `optgroup` inside `select`
(via `select optgroup { display: block }`). This meant `optgroup` and `option`
outside of `select` were rendered inline, causing `innerText` to not produce
line breaks at their boundaries.
Both Blink and Firefox apply `display: block` unconditionally to these elements:
Blink (html.css):
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/resources/html.css
```
optgroup {
font-weight: bolder;
display: block;
}
option {
...
display: block;
...
}
```
Firefox (forms.css):
https://searchfox.org/mozilla-central/source/layout/style/res/forms.css
```
optgroup {
display: block;
...
}
option {
display: block;
...
}
```
This aligns WebKit with other engines and fixes several innerText subtests
in the WPT getter.html test for `optgroup/option` elements outside of `select`.
Also fix the standalone-optgroup-no-shadow-tree WPT ref tests which were
comparing a standalone optgroup against a plain <div>. The refs now copy the
font-weight from an optgroup onto the div so it matches regardless of what
default styling each engine applies to optgroup. These tests were already
marked as failing in Blink for the same reason.
*
LayoutTests/imported/w3c/web-platform-tests/html/dom/elements/the-innertext-and-outertext-properties/getter-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-select-element/customizable-select/standalone-optgroup-no-shadow-tree-ref.html:
* Source/WebCore/css/html.css:
(optgroup):
(option):
(select optgroup): Deleted.
Canonical link: https://commits.webkit.org/311911@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications