Skip to content

Commit c075412

Browse files
jugglinmikefrivoal
authored andcommitted
[css-ui] Define "native appearance" and rename control to widget (#3991)
Define 'native appearance' for host language specs to hook into, and rename 'control' to 'widget'. Closes #3990
1 parent b84ffce commit c075412

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

css-ui-4/Overview.bs

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,7 +1745,7 @@ without adverse consequences to compatibility,
17451745
so this specification allows flexibility.
17461746

17471747

1748-
<h2 id="control-styling" oldids="form-styling">Control Styling</h2>
1748+
<h2 id="styling-widgets" oldids="form-styling control-styling">Styling Widgets</h2>
17491749

17501750
<h3 id="appearance-switching" caniuse="css-appearance">Switching appearance</h3>
17511751

@@ -1760,13 +1760,18 @@ Animation type: discrete
17601760
</pre>
17611761

17621762
While the way most elements in a document look can be fully controlled by CSS,
1763-
controls are typically rendered by UAs using native UI controls of the host operating system,
1763+
<a>widgets</a> are typically rendered by UAs using native UI controls of the host operating system,
17641764
which can neither be replicated nor styled using CSS.
17651765

1766+
The term <dfn export>widget</dfn> in this specification denotes elements that can have <dfn export>native appearance</dfn>,
1767+
meaning that they are rendered like analogous native widgets or controls of the host operating system or platform,
1768+
or with a look and feel not otherwise expressible in CSS.
1769+
It is up to the host language (e.g., HTML [[HTML]]) to define which elements can have <a>native appearance</a>.
1770+
17661771
This specification introduces the 'appearance' property
17671772
to provide some control over this behavior.
17681773
In particular, using ''appearance: none'' allows authors
1769-
to suppress the native style of controls,
1774+
to suppress the <a>native appearance</a> of <a>widgets</a>,
17701775
so that CSS can be used to restyle them.
17711776

17721777
<details class=note>
@@ -1782,16 +1787,16 @@ so that CSS can be used to restyle them.
17821787
in part because many values applied to pseudo-elements that other browsers don't have,
17831788
as they construct form elements differently,
17841789
and which should not be standardized,
1785-
since the ability to make for controls look substantially different on different platforms
1790+
since the ability to make form controls look substantially different on different platforms
17861791
should be preserved.
17871792

1788-
Also, because the ability to turn any arbitrary element (including any form control)
1793+
Also, the ability to turn any arbitrary element (including any form control)
17891794
into any (other) arbitrary form control
17901795
is considered a misfeature.
17911796

17921797
Instead, the design being specified
17931798
is based on just having an "auto" value that makes form controls look like whatever they need,
1794-
and a "none" value that suppresses "native" look.
1799+
and a "none" value that suppresses [=native appearance=].
17951800

17961801
However, there is evidence that this alone is not web compatible,
17971802
due in part to uses such as:
@@ -1816,17 +1821,16 @@ so that CSS can be used to restyle them.
18161821
<dt><dfn>none</dfn>
18171822
<dd>
18181823
The element is rendered following the usual rules of CSS.
1819-
Replaced elements other than controls are not affected by this,
1824+
Replaced elements other than <a>widgets</a> are not affected by this,
18201825
and remain replaced elements.
1821-
Controls are <em>not</em> made to look like native controls of the host operating system.
1826+
<a>Widgets</a> must not have their <a>native appearance</a>.
18221827
See [[#appearance-decorative]] and [[#appearance-semantics]] for details.
18231828

18241829
<dt><dfn>auto</dfn>
18251830
<dd>
1826-
UAs may render controls using native controls of the host operating system
1827-
or with a look and feel not otherwise expressible in CSS.
1831+
<a>Widgets</a> may have their <a>native appearance</a>.
18281832

1829-
Elements other than controls must be rendered as if ''appearance/none'' had been specified.
1833+
Elements other than <a>widgets</a> must be rendered as if ''appearance/none'' had been specified.
18301834

18311835
<dt><dfn>button</dfn>
18321836
<dd>
@@ -1875,8 +1879,7 @@ so that CSS can be used to restyle them.
18751879
some of these values need to be promoted to being full blown values
18761880
with effects on arbitrary elements like ''button'',
18771881
or that
1878-
some of these values need to have some side effects on some controls.
1879-
1882+
some of these values need to have some side effects on some <a>widgets</a>.
18801883

18811884
</dl>
18821885

@@ -1906,7 +1909,7 @@ so that CSS can be used to restyle them.
19061909
and activating (for example by clicking) the element would toggle the state as usual.
19071910
</div>
19081911

1909-
On controls where the computed value is ''appearance/auto'' or one of the <<compat-auto>> values,
1912+
On <a>widgets</a> where the computed value is ''appearance/auto'' or one of the <<compat-auto>> values,
19101913
and on any element where the computed value is ''appearance/button'',
19111914
UAs may disregard some CSS properties
19121915
to ensure that the intended appearance is preserved,
@@ -1935,7 +1938,7 @@ Issue: Are there more properties should include in this list?
19351938
Should we remove some?
19361939
Should whitelist the properties that are ok to ignore instead of
19371940
blacklisting those that are not?
1938-
Either way, UAs do ignore some properties when rendering controls,
1941+
Either way, UAs do ignore some properties when rendering <a>widgets</a>,
19391942
so this specification needs to say something about this.
19401943

19411944
For compatibility with legacy content, UAs must also support <dfn property export>-webkit-appearance</dfn>
@@ -1944,7 +1947,7 @@ as a [=legacy name alias=] of 'appearance'.
19441947
<h4 id=appearance-decorative>
19451948
Effects of 'appearance' on Decorative Aspects of Elements</h4>
19461949

1947-
All decorative visual aspects of a control which are not caused by a CSS style rule
1950+
All decorative visual aspects of a <a>widget</a> which are not caused by a CSS style rule
19481951
must be suppressed when the appearance is changed using 'appearance',
19491952
even if the UA's internal representation for this element
19501953
was composed of multiple elements or pseudo elements combined together.
@@ -1957,14 +1960,14 @@ was composed of multiple elements or pseudo elements combined together.
19571960
</div>
19581961

19591962
UAs should include in their User Agent stylesheet style rules
1960-
to give controls a recognizable shape when 'appearance' is ''appearance/none''.
1963+
to give <a>widgets</a> a recognizable shape when 'appearance' is ''appearance/none''.
19611964

19621965
Note: Authors may therefore need to override these UA style rules to get the styling
19631966
they intended.
19641967

19651968
<div class=advisement>
19661969
Authors may find it convenient to use ''all: unset'',
1967-
to get fully unstyled controls
1970+
to get fully unstyled <a>widgets</a>
19681971
which they can then style as they want without interference from the browser's UA stylesheet.
19691972
However, this also suppresses the focus indicators provided by the same UA stylesheet.
19701973
In order avoid damaging accessibility,
@@ -1975,16 +1978,16 @@ they intended.
19751978
<h4 id=appearance-semantics>
19761979
Effects of 'appearance' on Semantic Aspects of Elements</h4>
19771980

1978-
UAs must preserve aspects of the control
1979-
which are necessary to operate the control with its original semantics.
1981+
UAs must preserve aspects of the <a>widget</a>
1982+
which are necessary to operate the <a>widget</a> with its original semantics.
19801983
The UA may however give them a different look and feel
1981-
as long as it remains possible to operate the control.
1982-
Aspects of a control which are merely needed to observe the state the control is in
1984+
as long as it remains possible to operate the <a>widget</a>.
1985+
Aspects of a <a>widget</a> which are merely needed to observe the state the <a>widget</a> is in
19831986
and are not needed to operate it
19841987
should be suppressed as well
19851988
when the same information can be conveyed using ordinary CSS.
19861989
Document languages should specify
1987-
for each control that they define
1990+
for each <a>widget</a> that they define
19881991
what needs to be preserved.
19891992

19901993
<div class=example>

0 commit comments

Comments
 (0)