ED: https://drafts.csswg.org/css-ui-4/
Status Text: This specification will include and extend CSS Basic User Interface Module Level 3. [[CSS3-UI]]
TR: https://www.w3.org/TR/css-ui-4/
Previous Version: https://www.w3.org/TR/2015/WD-css-ui-4-20150922/
Shortname: css-ui
Level: 4
Group: csswg
!Issue Tracking: https://wiki.csswg.org/spec/css4-ui#css4-ui-issues-list
Status: ED
Work Status: Exploring
Editor: Florian Rivoal, On behalf of Bloomberg, http://florian.rivoal.net/
Ignored Terms: box-sizing, resize, text-overflow, caret-color, nav-up, nav-down, nav-left, nav-right
Link Defaults: css-position-3 (property) position
Link Defaults: css21 (property) float
Link Defaults: css21 (property) clear
Link Defaults: selectors-4 (selector) :checked
Link Defaults: selectors-4 (selector) :enabled
Link Defaults: selectors-4 (selector) :disabled
Abstract: This specification describes user interface related
properties and values to style HTML and XML (including XHTML).
It includes and extends user interface related features
from the properties and values of previous CSS levels.
It uses various properties and values
to style basic user interface elements in a document.
At risk: Applicability of 'user-select' to ''::before'' and ''::after''
This module describes CSS properties which enable authors
to style user interface related properties and values.
Section 2.1 of CSS1 [[CSS1]]
and Chapter 18 of CSS2 [[CSS21]]
introduced several user interface related properties and values.
User Interface for CSS3 (16 February 2000) introduced several new user interface related features.
[[CSS3-UI]] was later introduced to incorporates, extends, and supersedes these.
This specification continues this work, and in turn replaces [[CSS3-UI]].
Note: At the time of writing, [[CSS3-UI]] is not completely finalized yet.
To avoid accidental divergences and maintenance overhead,
This specification is written as a delta specification over CSS-UI Level 3.
Once the level 3 specification is final,
its content will be integrated into this specification,
which will then replace it.
Until then, CSS-UI Level 4 only contains additions and extensions to level 3.
Purpose
The purpose of this specification is to achieve the following objectives:
Extend the user interface features in CSS2.1 and [[CSS3-UI]]
Provide additional CSS mechanisms to augment or replace other
dynamic presentation related features in HTML.
Introduce directional navigation properties to assist in the construction of
user interfaces which make use of a directional navigation model.
Module Interactions
This document defines new features not present in earlier specifications.
In addition, it replaces and supersedes [[!CSS3-UI]],
which itself replaced and superseded the following:
Section 18.1,
section 18.4,
and Information on the stacking of outlines defined in
Appendix E
of Cascading Style Sheets, level 2, revision 1 [[CSS21]]
Offsetting the Outline: the 'outline-offset' property
Issue: Add final level 3 content
Resizing & Overflow
Issue: Add final level 3 content
Resizing Boxes: the 'resize' property
Issue: Add final level 3 content
In addition to elements
whose computed 'overflow' value
is something other than ''visible'',
the 'resize' property also applies
regardless of the value of the ''overflow'' property,
to:
Replaced elements representing images or videos, such as <{img}>, <{video}>, <{picture}>, <{svg}>, <{object}>, or <{canvas}>.
The <{iframe}> element.
Overflow Ellipsis: the 'text-overflow' property
Name: text-overflow
Value: [ clip | ellipsis | <> | fade | <> ]{1,2}
Initial: clip
Applies to: block containers
Inherited: no
Percentages: refer to the width of the line box
Media: visual
Computed value: As specified, with <> converted to absolute units
This property specifies rendering when inline content overflows
its line box edge
in the inline progression direction of its block container element ("the block")
that has 'overflow'
other than ''visible''.
Text can overflow for example when it is prevented from wrapping
(e.g. due to white-space: nowrap
or a single word is too long to fit).
Values have the following meanings:
clip
Clip inline content that overflows its block container element.
Characters may be only partially rendered.
ellipsis
Render an ellipsis character (U+2026)
to represent clipped inline content.
Implementations may substitute a more language, script, or writing-mode appropriate
ellipsis character,
or three dots "..." if the ellipsis character is unavailable.
<>
Render the given string to represent clipped inline content.
The given string is treated as an independent paragraph
for bidi purposes.
fade( <> | <> )
Clip inline content that overflows its line box.
Characters may be only partially rendered.
In addition, the UA must apply a fade out effect
near the edge of the line box,
reaching complete transparency at the edge.
Issue: Do we need to define the way
the fade out is calculated
so that the fading is identical across browsers?
It should probably be something like
''mask-image: linear-gradient(to right, rgba(0,0,0,1), rgba(0,0,0,0))'',
except applied to the relevant portion of the line only.
The argument determines the distance
over which the fade effect is applied.
The <> is resolved against the width of the line box.
Values lower than 0 are clipped to 0.
Values greater than the width of the line box are clipped to the width of the line box.
Issue: If the line box is too short
to display the fade effect at the desired length,
should we drop the effect,
or shrink the distance it is applied over until it fits,
or clip the end of the fade?
Issue: How should we deal with
things overflowing out of the line box,
or overlapping onto it?
Should fade apply to the logical content of the line,
or to the physical area of the line box,
or the intersection of both?
fade
Same as ''fade()'',
but the distance over which the fading effect is applied
is determined by the UA.
''1em'' is suggested as a reasonable value.
The term "character" is used in this property definition
for better readability and means "grapheme cluster" [[!UAX29]]
for implementation purposes.
If there is one value,
it applies only to the end line box edge.
If there are two values,
the first value applies to the line-left edge,
and the second value applies to the line-right edge.
The terms end, line-left and line-right are defined in [[!CSS-WRITING-MODES-3]].
Note: the use of line-left and line-right
rather than start and end
when there are two values is intentional,
to facilitate the use of directional characters such as arrows.
For the ellipsis
and string values,
implementations must hide characters and
atomic inline-level elements
at the applicable edge(s) of the line as necessary to fit the ellipsis/string, and
place the ellipsis/string immediately adjacent
to the applicable edge(s) of the remaining inline content.
The first character or
atomic inline-level element
on a line
must be clipped rather than ellipsed.
ellipsing details
Ellipsing only affects rendering and must not affect layout
nor dispatching of pointer events.
The ellipsis is styled and baseline-aligned according to
the block.
Ellipsing occurs after relative positioning and other graphical transformations.
If there is insufficient space for the ellipsis,
then clip the rendering of the ellipsis itself
(on the same side that neutral characters on the line
would have otherwise been clipped with the ''text-overflow:clip'' value).
user interaction with ellipsis
When the user is interacting with content
(e.g. editing, selecting, scrolling),
the user agent may treat text-overflow ''ellipsis'', string values, ''overflow-text/fade'' or ''overflow-text/fade()'' as ''text-overflow:clip''.
Selecting the ellipsis should select the ellipsed text.
If all of the ellipsed text is selected,
UAs should show selection of the ellipsis.
Behavior of partially-selected ellipsed text is up to the UA.
Example(s):
text-overflow examples
These examples demonstrate setting the text-overflow of a block container element
that has text which overflows its dimensions:
sample CSS for a div:
<div style="text-overflow:fade; overflow:hidden">
CSS IS AWESOME, YES
</div>
CSS IS AWESOME, YES
Note: the side of the line that the ellipsis is placed depends on the 'direction' of the block.
E.g. an overflow hidden right-to-left
(direction: rtl)
block clips inline content on the left side,
thus would place a text-overflow ellipsis on the left
to represent that clipped content.
ellipsis interaction with scrolling interfaces
This section applies to elements with text-overflow other than ''text-overflow:clip''
(non-clip text-overflow)
and overflow:scroll.
When an element with non-clip text-overflow has overflow of scroll
in the inline progression dimension of the text,
and the browser provides a mechanism for scrolling
(e.g. a scrollbar on the element,
or a touch interface to swipe-scroll, etc.),
there are additional implementation details that provide a better user experience:
When an element is scrolled (e.g. by the user, DOM manipulation),
more of the element's content is shown.
The value of text-overflow should not affect
whether more of the element's content is shown or not.
If a non-clip text-overflow is set,
then as more content is scrolled into view,
implementations should show whatever additional content fits,
only truncating content which would otherwise be clipped
(or is necessary to make room for the ellipsis/string),
until the element is scrolled far enough
to display the edge of the content
at which point that content should be displayed
rather than an ellipsis/string.
Example(s):
This example uses text-overflow on an element with overflow scroll
to demonstrate the above described behavior.
sample CSS:
<div class="crawlbar">
CSS is awesome, especially when you can scroll
to see extra text instead of just
having it overlap other text by default.
</div>
demonstration of sample CSS and HTML:
CSS is awesome, especially when you can scroll
to see extra text instead of just
having it overlap other text by default.
As some content is scrolled into view,
it is likely that other content may scroll out of view on the other side.
If that content's block container element is the same
that's doing the scrolling,
and the computed value of 'text-overflow' has two values, with
the value applying to the start edge being a non-clip value,
then implementations must render an ellipsis/string in place of
the clipped content,
with the same details as described in the value definition above,
except that the ellipsis/string is drawn in the start
(rather than end) of
the block's direction (per the direction property).
While the content is being scrolled,
implementations may adjust their rendering of ellipses/strings
(e.g. align to the box edges rather than line edges).
Example(s):
Same as previous example except with text-overflow: ellipsis ellipsis, demonstrated:
CSS is awesome, especially when you can scroll
to see extra text instead of just
having it overlap other text by default.
If there is insufficient space for both start
and end ellipses/strings,
then only the end ellipsis/string should be rendered.
Issue: Add final level 3 content
Pointing Devices and Keyboards
Pointer interaction
Styling the Cursor: the 'cursor' property
Issue: Add final level 3 content
Issue: Amend the definition of ''cursor/auto''
to show ''cursor/default'' rather than ''cursor/text''
over text when 'user-select' is ''user-select/none''.
Insertion caret
Coloring the Insertion Caret: the 'caret-color' property
Issue: Add final level 3 content
Issue: Amend the definition of ''caret-color/auto'' to highlight
the fact that when 'caret-shape' is ''caret-shape/block'',
ensuring good visibility and contrast means not using
currentColor.
Shape of the insertion caret: 'caret-shape'
Name: caret-shape
Value: auto | bar | block | underscore
Initial: auto
Applies to: elements that accept input
Inherited: yes
Percentages: N/A
Media: interactive
Computed value: Same as specified value
Animatable: no
This property allows authors to specify
the desired shape of the text insertion caret.
Within the context of this definition, character is
to be understood as extended grapheme cluster,
as defined in [[!UAX29]], and visible character
means a character with a non-zero advance measure.
auto
The UA determines the shape of the caret.
It should match platform conventions,
and may be adjusted based on context.
For example, if a UA switches between insert mode and overtype mode when the
user presses the insert key on their keyboard,
it may show a ''caret-shape/bar'' caret in insert mode,
and a ''caret-shape/block'' caret in overtype mode.
bar
The UA must render the text insertion caret
as a thin bar placed at the insertion point.
This means it is between, before, or after characters, not over them.
It should be perpendicular to the inline progression direction,
although UAs may render it slanted when inserting italic or oblique text.
block
The UA must render the text insertion caret
as a rectangle overlapping the next visible character following the insertion point.
If there is no visible character after the insertion point,
the UA must render the caret after the last visible character.
UAs may render it as a slanted rectangle when inserting italic or oblique text.
underscore
The UA must render the text insertion caret
as a thin line under (as defined in [[!CSS-WRITING-MODES-3]]
the next visible character following the insertion point.
If there is no visible character after the insertion point,
the UA must render the caret after the last visible character.
The width of the ''caret-shape/block'' and ''caret-shape/underscore'' carets
should be the advance measure of the next visible character after the insertion point,
or ''1ch'' if there is no next visible character
or if this information is impractical to determine.
When determining the orientation and appearance of the caret,
UAs must take into account the writing mode [[!CSS-WRITING-MODES-3]]
and must apply transformations [[!CSS-TRANSFORMS-1]].
If the edited text is laid out out on a path,
for instance by using the SVG <{textPath}> element,
UAs should also account for this.
The stacking position of the caret is left undefined, within the following constraints:
The caret must not be obscured by the background of the element
UAs must render ''caret-shape/block'' carets so that the
character it overlaps with is not obscured by the caret
This illustrates the typical appearance of the various caret shapes.
In each of the sample renderings below,
the insertion point is between the letters u and m.
'caret-shape'
Sample rendering
Your browser (focus each cell to see the caret)
''bar''
Lorem ipsum
Lorem Ipsum
''caret-shape/block''
Lorem ipsum
Lorem Ipsum
''underscore''
Lorem ispum
Lorem Ipsum
''caret-shape/underscore'' or ''caret-shape/block'' carets are commonly used
in terminals and command lines,
as in this example.
The simulated rendering below illustrates how this should look.
user@host:css-ui-4 $ ls -a
. .. Overview.bs Overview.html
user@host:css-ui-4 $
Focus the element below to see how your browser renders it.
user@host:css-ui-4 $ ls -a
. .. Overview.bs Overview.html
user@host:css-ui-4 $
Insertion caret shorthand: 'caret'
Name: caret
Value: <<'caret-color'>> || <<'caret-shape'>>
Initial: auto
Applies to: elements that accept input
Inherited: yes
Percentages: N/A
Media: interactive
Computed value: See individual properties
Animatable: See individual properties
This property is a shorthand for setting
'caret-color' and 'caret-shape' in one declaration.
Omitted values are set to their initial values.
Keyboard control
Directional Focus Navigation: the 'nav-up', 'nav-right', 'nav-down', 'nav-left' properties
Issue: Add final level 3 content
Obsolete: the ime-mode property
Issue: Add final level 3 content
User Interaction
Controlling content selection
The 'user-select' property enables authors to specify
which elements in the document can be selected by the user and how.
This allows for easier interactions when not
all elements are equally useful to select,
avoiding accidental selections of neighbouring content.
Name: user-select
Value: auto | text | none | contain | all
Initial: auto
Inherited: no
Applies to: all elements, and optionally to the ''::before'' and ''::after'' pseudo elements
Media: interactive
Computed value: See below
User Agents must not apply the 'user-select' property to
the ''::first-line'' and ''::first-letter'' pseudo elements.
Note: The UA may apply this property to the ''::before'' and ''::after'' pseudo elements.
If it does, ''user-select/auto'' value computes to ''user-select/none'' on these pseudos,
but other values can be specified.
This preserves the legacy behavior of generated content not being selectable or copyable,
which is appropriate when these pseudos are used for decorative purposes.
However, this property allows them to become selectable and copyable,
as the user would expect in cases where they are used to generate part of the content,
such as the issue numbers in this document.
To the extent possible,
authors should avoid using generated content
for non decorative purposes,
and should prefer including all the content in the DOM.This feature is at risk.
Issue: if we allow user-select to change to a value other than ''user-select/none'',
we need to figure out what this means for copyability, and DOM APIs.
When generated content in pseudo elements becomes selectable
through this mechanism,
UAs should also make this content findable through their search function.
Issue: Should it also apply to ''::marker''? To page-margin boxes?
Should the computed value of '''user-select/auto'' also be ''user-select/none'',
or would ''user-select/text'' be more appropriate?
The computed value is the specified value,
except:
on editable elements
where the computed value is always ''user-select/contain''
regardless of the specified value
when the specified value is ''user-select/auto'',
which computes one of the other values as defined below
For the purpose of this specification,
an editable element is either
an editing host
or a mutable form control with textual content,
such as <{textarea}>.
Issue: Should there be constraints
on what happens to the computed value
on elements that are editable descendants of editing hosts?
The semantics are not obvious.
Maybe ''user-select/none'' should compute to ''text'',
or maybe all values should compute to ''text''.
auto
The computed value of ''user-select/auto'' is determined as follows:
On the ''::before'' and ''::after'' pseudo elements,
the computed value is ''user-select/none''
If the element is an editable element,
the computed value is ''user-select/contain''
Otherwise,
if the computed value of 'user-select' on the parent of this element is ''all'',
the computed value is ''all''
Otherwise,
if the computed value of 'user-select' on the parent of this element is ''user-select/none'',
the computed value is ''user-select/none''
Otherwise, the computed value is ''text''
Note: This unusual combination of a non inherited property with an initial value of ''user-select/auto''
whose computed value depends on the parent element
makes it possible to create what is effectively selective inheritance.
This was initially proposed by Microsoft in IE to introduce a behavior similar to inheritance
except that the ''user-select/contain'' value does not inherit.
text
The element imposes no constraint on the selection.
none
The UA must not allow selections to be started in this element.
A selection started outside of this element must not end in this element.
If the user attempts to create such a selection,
the UA must instead end the selection range at the element boundary.
Note: As of the time of writing, experimental implementations do not all behave like this.
Firefox does.
Chrome and Safari almost do: for a selection started after the element
and trying to go backwards into the element
they behave as specified here,
but for a selection started before the element
and trying to go into the element
they behave as if the element has ''all'' and select it entirely.
IE does not restrict selections started outside of the element
from going into it at all.
Another difference is that in Chrome and Safari,
if the user attempts to start a selection inside a ''user-select: none'',
and to end the selection out of it,
a selection will be created from the boundary of the element
to the user-designated end-point.
Firefox and Internet explorer behave as prescribed in this specification
and do not create a selection at all.
However, if this element has descendants on which the computed value of 'user-select' is not ''user-select/none'',
selections that start and end within these descendants are allowed.
The UA must allow selections to extend across this element,
and must exclude this element from such a selection.
An exception is made for UAs which do not support multiple ranges per selection,
and they may include this element.
If the element has descendants on which 'user-select' does not compute to ''user-select/none'',
these descendants must be included in a selection extending across the element.
This specification makes no normative requirement
about the behavior of the clipboard.
however, UAs are encouraged to keep the visual selection consistent
with what would get copied to the clipboard when copying.
Copying text that does not appear to be selected, or vice versa,
is highligh confusing to users.
Attempting to start a selection in an element where 'user-select' is ''user-select/none'',
such as by clicking in it or starting a drag in it,
must not cause a pre-existing selection to become unselected or to be affected in any way.
As 'user-select' is a UI convenience mechanism,
not a copy protection mechanism,
the UA may provide an alternative way for the user
to explicitly select the text even when 'user-select' is ''user-select/none''.
Note: ''user-select/none'' is not a copy protection mechanism,
and using it as such is ineffective:
User Agents are allowed to provide ways to bypass it,
it will have no effect on legacy User Agents that do not support it,
and the user can disable it through the user style sheet or equivalent mechanisms
on UAs that do anyway.
Instead, ''user-select/none'' is meant to
make it easier for the user to select the content they want,
by letting the author disable selection on UI elements
that are not useful to select.
Tools such as CSS validators, linters or in-browser developer tools
are encouraged to use heuristics
to detect and warn against incorrect or abusive usage
that would hamper usability
or violate common user expectations.
contain
UAs must not allow a selection which is started in this element
to be extended outside of this element.
A selection started outside of this element must not end in this element.
If the user attempts to create such a selection,
the UA must instead end the selection range at the element boundary.
The UA must allow selections to extend across this element,
and such selections must include the content of the element.
Note: At the time of writing, experimental implementations behave differently from eachother
about selections started outside and selections going into the element.
The behavior can be observed even on browsers that do not explicitly support ''user-select/contain''
by trying to select into a <{textarea}> or a contenteditable element.
Note: This was initially introduced
as an experimental feature in Internet Explorer,
under the name user-select: element.
all
The content of the element must be selected atomically:
If a selection would contain part of the element,
then the selection must contain the entire element including all its descendants.
If the element is selected
and the computed value of 'user-select' on its parent is ''all'',
then the parent must be included in the selection, recursively.
If this element has descendants on which the computed value of 'user-select' is not ''all''
and if a selection is entirely contained in these descendants,
then the selection is not extended to include this whole element.
Note: Selections can include more than just text and extend over images, tables, videos, etc.
The behavior when copying and pasting a such selections is out of scope for this specification.
The following additions are made to the UA stylesheet for HTML:
Issue: the list above is incomplete, and needs to include
at least the various button-like variants of <{input}>.
For compatibility with legacy content,
UAs that support 'user-select' must also support ''-webkit-user-select'' as an alias.
Note: The details of the aliasing aliasing mechanism is intentionally left up to the UA.
Making ''-webkit-user-select'' a shorthand property of 'user-select'
is known to be an effective approach,
and new implementers should consider it.
However UAs supporting ''-webkit-user-select'' as an alias of 'user-select' through other means exist,
without adverse consequences to compatibility,
so this specification allows flexibility.
Form Control Styling
Switching appearance
While the way most elements in a document look can be fully controlled by CSS,
form controls are typically rendered by UAs using native UI controls of the host operating system,
which can neither be replicated nor styled using CSS.
This specification introduces the 'appearance' property
to provide some control over this behavior.
Using ''appearance: none'' allows authors
to suppress the native style of form controls,
so that CSS can be used to fully restyle them.
Name: appearance
Value: auto | none
Initial: auto
Applies To: all elements
Inherited: no
Computed value: As specified
Media: all
Issue: Should ''appearance/auto'' compute to ''appearance/none'' on regular elements?
I would say no:
If we did that,
to be consistent,
every time we introduced a new value,
we would change what ''appearance/auto'' computes to on some elements,
which doesn't sounds desirable.
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.
Instead, this specification only provides
''appearance/auto'', ''appearance/none''.
UAs cannot therefore use the 'appearance' property
in the UA stylesheet to give each control its native look and feel,
and must use ''appearance: auto'' instead.
Authors desiring to make certain elements in their document
look and behave like native form controls
should use the correct element in the markup language of the document
rather than attempt to use this property or its experimental variants.
Future version of this specification may add a few more values
for commonly desired appearances
if compability with content written for experimental implementations proves problematic.
So far, experience indicates that this is not the case.
Even if this were to happen,
it is not anticipated that the property would grow to cover all possible controls and sub-controls.
auto
UAs may render form controls using native controls of the host operating system
or with a look and feel not otherwise expressible in CSS.
Elements other than form controls must be rendered as if ''appearance/none'' had been specified.
none
The element is rendered following the usual rules of CSS.
Replaced elements other than form controls are not affected by this,
and remain replaced elements.
Form controls are not made to look like native controls of the host operating system.
See below for details.
Issue: Shouldn't this be called "normal" instead?
''appearance/none'' makes it sound like the targeted element will disappear.
On form control elements where the computed value is ''appearance/auto''
UAs may disregard some CSS properties
to ensure that the intended appearance is preserved,
or because these properties may not be meaningful for the chosen appearance.
However, the following properties must not be disregarded:
'appearance'
'display'
'visibility'
'position'
'top'
'right'
'bottom'
'left'
'float'
'clear'
'margin' and related long-hand properties
'unicode-bidi'
'direction'
'all' This does not imply a requirement to apply all the properties reset by 'all'
'cursor'
'z-index'
Issue: Are there more properties should include in this list?
Should we remove some?
Should whitelist the properties that are ok to ignore instead of
blacklisting those that are not?
Either way, UAs do ignore some properties when rendering form controls,
so this specification needs to say something about this.
All decorative visual aspects of a form control which are not caused by a CSS style rule
must be suppressed when the appearance is changed using 'appearance',
even if the UA's internal representation for this element
was composed of multiple elements or pseudo elements combined together.
For example, <{select}> is often rendered with an arrow on the right side
indicating that the list will be expanded if the element is clicked.
If the computed value of 'appearance' is ''appearance/none'', this
must disappear.
However, the UA must preserve aspects of the form control
which are necessary to operate the control with its original semantics.
This does not include aspects of a control which are merely needed to observe the state the control is in,
only those that are needed for the user to be able to modify the state of the control.
The UA may however give them a different look and feel
as long as it remains possible to operate the control.
For example,
the slider of an <input type=range> is preserved
(or replaced by an equivalent mechanism)
even if 'appearance' is ''appearance/none''
as it would otherwise not be possible to change the value of the range with the mouse or touchscreen.
On the other hand,
the check mark in an <input type=checkbox checked>
must be suppressed,
as it merely indicates the state the element is in,
which can be styled in different ways using the '':checked'' selector.
Issue: UAs are inconsistent about the preceding two paragraphs.
What is specified here attempts to give some logic
to what is preserved and what is not,
based on the use-cases for 'appearance'.
UAs should include in their User Agent stylesheet style rules
to give form controls a recognizable shape when 'appearance' is ''appearance/none''.
Note: Authors may therefore need to override these UA style rules to get the styling
they intended, possibly by using ''all: unset''.
Issue: This usage of the 'all' property would remove focus indicators
created by the 'outline' property,
which seems undesirable.
Using ''all: revert'' would not solve it, as it would fail to remove
the UA styles as intended.
How can we mitigate this?
The behavior and semantics of elements remain defined by the host language,
and are not influenced by this property.
For example, regardless of the computed value of 'appearance':
Elements which can be in different states keep this ability,
and the relevant pseudo-classes match as usual.
If a <{select}> element is activated,
the UI to choose one of the associated <{option}> elements is shown
(although it may look different).
Event handlers attached to the element trigger as usual.
Conversely, changing the appearance of an element must not cause it
to acquire new semantics, pseudo classes, event handlers, etc
that it did not initially have.
The ability for an element to be focused
is also not changed by the 'appearance' property.
An author wanting to customize the look and feel of check boxes in HTML could use the following:
<input type="checkbox"> would be rendered as
,
while <input type="checkbox" checked> would be rendered as
,
and activating (for example by clicking) the element would toggle the state as usual.
Appendix A. Acknowledgments
This appendix is informative.
This specification builds upon [[CSS3-UI]],
which was edited and written for the most part
by Tantek Çelik from 1999 to the present,
first while representing Microsoft, then as an Invited Expert,
and most recently while representing Mozilla.
Thanks to feedback and contributions from
Rossen Atanassov,
Tab Atkins,
L. David Baron,
Bert Bos,
Matthew Brealey,
Rick Byers,
Ada Chan,
James Craig,
Michael Cooper,
Axel Dahmen,
Michael Day,
Micah Dubinko,
Elika E.,
Steve Falkenburg,
Andrew Fedoniouk,
Al Gilman,
Ian Hickson,
Bjoern Hoehrmann,
Alan Hogan,
David Hyatt,
Richard Ishida,
Sho Kuwamoto,
Yves Lafon,
Stuart Langridge,
Susan Lesch,
Peter Linss,
Kang-Hao Lu,
Masayuki Nakano,
Mats Palmgren,
Brad Pettit,
François Remy,
Andrey Rybka,
Simon Sapin,
Alexander Savenkov,
Sebastian Schnitzenbaumer,
Lea Verou,
Etan Wexler,
David Woolley,
Frank Yan,
Boris Zbarsky,
and
Domel.
Does this specification deal with personally-identifiable information?
No.
Does this specification deal with high-value data?
No.
Does this specification introduce new state for an origin that persists across browsing sessions?
No.
Does this specification expose persistent, cross-origin state to the web?
No.
Does this specification expose any other data to an origin that it doesn’t currently have access to?
No.
Does this specification enable new script execution/loading mechanisms?
No.
Does this specification allow an origin access to a user’s location?
No.
Does this specification allow an origin access to sensors on a user’s device?
Yes. The directional focus navigation properties indirectly allow access to the device's keyboard navigation input mechanism such as arrow keys.
Does this specification allow an origin access to aspects of a user’s local computing environment?
No.
Does this specification allow an origin access to other devices?
No.
Does this specification allow an origin some measure of control over a user agent’s native UI?
Yes. The 'cursor' and 'caret-*' properties enable the page to change the display of the cursor and text insertion caret of the user agent’s native UI. In addition the 'outline-style' property’s ''outline-style/auto'' value (and thus 'outline' shorthand) enable the page to potentially display a native focused element outline presentation around any element.
The 'appearance' property also allows author to turn off native styling and replace it with css based styling.
Does this specification expose temporary identifiers to the web?
No.
Does this specification distinguish between behavior in first-party and third-party contexts?
No.
How should this specification work in the context of a user agent’s "incognito" mode?
No differently.
Does this specification persist data to a user’s local device?
No.
Does this specification have a "Security Considerations" and "Privacy Considerations" section?
Yes.
Does this specification allow downgrading default security characteristics?
No.
Appendix D. Default style sheet additions for HTML