Skip to content

Commit 6c3b559

Browse files
authored
[css-ui-4] Define appearance:auto box rendering and integration with CSS (#11972)
* Define appearance:auto box rendering and integration with CSS * Editorial fixes --------- Co-authored-by: Chris Harrelson <chrishtr@google.com>
1 parent 66b7808 commit 6c3b559

File tree

1 file changed

+25
-31
lines changed

1 file changed

+25
-31
lines changed

css-ui-4/Overview.bs

+25-31
Original file line numberDiff line numberDiff line change
@@ -2227,7 +2227,7 @@ Switching appearance: the 'appearance' property</h3>
22272227
<a>widgets</a> are typically rendered by UAs using native UI controls of the host operating system,
22282228
which can neither be replicated nor styled using CSS.
22292229

2230-
The term <dfn export>widget</dfn> in this specification denotes elements that can have <dfn export>native appearance</dfn>,
2230+
The term <dfn export>widget</dfn> in this specification denotes [=replaced=] elements that can have <dfn export>native appearance</dfn>,
22312231
meaning that they are rendered like analogous native widgets or controls of the host operating system or platform,
22322232
or with a look and feel not otherwise expressible in CSS.
22332233
It is up to the host language (e.g., HTML [[HTML]]) to define which elements can have <a>native appearance</a>.
@@ -2310,14 +2310,14 @@ Switching appearance: the 'appearance' property</h3>
23102310

23112311
<dt><dfn>auto</dfn>
23122312
<dd>
2313-
Elements representing <a>widgets</a> should have the <a>native appearance</a> of that widget,
2314-
if the <a>properties that disable native appearance for widgets</a> are not in effect.
2315-
See [[#appearance-disabling-properties]].
2313+
The element's box is laid out like a regular replaced element.
23162314

2317-
The host language is responsible for defining
2318-
which elements represent which <a>widgets</a>.
2315+
Within that box, elements representing <a>widgets</a> should have the <a>native appearance</a> of that widget.
23192316

2320-
Elements other than <a>widgets</a> must be rendered as for ''appearance/none''.
2317+
The host language is responsible for defining
2318+
which elements represent which <a>widgets</a>.
2319+
2320+
Elements other than <a>widgets</a> must be rendered as for ''appearance/none''.
23212321

23222322
<dt><dfn>base</dfn>
23232323
<dd>
@@ -2417,42 +2417,36 @@ Switching appearance: the 'appearance' property</h3>
24172417
and activating (for example by clicking) the element would toggle the state as usual.
24182418
</div>
24192419

2420-
User agents may [=disregard=] some CSS properties
2421-
on [=widgets=] rendered with their [=native appearance=]
2420+
User agents may [=disregard=] some CSS properties used to size and paint the contents
2421+
of [=widgets=] rendered with their [=native appearance=]
24222422
to ensure that the intended appearance is preserved,
24232423
or because these properties may not be meaningful for the chosen appearance.
2424+
24242425
<dfn>Disregarding</dfn> a property means that
24252426
the user agent treats it as if it didn't [=apply to=] the widget in question.
24262427
Nevertheless,
24272428
unless an explicit exception is specified (for compatibility reasons),
24282429
the user agent must still determine the [=computed value=] of any [=disregarded=] property
24292430
according to the usual rules.
2430-
However, the following properties must not be [=disregarded=]:
24312431

2432+
In more detail, the rules for disregarding properties for [=natively rendered=] widgets are:
24322433
<ul>
2433-
<li>'appearance'
2434-
<li>'display' (the [=inner display type=] may be ignored)
2435-
<li>'visibility'
2436-
<li>'position'
2437-
<li>'top'
2438-
<li>'right'
2439-
<li>'bottom'
2440-
<li>'left'
2441-
<li>'float'
2442-
<li>'clear'
2443-
<li>'margin' and related long-hand properties
2444-
<li>'unicode-bidi'
2445-
<li>'direction'
2446-
<li>'cursor'
2447-
<li>'z-index'
2434+
<li> CSS properties that impact the box sizing or position of the widget's box (such as the [=sizing properties=]),
2435+
or their visual appearance outside of the box (such as 'transform', 'filter' or 'box-shadow'), must be applied to
2436+
[=widgets=] rendered with their [=native appearance=]. The widget's box participates in the rest of layout like any other replaced element.
2437+
<li> Properties that affect the internal box model sizing of the widget's box (such as 'box-sizing', 'padding', 'border' or 'margin') may be disregarded when needed.
2438+
<li> Other properties that affect painting (like 'background-color') may be disregarded when needed.
2439+
<li> User agents should take into account CSS properties that affect writing modes or font-related properties when possible,
2440+
when rendering text within the widget.
2441+
<li> The 'object-fit' property does not apply.
24482442
</ul>
24492443

2450-
Issue: Are there more properties that should be included in this list?
2451-
Should we remove some?
2452-
Should we whitelist the properties that are ok to ignore instead of
2453-
blacklisting those that are not?
2454-
Either way, UAs do ignore some properties when rendering <a>widgets</a>,
2455-
so this specification needs to say something about this.
2444+
<div class=example>
2445+
Some user agents respect the 'border' and 'padding' CSS properties for a &lt;select&gt; rendered with [=native appearance=], but
2446+
not for &lt;input type=checkbox&gt;.
2447+
</div>
2448+
2449+
Native rendering of widgets may overflow the size of its box if its intrinsic sizing exceeds that size.
24562450

24572451
For compatibility with legacy content, UAs must also support <dfn property export>-webkit-appearance</dfn>
24582452
as a [=legacy name alias=] of 'appearance'.

0 commit comments

Comments
 (0)