- From: Sam Sneddon via GitHub <noreply@w3.org>
- Date: Mon, 29 Sep 2025 18:47:44 +0000
- To: public-css-archive@w3.org
gsnedders has just created a new issue for https://github.com/w3c/csswg-drafts: == Are form controlled replaced elements? == From https://github.com/web-platform-tests/interop/issues/1124 (cc @Loirooriol) See previously: https://github.com/w3c/csswg-drafts/issues/1024. CSS 2 [says](https://drafts.csswg.org/css2/#conformance): > CSS 2 does not define which properties apply to form controls and frames, or how CSS can be used to style them. User agents may apply CSS properties to these elements. Authors are recommended to treat such support as experimental. A future level of CSS may specify this further. CSS 2, defining "replaced element", [says](https://drafts.csswg.org/css2/#replaced-element): > An element whose content is outside the scope of the CSS formatting model, such as an image, embedded document, or applet. CSS Display [says](https://drafts.csswg.org/css-display/#replaced-element): > An element whose content is outside the scope of the CSS formatting model, such as an image or embedded document. CSS Display, defining `display: contents`, [says](https://drafts.csswg.org/css-display/#valdef-display-contents): > This value computes to [display: none](https://drafts.csswg.org/css-display/#propdef-display) on replaced elements and other elements whose rendering is not entirely controlled by CSS; see [Appendix B: Effects of display: contents on Unusual Elements](https://drafts.csswg.org/css-display/#unbox) for details. CSS Sizing [says](https://drafts.csswg.org/css-sizing/#min-content-zero): > In addition to the [replaced elements](https://drafts.csswg.org/css-display-4/#replaced-element) listed in [HTML§14.4](https://html.spec.whatwg.org/multipage/rendering.html#replaced-elements) [[HTML]](https://drafts.csswg.org/css-sizing-3/#biblio-html), the following HTML elements are also considered to be replaced elements for the purpose of the [percentage-sized replaced element rule](https://drafts.csswg.org/css-sizing-3/#replaced-percentage-min-contribution) above, and can have their [min-content contribution](https://drafts.csswg.org/css-sizing-3/#min-content-contribution) compressed when their [width](https://drafts.csswg.org/css-sizing-3/#propdef-width)/[height](https://drafts.csswg.org/css-sizing-3/#propdef-height) or [max-width](https://drafts.csswg.org/css-sizing-3/#propdef-max-width)/[max-height](https://drafts.csswg.org/css-sizing-3/#propdef-max-height) is expressed with a cyclic percentage size: [`<input>`, `<select>`, `<textarea>`, `<progress>`, `<meter>`, `<marquee>`] CSS UI [says](https://drafts.csswg.org/css-ui/#widget): > The term widget in this specification denotes [replaced](https://drafts.csswg.org/css-display-4/#replaced-element) elements that can have native appearance, meaning that they are rendered like analogous native widgets or controls of the host operating system or platform, or with a look and feel not otherwise expressible in CSS. HTML [says](https://html.spec.whatwg.org/multipage/rendering.html#widgets): > The following elements can have a [native appearance](https://drafts.csswg.org/css-ui/#native-appearance) for the purpose of the CSS ['appearance'](https://drafts.csswg.org/css-ui/#appearance-switching) property. > > * [button](https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element) > * [input](https://html.spec.whatwg.org/multipage/input.html#the-input-element) > * [meter](https://html.spec.whatwg.org/multipage/form-elements.html#the-meter-element) > * [progress](https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element) > * [select](https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element) > * [textarea](https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element) So: * CSS 2 explicitly leaves form controls undefined, and "replaced element" definition would presumably include them (because they're not defined by the CSS model), * CSS Display has a similar definition of "replaced element", but also talks about form controls distinct to replaced elements, * CSS Sizing implies that a number of HTML elements are to be considered replaced elements (implying they're not in general), * CSS UI makes it clear that widgets are replaced elements, * HTML defines them as widgets (per the CSS UI definition). So on the whole to me it seems like the intention is that they are replaced elements, but we don't make this super obvious? Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12876 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 29 September 2025 18:47:46 UTC