RESOLVED FIXED 263968
Remove SwitchThumbElement and SwitchTrackElement
https://bugs.webkit.org/show_bug.cgi?id=263968
Summary Remove SwitchThumbElement and SwitchTrackElement
Anne van Kesteren
Reported 2023-10-31 07:57:14 PDT
Antti tells me internal element subclasses are an anti-pattern. And given how we have been slowly shifting the approach we might not need them after all.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-11-07 06:58:13 PST
Tim Nguyen (:ntim)
Comment 2 2023-11-19 12:28:30 PST
They aren't necessary if you're not using any of the resolveCustomStyle stuff. See: https://searchfox.org/wubkat/rev/114aa2c8594807cbc34dd5dff48a9e2addfd1e00/Source/WebCore/html/ColorInputType.cpp#148,155 on how you can create a <div> with a PseudoId associated to it.
Anne van Kesteren
Comment 3 2023-12-09 07:43:17 PST
Note that I'm not entirely sure it's possible to remove these. We probably need resolveCustomStyle() to set grid-area: 1/1; conditionally.
Tim Nguyen (:ntim)
Comment 4 2023-12-09 08:31:13 PST
(In reply to Anne van Kesteren from comment #3) > Note that I'm not entirely sure it's possible to remove these. We probably > need resolveCustomStyle() to set > > grid-area: 1/1; > > conditionally. The problem here is that WebKit is using display: inline-grid for a form control in the first place. Changing the display value should not break the form control layout. (Fwiw, WebKit has a similar issue with date inputs and display: inline-flex)
Anne van Kesteren
Comment 5 2023-12-10 23:16:37 PST
Could you elaborate on that? It's not clear to me how that works for appearance:auto. I can see someone being able to change the outer display value, but the inner display value has to be grid, no? Perhaps for appearance:auto that part has to be !important.
Tim Nguyen (:ntim)
Comment 6 2023-12-11 19:52:32 PST
(In reply to Anne van Kesteren from comment #5) > Could you elaborate on that? It's not clear to me how that works for > appearance:auto. I can see someone being able to change the outer display > value, but the inner display value has to be grid, no? Perhaps for > appearance:auto that part has to be !important. This seems to be set on the web exposed element: https://searchfox.org/wubkat/rev/3943142d2ef1777fc8977e6158eb10e053c3f8ca/Source/WebCore/css/htmlSwitchControl.css#27-30 We shouldn't be able to break the layout of the switch by setting a different display type on the input itself.
Anne van Kesteren
Comment 7 2024-01-12 10:04:26 PST
Given the approach taken in bug 267334 I've become more convinced we can remove these elements. For a future appearance:base we could use StyleAppearance::BaseThumb or some such and some corresponding adjustBaseThumbStyle() method. Or reconcile it with SwitchThumb and branch on the host. Various options.
Anne van Kesteren
Comment 8 2024-01-20 02:46:10 PST
EWS
Comment 9 2024-01-20 04:53:40 PST
Committed 273262@main (75760f40e328): <https://commits.webkit.org/273262@main> Reviewed commits have been landed. Closing PR #23013 and removing active labels.
EWS
Comment 10 2024-01-25 01:09:31 PST
Committed 272448.356@safari-7618-branch (2e9a891e4ccc): <https://commits.webkit.org/272448.356@safari-7618-branch> Reviewed commits have been landed. Closing PR #1038 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.