Skip to content
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

[css-ui] Disallow internal pseudo-elements and 'appearance' values #3968

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions css-ui-4/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1804,25 +1804,6 @@ Computed value: specified keyword
Animation type: discrete
</pre>

<div class="note">
Note: This specification intentionally refrains from making the appearance
of all possible form controls and sub-controls available as values,
as had previously been attempted by earlier proposals for this property
and by several UA vendors in experimental implementations.
Experience has shown that such a list would be very long and not practical to maintain,
and UAs would need to add non-standard values
to account for the behavior of non-standard pseudo-elements
sometimes used to implement form controls.
Moreover, many values of such an enumeration only make sense
on a single element or pseudo-element,
and are never used outside of the UA stylesheet.
The ability provided by this approach to turn any arbitrary element
into any arbitrary form control or subcontrol
was also a significant source of complexity,
despite being not particularly useful.
The model provided by this specification is deliberately simpler.
</div>

<dl dfn-type=value dfn-for=appearance>
<dt><dfn>none</dfn>
<dd>
Expand Down Expand Up @@ -1888,6 +1869,23 @@ Animation type: discrete

</dl>

Some controls have internal parts, or sub controls.
For example, an <code class="lang-markup">&lt;input type=search></code> element
could have a clear button to clear the text.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this context, "a clear button" might be taken to mean "a button with no background color." Scare quotes would help avoid this ("a "clear" button") as would removing the adjective altogether (which seems acceptable given the phrase is immediately followed by a description of the button's purpose).

Some user agents support pseudo-elements for sub controls,
and support specific values for the 'appearance' property for those pseudo-elements.
This specification intentionally does not specify such values.

User agents may support such pseudo-elements and specific 'appearance' values
in the <a>user agent origin</a> and <a>user origin</a>,
but must not support them in the <a>author origin</a>,
and must not expose the computed style of such pseudo-elements in the {{getComputedStyle()}} API.

<div class="note">
If some of these pseudo-elements and 'appearance' values do ought to be exposed to authors,
all related parts need to be standardized, not just the 'appearance' keywords.
</div>

<div class=example>
An author wanting to customize the look and feel of check boxes in HTML could use the following:
<pre><code class="lang-css">
Expand Down