-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default UA stylesheet for <select> as a listbox + optgroup + option #8270
Comments
@mfreed7 do you have opinions here? |
Sorry for the delay. So is the plan to add some CSS to the Rendering section with values for these properties? If so, would you mind pointing me to that proposed CSS? (I looked at the test, and while it is cool, I can't tell where e.g. the expected value for Generally, I'm very supportive of trying to standardize as much of this as possible. But there are definitely web compat issues, depending on the changes, so I'd need time to test those out. |
Yes.
There's only the OP above, so no proposed CSS yet.
The test compares styles for HTML elements with only the UA stylesheet against non-HTML elements (with the same names) with the expected CSS as author-origin styles. So for any property that is not in the test's CSS the expectation is that it's the property's initial value.
OK, great. Is there a preference or rationale for current behavior for any of these? |
Got it, ok.
In terms of rationale, I'd have to go line by line and see what the history is. One question generally: for |
Only "as a listbox" case, so |
In this CL, we modified the "indentation" of <option> in <optgroup> to use a set padding instead of  . Using   caused <option> with different font styling to all be at different indentations. The padding amount was specifically chosen to align with Firefox as mentioned in whatwg/html#8270. Added a new test in select-multiple-appearance-basic.html and popup-menu-different-font-indentation.html to validate the expected behavior. Bug: 1318780 Change-Id: I77fcf7ec942c12cee2760a182eb2fa91c70225fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117116 Reviewed-by: Mason Freed <masonf@chromium.org> Auto-Submit: Stephanie Zhang <stephanie.zhang@microsoft.com> Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1092077}
…oup>" This reverts commit c655714. Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/60497/overview blink_web_tests failed because of: fast/forms/color-scheme/select/select-disabled-multiple-hover-focused-unselected.html fast/forms/color-scheme/select/select-multiple-appearance-basic.html fast/forms/color-scheme/select/select-multiple-hover-focused-unselected.html fast/forms/select/listbox-appearance-basic.html ...4 more failure(s) (8 total)... Original change's description: > Standardize indentation for different font <option> in <optgroup> > > In this CL, we modified the "indentation" of <option> in <optgroup> to > use a set padding instead of  . Using   caused <option> with different font styling to all be at different indentations. > > The padding amount was specifically chosen to align with Firefox as > mentioned in whatwg/html#8270. > > Added a new test in select-multiple-appearance-basic.html and popup-menu-different-font-indentation.html to validate the expected behavior. > > Bug: 1318780 > Change-Id: I77fcf7ec942c12cee2760a182eb2fa91c70225fe > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117116 > Reviewed-by: Mason Freed <masonf@chromium.org> > Auto-Submit: Stephanie Zhang <stephanie.zhang@microsoft.com> > Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com> > Cr-Commit-Position: refs/heads/main@{#1092077} Bug: 1318780 Change-Id: I3e60c273c8f5ea168cfad5e1dfc4591fc131157c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4164077 Auto-Submit: Johann Koenig <johannkoenig@google.com> Owners-Override: Johann Koenig <johannkoenig@google.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#1092191}
…oup>" This reverts commit 9cad467 and relands commit c655714. The original CL was missing some flag-specific and platform baselines. > Original change's description: > > Standardize indentation for different font <option> in <optgroup> > > > > In this CL, we modified the "indentation" of <option> in <optgroup> to use a set padding instead of  . Using   caused <option> with different font styling to all be at different indentations. > > > > The padding amount was specifically chosen to align with Firefox as mentioned in whatwg/html#8270. > > > > Added a new test in select-multiple-appearance-basic.html and popup-menu-different-font-indentation.html to validate the expected behavior. > > > > Bug: 1318780 > > Change-Id: I77fcf7ec942c12cee2760a182eb2fa91c70225fe > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117116 > > Reviewed-by: Mason Freed <masonf@chromium.org> > > Auto-Submit: Stephanie Zhang <stephanie.zhang@microsoft.com> > > Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com> > > Cr-Commit-Position: refs/heads/main@{#1092077} Bug: 1318780 Change-Id: Ic7851068e6687c9cec25ca31467c88291d69d156 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4164257 Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Stephanie Zhang <stephanie.zhang@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1092507}
All browsers prevent Chromium sets Gecko sets For select dropdown and in WebKit, |
The initial value for I can't get |
https://bugs.webkit.org/show_bug.cgi?id=257477 changed this in WebKit to match the other two. |
This is part of #7050
I created a tentative test against the current spec here: web-platform-tests/wpt#35801
Test results: https://wpt.fyi/results/html/rendering/widgets/the-select-element/select-as-listbox-default-styles.tentative.html?label=pr_head&max-count=1&pr=35801
Here are the failing tests:
select
margin: 2px
padding-block-start: 1px; padding-block-end: 1px
align-items: flex-start
white-space: nowrap
background-color
(might be subject to dark mode?)cursor: default
onselect
writing-mode: horizontal-tb
(Gecko supports vertical for form controls).overflow: hidden
, Geckooverflow: auto
.vertical-align: bottom
user-select: none
page-break-inside: avoid
option
(not inoptgroup
)padding-block: 2px; padding-inline: 4px
padding: 0 2px 1px 2px
white-space: nowrap
cursor
, font styles,writing-mode
are inherited)user-select: none
optgroup
white-space: nowrap
cursor
,writing-mode
are inherited)user-select: none
option
inoptgroup
padding: 0 2px 1px 2px
, Geckopadding-inline-start: 20px; padding-block: 2px
. Chromium instead indents the options withwhite-space: nowrap
cursor
, font styles,writing-mode
are inherited)user-select: none
These results are for desktop only, the styles on mobile/tablet may be different: #8189
I think it seems reasonable to try to get interop on margins, paddings, borders (which can look different than the CSS-specified borders when
appearance: auto
),align-items
,cursor
,overflow
,vertical-align
,user-select
,page-break-inside
, and how to indentoption
inoptgroup
.I'm not sure about
background-color
/color
, need to test dark mode. Font might also be tricky, maybe the spec can allow implementation-defined font and color properties?Should
writing-mode
be supported for form controls (like in Gecko) or not (like WebKit/Chromium)?For
optgroup
, I think it's reasonable to align on either bold or bold+italic.cc @whatwg/forms @mfreed7 @pxlcoder
The text was updated successfully, but these errors were encountered: