Skip to content

Are form controls replaced elements? #12876

@gsnedders

Description

@gsnedders

From web-platform-tests/interop#1124 (cc @Loirooriol)

See previously: #1024.

CSS 2 says:

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:

An element whose content is outside the scope of the CSS formatting model, such as an image, embedded document, or applet.

CSS Display says:

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:

This value computes to display: none on replaced elements and other elements whose rendering is not entirely controlled by CSS; see Appendix B: Effects of display: contents on Unusual Elements for details.

CSS Sizing says:

In addition to the replaced elements listed in HTML§14.4 [HTML], the following HTML elements are also considered to be replaced elements for the purpose of the percentage-sized replaced element rule above, and can have their min-content contribution compressed when their width/height or max-width/max-height is expressed with a cyclic percentage size: [<input>, <select>, <textarea>, <progress>, <meter>, <marquee>]

CSS UI says:

The term widget in this specification denotes replaced 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:

The following elements can have a native appearance for the purpose of the CSS 'appearance' property.

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions