<!--
Coding style convention in this file:
* Use semantic line breaks (http://rhodesmill.org/brandon/2012/one-sentence-per-line/)
* Tabs for indentation, spaces for allignment (http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/)
* Use markdown paragraphs (empty lines between paragraphs) over <p> when practical
* two empty lines above <h*>, one below <h*>, one between <hn> and <hn+1>
* empty line between <ol>, <ul>, <table>, <div> and ajacent text
* Don't close <p>, <li>, <dd>, <dt>, <tr>, <th>, or <td>
* Indent the content and break line after the opening <li>, <dd>, <dt>, <td>, or <th> if it's more than 2 lines long
  or for lists where at least some elements are more than 2 lines long
* Empty line between adjacent <li>, <th>, <td>, <tr>, and between <dd> and the next <dt>;
  Can be skipped if all items are very short
* Indent the content of <ol>, <ul>, <dl>, <table>, <tr>
* Indent the content of <div class=note> and <div class=example>
-->

<pre class='metadata'>
Title: CSS Basic User Interface Module Level 4
ED: https://drafts.csswg.org/css-ui-4/
Status Text: This specification will include and extend <cite>CSS Basic User Interface Module Level&nbsp;3.</cite> [[CSS-UI-3]]
TR: https://www.w3.org/TR/css-ui-4/
Previous Version: https://www.w3.org/TR/2017/WD-css-ui-4-20171222/
Previous Version: https://www.w3.org/TR/2015/WD-css-ui-4-20150922/
Shortname: css-ui
Level: 4
Status: ED
Group: csswg
Work Status: Revising
Editor: Florian Rivoal, On behalf of Bloomberg, https://florian.rivoal.net/, w3cid 43241
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''
Can I Use URL: https://drafts.csswg.org/css-ui-3/
Can I Use URL: http://drafts.csswg.org/css-ui-3/
Can I Use URL: https://drafts.csswg.org/css-ui/
Can I Use URL: http://drafts.csswg.org/css-ui/
Can I Use URL: https://www.w3.org/TR/css-ui-3/
Can I Use URL: http://www.w3.org/TR/css-ui-3/
Can I Use URL: https://www.w3.org/TR/css3-ui/
Can I Use URL: http://www.w3.org/TR/css3-ui/
Can I Use URL: https://drafts.csswg.org/css-ui-4/
Can I Use URL: http://drafts.csswg.org/css-ui-4/
Can I Use URL: https://www.w3.org/TR/css-ui-4/
Can I Use URL: http://www.w3.org/TR/css-ui-4/
Ignore Can I Use URL Failure: https://drafts.csswg.org/css-ui-3/
Ignore Can I Use URL Failure: http://drafts.csswg.org/css-ui-3/
Ignore Can I Use URL Failure: https://drafts.csswg.org/css-ui/
Ignore Can I Use URL Failure: http://drafts.csswg.org/css-ui/
Ignore Can I Use URL Failure: https://www.w3.org/TR/css-ui-3/
Ignore Can I Use URL Failure: http://www.w3.org/TR/css-ui-3/
Ignore Can I Use URL Failure: https://www.w3.org/TR/css3-ui/
Ignore Can I Use URL Failure: http://www.w3.org/TR/css3-ui/
Ignore Can I Use URL Failure: https://drafts.csswg.org/css-ui-4/
Ignore Can I Use URL Failure: http://drafts.csswg.org/css-ui-4/
Ignore Can I Use URL Failure: https://www.w3.org/TR/css-ui-4/
Ignore Can I Use URL Failure: http://www.w3.org/TR/css-ui-4/
</pre>

<pre class=link-defaults>
spec:css-writing-modes-4; type:dfn; text:start
spec:css-writing-modes-4; type:dfn; text:end
spec:css2; type:property; text:min-width
spec:css2; type:property; text:max-width
spec:css2; type:property; text:min-height
spec:css2; type:property; text:max-height
spec:css2; type:property; text:bottom
spec:css2; type:property; text:top
spec:css2; type:property; text:right
spec:css2; type:property; text:visibility
spec:css2; type:property; text:z-index
spec:css-pseudo-4; type:selector; text:::before
spec:css-pseudo-4; type:selector; text:::after
spec:css-pseudo-4; type:selector; text:::first-line
spec:css-pseudo-4; type:selector; text:::first-letter
spec:selectors-4; type:selector; text::checked
spec:css-display-3; type:property; text:display
spec:css-color-4; type:value; text:currentcolor
spec:css-overflow-3; type:property; text:overflow
spec:css-sizing-3; type:property; text:box-sizing
spec:css-backgrounds-3; type:property; text:background-image
spec:css-backgrounds-3; type:property; text:border-width
spec:css-overflow-4; type:property; text:text-overflow
spec:selectors-4; type:selector; text::enabled
spec:selectors-4; type:selector; text::disabled
spec:css-color-4; type:property; text:color
</pre>

<style>
.awesome-table td {padding:5px}
.awesome-table {color:#000;background:#fff;margin: auto;}
</style>

<h2 id="intro">Introduction</h2>

This module describes CSS properties which enable authors
to style user interface related properties and values.

<a href="https://www.w3.org/TR/REC-CSS1#anchor-pseudo-classes">Section 2.1 of CSS1</a> [[CSS1]]
and <a href="https://www.w3.org/TR/CSS2/ui.html">Chapter 18 of CSS2</a> [[CSS21]]
introduced several user interface related properties and values.
<a href="https://www.w3.org/TR/2000/WD-css3-userint-20000216">User Interface for CSS3 (16 February 2000)</a> introduced several new user interface related features.

[[CSS-UI-3]] was later introduced to incorporate, extend, and supersede these.
This specification continues this work, and in turn replaces [[CSS-UI-3]].


<h3 id="purpose">Purpose</h3>

The purpose of this specification is to achieve the following objectives:

<ul>
	<li>Extend the user interface features in [[CSS21]] and [[CSS-UI-3]]

	<li>Provide additional CSS mechanisms to augment or replace other
	dynamic presentation related features in HTML.

	<li>Introduce directional navigation properties to assist in the construction of
	user interfaces which make use of a directional navigation model.
</ul>


<h2 id="interaction">Module Interactions</h2>

This document defines new features not present in earlier specifications.
In addition, it replaces and supersedes [[!CSS-UI-3]],
which itself replaced and superseded the following:

<ul>
	<li>
		<a href="https://www.w3.org/TR/CSS21/ui.html#cursor-props">Section 18.1</a>,
		<a href="https://www.w3.org/TR/CSS21/ui.html#dynamic-outlines">section 18.4</a>,
		and Information on the stacking of outlines defined in
		<a href="https://www.w3.org/TR/CSS21/zindex.html">Appendix E</a>
		of Cascading Style Sheets, level 2, revision 1 [[CSS21]]

	<li>
		<a href="https://www.w3.org/TR/2000/WD-css3-userint-20000216">User Interface for CSS3 (16 February 2000)</a> [[CSS-UI-3]]
</ul>

Note:
<span id="box-model"></span>
<span id="box-sizing"></span>
<span id="propdef-box-sizing"></span>
<span id="valdef-box-sizing-content-box"></span>
<span id="valdef-box-sizing-border-box"></span>
<span id="min-inner-width"></span>
<span id="max-inner-width"></span>
<span id="min-inner-height"></span>
<span id="max-inner-height"></span>
<span id="example-d824f1dc"></span>
<span id="box-sizing-example"></span>
The 'box-sizing' property was previously defined in this section of the specification,
but has been moved to [[CSS-SIZING-3#box-sizing]].

Note:
<span id="text-overflow" caniuse=text-overflow></span>
<span id="propdef-text-overflow"></span>
<span id="overflow-clip"></span>
<span id="overflow-ellipsis"></span>
<span id="overflow-string"></span>
<span id="funcdef-text-overflow-fade"></span>
<span id="issue-ebe65138"></span>
<span id="issue-2e22b1d9"></span>
<span id="issue-948cb1ee"></span>
<span id="valdef-text-overflow-fade"></span>
<span id="example-160d0058"></span>
<span id="bidi-ellipsis"></span>
<span id="ellipsing-details"></span>
<span id="ellipsis-interaction"></span>
<span id="example-44082941"></span>
<span id="text-overflow-examples"></span>
<span id="issue-4b5212a2"></span>
<span id="ellipsis-scrolling"></span>
<span id="example-45d2531f"></span>
<span id="example-347bbb66"></span>
The 'text-overflow' property was previously defined in this section of the specification,
but has been moved to [[CSS-OVERFLOW-3#text-overflow]].

<h2 id="outline-props" caniuse="outline">Outline properties</h2>

At times, style sheet authors may want to create outlines around
visual objects such as buttons, active form fields, image maps, etc.,
to make them stand out. Outlines differ from borders in the following
ways:

<ol>
	<li>Outlines do not take up space.

	<li>Outlines may be non-rectangular.

	<li>UAs often render outlines on elements in the :focus state.
</ol>

The outline properties control the style of these dynamic outlines.

The stacking of the rendering of these outlines is explicitly left up to implementations
to provide a better user experience per platform.
This supersedes the stacking of outlines as defined in <a href="https://www.w3.org/TR/CSS21/zindex.html">Appendix E of CSS 2.1</a> [[CSS21]].

<strong class="advisement">
	Keyboard users,
	 in particular people with disabilities
	 who may not be able to interact with the page in any other fashion,
	 depend on the outline being visible
	 on elements in the :focus state,
	 thus authors must not make the outline invisible on such elements
	 without making sure an alternative highlighting mechanism is provided.
</strong>

The rendering of applying transforms to outlines is left explicitly undefined in CSS3-UI.


<h3 id="outline">Outlines Shorthand: the 'outline' property</h3>

<pre class="propdef shorthand">
Name: outline
Value: [ <<'outline-color'>> || <<'outline-style'>> || <<'outline-width'>> ]
Applies to: all elements
Inherited: no
Percentages: N/A
</pre>


<h3 id="outline-width">Outline Thickness: the 'outline-width' property</h3>

<pre class="propdef">
Name: outline-width
Value: <<line-width>>
Initial: medium
Applies to: all elements
Inherited: no
Percentages: N/A
Computed value: absolute length; ''0'' if the outline style is ''border-style/none''.
Animation type: by computed value
</pre>


<h3 id="outline-style">Outline Patterns: the 'outline-style' property</h3>

<pre class="propdef">
Name: outline-style
Value: auto | <<outline-line-style>>
Initial: none
Applies to: all elements
Inherited: no
Percentages: N/A
Computed value: specified keyword
Animation type: by computed value
</pre>


<h3 id="outline-color">Outline Colors: the 'outline-color' property</h3>

<pre class="propdef">
Name: outline-color
Value: <<color>> | invert
Initial: invert
Applies to: all elements
Inherited: no
Percentages: N/A
Computed value: The computed value for ''outline-color/invert'' is ''outline-color/invert''.
 For <<color>> values, see [[!CSS-COLOR-4#resolving-color-values]] in [[!CSS-COLOR-4]].
Animation type: by computed value
</pre>

The outline created with the outline properties is drawn "over" a box,
i.e., the outline is always on top,
and doesn't influence the position or size of the box,
or of any other boxes.
Therefore, displaying or suppressing outlines does not cause reflow.

Outlines may be non-rectangular.
For example, if the element is broken across several lines,
the outline should be an outline or minimum set of outlines
that encloses all the element's boxes.

Each part of the outline should be fully connected
rather than open on some sides
(as borders on inline elements are when lines are broken).

The parts of the outline are not required to be rectangular.
To the extent that the outline follows the <a>border edge</a>,
it should follow the 'border-radius' curve.

The position of the outline may be affected by descendant boxes.

User agents should use an algorithm for determining
the outline that encloses a region appropriate
for conveying the concept of focus to the user.

Note: This specification does not define the exact position or shape of the outline, but it is typically drawn immediately outside the border box.


The 'outline-width' property accepts
the same values as 'border-width'
([[css-backgrounds-3#the-border-width]]).

<dfn><<outline-line-style>></dfn> accepts
the same values as <<line-style>>
([[css-backgrounds-3#the-border-style]])
with the same meaning,
except that
<span class=css>hidden</span> is not a legal outline style.
In addition,
the 'outline-style' property
accepts the value ''outline-style/auto''.
The ''outline-style/auto'' value permits the user agent
to render a custom outline style,
typically a style which is either a user interface default for the platform,
or perhaps a style that is richer
than can be described in detail in CSS,
e.g. a rounded edge outline with semi-translucent outer pixels
that appears to glow.
As such, this specification does not define how the
'outline-color'
is incorporated or used (if at all) when rendering
''outline-style/auto'' style outlines.
User agents may treat ''outline-style/auto'' as
''outline-style/solid''.

The 'outline-color' property
accepts all colors, as well as the keyword <dfn dfn-type=value dfn-for=outline-color>invert</dfn>.
''outline-color/invert'' is expected to perform a color inversion on the pixels on the screen.
This is a common trick to ensure the focus border is visible,
regardless of color background.

Conformant UAs may ignore the ''outline-color/invert'' value
on platforms that do not support color inversion of the pixels on the screen.

If the UA does not support the ''outline-color/invert'' value
then it must reject that value at parse-time, and
the initial value of the 'outline-color' property
is the ''color/currentColor'' keyword.

The 'outline' property is a shorthand property,
and sets all three of 'outline-style',
'outline-width',
and 'outline-color'.

Note: The outline is the same on all sides.
In contrast to borders,
there are no ''outline-top'' or ''outline-left'' etc. properties.

This specification does not define how multiple overlapping outlines are drawn,
or how outlines are drawn for boxes that are partially obscured behind other elements.

<div class="example">
	Here's an example of drawing a thick outline around a BUTTON element:
	<pre><code class="lang-css">
	button { outline: thick solid }
	</code></pre>
</div>

Graphical user interfaces may use outlines around elements
to tell the user which element on the page has the focus.
These outlines are in addition to any borders,
and switching outlines on and off should not cause the document to reflow.
The focus is the subject of user interaction in a document
(e.g. for entering text or selecting a button).

<div class="example">
	For example, to draw a thick black line around an element when it has the focus,
	and a thick red line when it is active,
	the following rules can be used:
	<pre><code class="lang-css">
	:focus  { outline: thick solid black }
	:active { outline: thick solid red }
	</code></pre>
</div>

Note: Since the outline does not affect formatting
(i.e., no space is left for it in the box model),
it may well overlap other elements on the page.


<h3 id="outline-offset">Offsetting the Outline: the 'outline-offset' property</h3>

By default, the outline is drawn starting just outside the <a>border edge</a>.
However, it is possible to offset the outline and draw it beyond the <a>border edge</a>.

<pre class="propdef">
Name: outline-offset
Value: <<length>>
Initial: 0
Applies to: all elements
Inherited: no
Percentages: N/A
Computed value: absolute length
Animation Type: by computed value
</pre>

If the computed value of 'outline-offset'
is anything other than 0,
then the outline is outset from the <a>border edge</a> by that amount.

<div class="example">
	For example,
	to leave 2 pixels of space between a focus outline
	and the element that has the focus or is active,
	the following rule can be used:
	<pre><code class="lang-css">
	:focus,:active  { outline-offset: 2px }
	</code></pre>
</div>

<p id=negative-offset>Negative values must cause the outline
to shrink into the border box.
Both the height and the width of outside of the shape
drawn by the outline should not become smaller
than twice the computed value of the 'outline-width' property,
to make sure that an outline can be rendered
even with large negative values.
User Agents should apply this constraint
independently in each dimension.
If the outline is drawn as multiple disconnected shapes,
this constraint applies to each shape separately.


<h2 id="resizing">
<!--maintaining old anchors back from when text-overflow was defined here--><span id="resizing-and-overflow"></span>
Resizing</h2>


CSS2.1 provides a mechanism for controlling the appearance of a scrolling mechanism
(e.g. scrollbars)
on block container elements.
This specification adds to that a mechanism for controlling
user resizability of elements as well as the ability to specify text overflow behavior.


<h3 id="resize" caniuse="css-resize">Resizing Boxes: the 'resize' property</h3>

The 'resize' property allows the author
to specify whether or not an element is resizable by the user,
and if so, along which axis/axes.

<pre class="propdef">
Name: resize
Value: none | both | horizontal | vertical
Initial: none
Applies to: elements with 'overflow' other than visible,
 and optionally replaced elements such as images, videos, and iframes
Inherited: no
Percentages: N/A
Computed value: specified keyword
Animation type: discrete
</pre>

<dl>
	<dt>none
	<dd>The UA does not present a resizing mechanism on the element,
	and the user is given no direct manipulation mechanism to resize the element.

	<dt>both
	<dd>The UA presents a bidirectional resizing mechanism
	to allow the user to adjust both the height and the width of the element.

	<dt>horizontal
	<dd>The UA presents a unidirectional horizontal resizing mechanism
	to allow the user to adjust only the width of the element.

	<dt>vertical
	<dd>The UA presents a unidirectional vertical resizing mechanism
	to allow the user to adjust only the height of the element.
</dl>

Currently it is possible to control the appearance of the scrolling mechanism (if any)
on an element using the 'overflow' property
(e.g. <code class="lang-css">overflow: scroll</code> vs. <code class="lang-css">overflow: hidden</code> etc.).
The purpose of the 'resize' property
is to allow control over the appearance and function of the resizing mechanism
(e.g. a resize box or widget) on the element.

Note: The resizing mechanism is NOT the same as the scrolling mechanism,
nor is it related to any UA mechanism for zooming.
The scrolling mechanism allows the user
to determine which portion of the contents of an element is shown.
The resizing mechanism allows the user
to determine the size of the element.

The 'resize' property applies to elements
whose computed 'overflow' value
is something other than ''visible''.
UAs may also apply it,
regardless of the value of the 'overflow' property,
to:

<ul>
	<li>Replaced elements representing images or videos, such as <{img}>, <{video}>, <{picture}>, <{svg}>, <{object}>, or <{canvas}>.

	<li>The <{iframe}> element.
</ul>


The effect of the 'resize' property on generated content is undefined.
Implementations should not apply the 'resize' property to generated content.

Note: the 'resize' property may apply to generated content in the future
if there is implementation of <a href="https://drafts.csswg.org/css-pseudo/#CSSPseudoElement-interface">Interface CSSPseudoElement</a>.

When an element is resized by the user,
the user agent sets
the 'width' and 'height' properties
to px unit length values of the size indicated by the user,
in the element’s <a href="https://www.w3.org/TR/css-style-attr/#style-attribute">style attribute</a> DOM,
replacing existing property declaration(s), if any,
without ''!important'', if any.

If an element is resized in only one dimension,
only the corresponding property is set, not both.

The precise direction of resizing
(i.e. altering the top left of the element or altering the bottom right)
may depend on a number of CSS layout factors
including whether the element is absolutely positioned,
whether it is positioned using the 'right'
and 'bottom' properties,
whether the language of the element is right-to-left etc.
The UA should consider the direction of resizing
(as determined by CSS layout),
as well as platform conventions and constraints when deciding
how to convey the resizing mechanism to the user.

The user agent must allow the user to resize the element
with no other constraints than what is imposed by
'min-width', 'max-width', 'min-height', and 'max-height'.

Note: There may be situations where user attempts to resize an element
appear to be overriden or ignored, e.g. because of ''!important'' cascading declarations that supersede
that element’s <a href="https://www.w3.org/TR/css-style-attr/#style-attribute">style attribute</a>
'width' and 'height' properties in the DOM.

Changes to the computed value of an element's 'resize' property
do not reset changes to the <a href="https://www.w3.org/TR/css-style-attr/#style-attribute">style attribute</a> made due to
user resizing of that element.

<div class="example">
	For example,
	to make iframes scrollable <em>and</em> resizable,
	the following rule can be used:
	<pre><code class="lang-css">
	iframe,object[type^="text/"],
	object[type$="+xml"],object[type="application/xml"]
	{
	  overflow:auto;
	  resize:both;
	}
	</code></pre>
</div>


<h2 id="pointing-keyboard">Pointing Devices and Keyboards</h2>

<h3 id="pointer-interaction">Pointer interaction</h3>

<h4 id="cursor" caniuse="css3-cursors">Styling the Cursor: the 'cursor' property</h4>

<pre class="propdef">
Name: cursor
Value: [ [<<url>> [&lt;x&gt; &lt;y&gt;]?,]* <br>
 [ auto | default | none |<br>
 context-menu | help | pointer | progress | wait | <br>
 cell | crosshair | text | vertical-text | <br>
 alias | copy | move | no-drop | not-allowed | grab | grabbing | <br>
 e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize |
 ew-resize | ns-resize | nesw-resize | nwse-resize |
 col-resize | row-resize |
 all-scroll |<br>
 zoom-in | zoom-out <br>
 ] ]
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Computed value: as specified, except with any relative URLs converted to absolute
Animation type: discrete
</pre>

This property specifies the type of cursor to be displayed for the pointing device
when the cursor's hotspot is within the element's <a>border edge</a>.

Note: As per [[css-backgrounds-3#the-border-radius]], the <a>border edge</a> is affected by 'border-radius'.

In the case of overlapping elements,
which element determines the type of cursor
is based on hit testing:
the element determining the cursor
is the one that would receive a click
initiated from this position.

Note: The specifics of hit testing
are out of scope of this specification.
Hit testing will hopefully be defined
in a future revision of CSS or HTML.

User agents may ignore the cursor property over native user-agent controls such as scrollbars, resizers, or other native UI widgets e.g. those that may be used inside some user agent specific implementations of form elements.
User agents may also ignore the cursor property
and display a cursor of their choice
to indicate various states of the UA's user interface,
such as a busy cursor when the page is not responding,
or a text cursor when the user is performing text selection.

Note: [[HTML]] defines <a href="https://html.spec.whatwg.org/multipage/rendering.html#image-maps-2">special handling of image maps</a>
for the 'cursor' property.

Values have the following meanings:

<style>
#cursors dfn { cursor: inherit }
</style>
<dl dfn-type=value dfn-for=cursor id=cursors>
	<dt>image cursors
	<dd>
	<dl>
		<dt><<url>>
		<dd>
			The user agent retrieves the cursor from the resource designated by the URI.
			If the user agent cannot handle the first cursor of a list of cursors,
			it must attempt to handle the second, etc.
			If the user agent cannot handle any user-defined cursor,
			it must use the cursor keyword at the end of the list.
			Conforming User Agents may, instead of <<url>>, support <<image>> which is a superset.

			The UA must support the following image file formats:

			<ul>
				<li>
					PNG, as defined in [[!PNG]]

				<li>
					SVG, as defined in [[!SVG11]],
					in <a href="https://www.w3.org/TR/SVG2/conform.html#secure-static-mode">secure static mode</a> [[!SVG2]],
					if it has an intrinsic size.

				<li>
					any other non-animated image file format that they support
					for <<image>> in other properties,
					such as the the 'background-image' property
			</ul>

			In addition, the UA should support the following image file formats:

			<ul>
				<li>
					SVG, as defined in [[!SVG11]],
					in <a href="https://www.w3.org/TR/SVG2/conform.html#secure-animated-mode">secure animated mode</a> [[!SVG2]],
					if it has an intrinsic size.

				<li>
					any other animated image file format that they support
					for <<image>> in other properties,
					such as the the 'background-image' property
			</ul>

			The UA may also support additional file formats,
			including SVG, as defined in [[!SVG11]],
			in secure static mode or secure animated mode [[!SVG2]],
			even if it does not have an intrinsic size.

			Note: The CSS Working group initially intended support for all SVG,
			intrinsically sized or not.
			Support for non intrinsically sized SVG was downgraded from mandatory to optional due
			to lack of implementations.

			Note: At the time of writing this specification (spring 2015),
			the only file formats supported for cursors in common desktop browsers are
			the .ico and .cur file formats, as designed by Microsoft.
			For compatibility with legacy content,
			UAs are encouraged to support these,
			even though the lack of an open specification
			makes it impossible to have a normative requirement
			about these formats.
			Some information on these formats can be found
			<a href="https://en.wikipedia.org/wiki/ICO_%28file_format%29">on Wikipedia</a>.

			The <a>default object size</a> for cursor images is
			a UA-defined size that should be based on
			the size of a typical cursor on the UA's operating system.

			The <a>concrete object size</a> is determined using
			the <a>default sizing algorithm</a>.
			If an operating system is
			<strong>incapable</strong> of rendering a cursor above a given size,
			cursors larger than that size must be shrunk to within
			the OS-supported size bounds,
			while maintaining the cursor image's intrinsic ratio, if any.

			The optional &lt;x&gt; and &lt;y&gt; coordinates
			identify the exact position within the image which is the pointer position (i.e., the hotspot).

		<dt>&lt;x&gt;
		<dt>&lt;y&gt;
		<dd>
			Each is a <<number>>.
			The x-coordinate and y-coordinate of the position
			in the cursor's coordinate system (left/top relative)
			which represents the precise position that is being pointed to.

			Note: This specification does not define
			how the coordinate systems of the various types of <<image>> are established,
			and defers these definitions to [[CSS4-IMAGES]].

			If the values are unspecified,
			then the intrinsic hotspot defined inside the image resource itself is used.
			If both the values are unspecific and the referenced cursor has no defined hotspot,
			the effect is as if a value of "0 0" were specified.

			If the coordinates of the hotspot,
			as specified either inside the image resource or
			by &lt;x&gt; and &lt;y&gt; values,
			fall outside of the cursor image,
			they must be clamped (independently) to fit.
	</dl>

	<dt>general purpose cursors
	<dd>
	<dl>
		<dt style="cursor:auto"><dfn>auto</dfn>
		<dd>
			The UA determines the cursor to display based on the current context.
			Specifically, ''cursor/auto'' behaves as ''cursor/text'' over selectable text or editable elements,
			and ''cursor/default'' otherwise.

			Note: When over selectable text or editable elements,
			as it does with ''cursor/text'',
			the UA must use a vertical or horizontal text cursor,
			as appropriate for the [=writing mode=] of the element,
			and may take transforms and other visual effects into account as well.

		<dt style="cursor:default"><dfn>default</dfn>
		<dd>The platform-dependent default cursor.
		Often rendered as an arrow.

		<dt style="cursor:none"><dfn>none</dfn>
		<dd>No cursor is rendered for the element.
	</dl>

	<dt>links and status cursors
	<dd>
	<dl>
		<dt style="cursor:context-menu"><dfn>context-menu</dfn>
		<dd>A context menu is available for the object under the cursor.
		Often rendered as an arrow with a small menu-like graphic next to it.

		<dt style="cursor:help"><dfn>help</dfn>
		<dd>Help is available for the object under the cursor.
		Often rendered as a question mark or a balloon.

		<dt style="cursor:pointer"><dfn>pointer</dfn>
		<dd>The cursor is a pointer that indicates a link.
		Often rendered as the backside of a hand with the index finger extended.

		Unless otherwise specified,
		UAs must apply ''cursor: pointer'' to hyperlinks
		for all supported document formats
		via the <a lt="User Agent Origin">UA stylesheet</a>,
		using a normal (i.e. not <a>!important</a>) declaration.

		Authors should use pointer on links and may use on other interactive elements.

		<dt style="cursor:progress"><dfn>progress</dfn>
		<dd>
			A progress indicator.  The program is performing some processing,
			but is different from ''wait'' in that the user may still interact
			with the program. Often rendered as a spinning beach ball,
			or an arrow with a watch or hourglass.

		<dt style="cursor:wait"><dfn>wait</dfn>
		<dd>Indicates that the program is busy and the user should wait.
		Often rendered as a watch or hourglass.
	</dl>

	<dt>selection cursors
	<dd>
	<dl>
		<dt style="cursor:cell"><dfn>cell</dfn>
		<dd>Indicates that a cell or set of cells may be selected.
		Often rendered as a thick plus-sign with a dot in the middle.

		<dt style="cursor:crosshair"><dfn>crosshair</dfn>
		<dd>A simple crosshair (e.g., short line segments resembling a "+" sign).
		Often used to indicate a two dimensional bitmap selection mode.

		<dt style="cursor:text"><dfn>text</dfn>
		<dd>
			Indicates text that may be selected. Often rendered as an I-beam.
			User Agents must automatically display
			a vertical I-beam/cursor over elements with a horizontal [=writing mode=],
			and a horizontal I-beam/cursor
			(e.g. same as the ''vertical-text'' keyword)
			over elements in a vertical [=writing mode=].
			Additionally, User Agents may take transforms (see [[CSS-TRANSFORMS-1]])
			or other visual effects such as text on a path (See [[SVG2/text#TextLayoutPath]]),
			when chosing between the horizontal or vertical text cursor,
			and may display any angle of I-beam/cursor for text that is rendered at any particular angle.

		<dt style="cursor:vertical-text"><dfn>vertical-text</dfn>
		<dd>Indicates vertical-text that may be selected.
		Often rendered as a horizontal I-beam.
	</dl>

	<dt>drag and drop cursors
	<dd>
	<dl>
		<dt style="cursor:alias"><dfn>alias</dfn>
		<dd>Indicates an alias of/shortcut to something is to be created.
		Often rendered as an arrow with a small curved arrow next to it.

		<dt style="cursor:copy"><dfn>copy</dfn>
		<dd>Indicates something is to be copied.
		Often rendered as an arrow with a small plus sign next to it.

		<dt style="cursor:move"><dfn>move</dfn>
		<dd>Indicates something is to be moved.

		<dt style="cursor:no-drop"><dfn>no-drop</dfn>
		<dd>Indicates that the dragged item cannot be dropped at the current cursor location.
		Often rendered as a hand or pointer with a small circle with a line through it.

		<dt style="cursor:not-allowed"><dfn>not-allowed</dfn>
		<dd>Indicates that the requested action will not be carried out.
		Often rendered as a circle with a line through it.

		<dt caniuse="css3-cursors-grab" id=cursor-grab style="cursor:grab"><dfn>grab</dfn>
		<dd>Indicates that something can be grabbed (dragged to be moved).
		Often rendered as the backside of an open hand.

		<dt style="cursor:grabbing"><dfn>grabbing</dfn>
		<dd>Indicates that something is being grabbed (dragged to be moved).
		Often rendered as the backside of a hand with fingers closed mostly out of view.
	</dl>

	<dt>resizing and scrolling cursors
	<dd>
	<dl>
		<dt>
			<span style="cursor:e-resize"><dfn>e-resize</dfn></span>,
			<span style="cursor:n-resize"><dfn>n-resize</dfn></span>,
			<span style="cursor:ne-resize"><dfn>ne-resize</dfn></span>,
			<span style="cursor:nw-resize"><dfn>nw-resize</dfn></span>,
			<span style="cursor:s-resize"><dfn>s-resize</dfn></span>,
			<span style="cursor:se-resize"><dfn>se-resize</dfn></span>,
			<span style="cursor:sw-resize"><dfn>sw-resize</dfn></span>,
			<span style="cursor:w-resize"><dfn>w-resize</dfn></span>
		<dd>
			Indicates that some edge is to be moved.
			For example, the ''se-resize'' cursor is used
			when the movement starts from the south-east corner of the box.

		<dt>
			<span style="cursor:ew-resize"><dfn>ew-resize</dfn></span>,
			<span style="cursor:ns-resize"><dfn>ns-resize</dfn></span>,
			<span style="cursor:nesw-resize"><dfn>nesw-resize</dfn></span>,
			<span style="cursor:nwse-resize"><dfn>nwse-resize</dfn></span>
		<dd>Indicates a bidirectional resize cursor.

		<dt style="cursor:col-resize"><dfn>col-resize</dfn>
		<dd>Indicates that the item/column can be resized horizontally.
		Often rendered as arrows pointing left and right with a vertical bar separating them.

		<dt style="cursor:row-resize"><dfn>row-resize</dfn>
		<dd>Indicates that the item/row can be resized vertically.
		Often rendered as arrows pointing up and down with a horizontal bar separating them.

		<dt style="cursor:all-scroll"><dfn>all-scroll</dfn>
		<dd>Indicates that the something can be scrolled in any direction.
		Often rendered as arrows pointing up, down, left, and right with a dot in the middle.
	</dl>

	<dt caniuse="css3-cursors-newer" id="zooming-cursors">zooming cursors
	<dd>
	<dl>
		<dt>
			<span style="cursor:zoom-in"> <dfn>zoom-in</dfn></span>,
			<span style="cursor:zoom-out"> <dfn>zoom-out</dfn></span>
		<dd>
			Indicates that something can be zoomed (magnified) in or out,
			and often rendered as a magnifying glass with a "+" or "-" in the center of the glass,
			for ''zoom-in'' and ''zoom-out'' respectively.
	</dl>
</dl>

<div class="example">
	Here is an example of using several cursor values.
	<pre><code class="lang-css">
	:link,:visited {
	    cursor: url(example.svg#linkcursor),
		    url(hyper.cur),
		    url(hyper.png) 2 3,
		    pointer
	}
	</code></pre>

	This example sets the cursor on all hyperlinks (whether visited or not)
	to an external SVG <{cursor}>.
	User agents that don't support SVG cursors would simply skip
	to the next value and attempt to use the "hyper.cur" cursor.
	If that cursor format was also not supported,
	the UA could attempt to use the "hyper.png" cursor with the explicit hotspot.
	Finally if the UA does not support any of those image cursor formats, the UA would skip to the last value
	and render the ''pointer'' cursor.
</div>

<h5 id="canvas_cursor">Cursor of the canvas</h5>

The document <a href="https://www.w3.org/TR/CSS21/intro.html#the-canvas">canvas</a>
is the infinite surface over which the document is rendered [[!CSS21]].
Since no element corresponds to the canvas,
in order to allow styling of the cursor when not over any element,
the canvas cursor re-uses the root element's cursor.
However, if no boxes are generated for the root element
(for example, if the root element has ''display: none''),
then the canvas cursor is the platform-dependent default cursor.

Note: An element might be invisible,
but still generate boxes. For example,
if the element has ''visibility: hidden'' but not ''display: none'',
boxes are generated for it and its cursor is used for the canvas.


<h3 id="insertion-caret">Insertion caret</h3>

<h4 id="caret-color" caniuse="css-caret-color">Coloring the Insertion Caret: the 'caret-color' property</h4>

<pre class="propdef">
Name: caret-color
Value: auto | <<color>>
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Computed value: The computed value for ''caret-color/auto'' is ''caret-color/auto''.
 For <<color>> values, see [[!CSS-COLOR-4#resolving-color-values]] in [[!CSS-COLOR-4]].
Animation Type: by computed value
</pre>

<dl>
	<dt>auto
	<dd>
		User agents should use ''currentColor''.
		User agents may automatically adjust the color of caret
		to ensure good visibility and contrast with the surrounding content,
		possibly based on the currentColor, background, shadows, etc.

		Note: When 'caret-shape' is ''caret-shape/block'',
		ensuring good visibility and contrast
		is best achieved with a UA determined color other than ''currentColor''.

	<dt><<color>>
	<dd>The insertion caret is colored with the specified color.
</dl>

The caret is a visible indicator of the insertion point in an element where text (and potentially other content) is inserted by the user. This property controls the color of that visible indicator.

Note: UAs might have additional things that count as “carets”.
For example, some UAs can show a “navigation caret”,
which acts similarly to an insertion caret
but can be moved around in non-editable text,
and is functionally a caret.
On the other hand, the cursor image shown
when hovering over text when the 'cursor' property is ''cursor/auto'',
or when hovering over an element where the 'cursor' property is ''cursor/text'' or ''cursor/vertical-text'',
though it sometimes resembles a caret, is not a caret (it's a cursor).

<div class="example">
	Example: a textarea with
	<code class="lang-css">caret-color:#00aacc;</code>

	<textarea style="caret-color:#00aacc;">
	caret-color:#00aacc
	</textarea>
</div>


<!--
<h4 id="caret-animation">Animation of the insertion caret: 'caret-animation'</h4>

<pre class='propdef'>
Name: caret-animation
Value: auto | blink | none | fade
Initial: auto
Applies to: elements that accept input
Inherited: yes
Percentages: N/A
Computed value: specified keyword
Animation type: discrete
</pre>

On most platforms and in most UAs,
the text insertion caret blinks.
This property allows the author
to control the speed at which it blinks,
or to turn off blinking entirely.


<dl dfn-type=value dfn-for=caret-animation>
        <dt><dfn>auto</dfn>
        <dd>
		The UA determines how the caret should be animated, if at all.
		It should match platform conventions,
		and may be adjusted based on context.

		Note: This is typically rendered as a blinking caret.

        <dt><dfn>blink</dfn>
        <dd>
		The UA must display a blinking caret.
		For accessibility reasons, and based on user preferences,
		The UA may display a non animated caret instead.

        <dt><dfn>none</dfn>
        <dd>
		The UA must not animate the caret.

		Note: This is only about UA driven animations of the caret.
		If CSS animations are used to animate the caret color,
		these should still apply normally.

        <dt><dfn>fade</dfn>
        <dd>
		The UA must display a caret repeatedly fading in and out,
		similarly to ''caret-animation/blink'' except it appears and
		disappears progressively rather than suddenly.
		For accessibility reasons, and based on user preferences,
		The UA may display a non animated caret instead.
</dl>

Issue: Do we need the accessibility escape hatch on blink and fade?
Would it be enough instead to expect the UI to put
<code>caret-animation:fixed !important</code> in the
user stylesheet when it wants to prevent the caret
from blinking?

The UA determines the speed at which the cursor blinks or fades.
It should follow platform conventions and settings.

Note: It is recommended to stop the caret from blinking or fading
using ''caret-animation: none''
when applying custom animations using [[CSS3-ANIMATIONS]],
to prevent the blinking or fading and the css animation to interfere.

Note: See <a href="https://www.w3.org/TR/WCAG20/#seizure">Guideline 2.3: Seizures: Do not design content in a way that is known to cause seizures</a> [[WCAG20]].

<div class=example>
	A user who is disturbed by or has adverse reactions to blinking or flashing visuals
	may want to make all carets static and non-blinking,
	regardless of platform defaults or author settings.
	This can be accomplished by with the folliwing rule in the user stylesheet.

	<pre><code class="lang-css">
	/* prevent the caret from blinking/flashing */
	:read-write { caret-animation: none !important; }

	/* prevent changes of caret-color, including animations */
	:read-write { caret-color:auto !important; }
	</code></pre>
</div>

UAs that do not have an editable user stylesheet
should provide a setting to disable
<a href="https://www.w3.org/TR/WCAG20/#blinksdef">blinking</a>,
<a href="https://www.w3.org/TR/WCAG20/#flash-def">flashing</a>
and animated carets.
UAs that do have an editable user stylesheet may want to provide this setting as well.
See [[WCAG]] <a href="https://www.w3.org/TR/WCAG20/#time-limits-pause">Guideline 2.2</a>
and <a href="https://www.w3.org/TR/WCAG20/#seizure">Guideline 2.3</a>
for details.

<div class=example>
	Normally, the caret blinks between on and off.
	This makes it alternate between 2 colors.
	<pre><code class="lang-css">
	textarea {
		caret-animation: none;
		caret-color: blue;
		animation: caret-alternate 2s step-end infinite;
	}
	@keyframes caret-alternate {
		50% { caret-color: red; }
	}
	</code></pre>

	The simulated rendering below illustrates how this should look.
	<style>
	@keyframes caret-alternate-ref { 50% { border-color: red; } }
	</style>
	<div style="border:inset; background: white; width: 10em;">
		Text area
		with color-alternating caret<span style="border-right: 2px solid blue; animation: caret-alternate-ref 2s step-end infinite;"></span>
	</div>

	Focus the element below to see how your browser renders it.
	<style>
	@keyframes caret-alternate-test {
		50% { caret-color: red; }
	}
	</style>
	<div contentEditable=true
	     style="border:inset; background: white; width: 10em;
	            caret-animation: none;
	            caret-color: blue;
	            animation: caret-alternate-test 2s step-end infinite;"
	>Text area with color-alternating caret</div>
</div>
-->


<h4 id="caret-shape">Shape of the insertion caret: 'caret-shape'</h4>

<pre class='propdef'>
Name: caret-shape
Value: auto | bar | block | underscore
Initial: auto
Applies to: elements that accept input
Inherited: yes
Percentages: N/A
Computed value: specified keyword
Animation type: by computed value
</pre>

This property allows authors to specify
the desired shape of the text insertion caret.

Within the context of this definition, <dfn>character</dfn> is
to be understood as <em>extended grapheme cluster</em>,
as defined in [[!UAX29]], and <dfn>visible character</dfn>
means a character with a non-zero advance measure.

<dl dfn-type=value dfn-for=caret-shape>
	<dt><dfn>auto</dfn>
	<dd>
		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 <em>insert</em> key on their keyboard,
		it may show a ''caret-shape/bar'' caret in insert mode,
		and a ''caret-shape/block'' caret in overtype mode.

	<dt><dfn>bar</dfn>
	<dd>
		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 <a>characters</a>, not over them.
		It should be perpendicular to the inline progression direction,
		although UAs may render it slanted when inserting italic or oblique text.

	<dt><dfn>block</dfn>
	<dd>
		The UA must render the text insertion caret
		as a rectangle overlapping the next <a>visible character</a> following the insertion point.
		If there is no <a>visible character</a> after the insertion point,
		the UA must render the caret after the last <a>visible character</a>.
		UAs may render it as a slanted rectangle when inserting italic or oblique text.

	<dt><dfn>underscore</dfn>
	<dd>
		The UA must render the text insertion caret
		as a thin line <a>under</a> (as defined in [[!CSS-WRITING-MODES-3]]
		the next <a>visible character</a> following the insertion point.
		If there is no <a>visible character</a> after the insertion point,
		the UA must render the caret after the last <a>visible character</a>.
</dl>

The width of the ''caret-shape/block'' and ''caret-shape/underscore'' carets
should be the advance measure of the next <a>visible character</a> after the insertion point,
or ''1ch'' if there is no next <a>visible character</a>
or if this information is impractical to determine.

When determining the orientation and appearance of the caret,
UAs must take into account the <a>writing mode</a> [[!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:

<ul>
	<li>The caret must not be obscured by the background of the element

	<li>UAs must render ''caret-shape/block'' carets so that the
	character it overlaps with is not obscured by the caret
</ul>

<div class=example>
	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.

	<style>
	@keyframes caret-bar-ref { 50% { border-color: transparent; } }
	@keyframes caret-block-ref { 50% { background: transparent; } }
	@keyframes caret-underscore-ref { 50% { border-color: transparent; } }
	#caret-shape-example {
		min-width: 25em;
	}
	#caret-shape-example,
	#caret-shape-example td,
	#caret-shape-example th {
		border: solid 1px;
	}
	#caret-shape-example td+td {
		background:white;
	}
	</style>
	<table id="caret-shape-example">
		<tr>
			<th>'caret-shape'
			<th>Sample rendering
			<th>Your browser<br>(focus each cell to see the caret)

		<tr>
			<td>''bar''
			<td>Lorem ipsu<span style="border: 1px solid black; margin: 0 -1px; animation: caret-bar-ref 2s step-end infinite;">&#8203;</span>m
			<td style contentEditable=true style="caret-shape: bar">Lorem Ipsum

		<tr>
			<td>''caret-shape/block''
			<td>Lorem ipsu<span style="background: #bbb; animation: caret-block-ref 2s step-end infinite;">m</span>
			<td contentEditable=true style="caret-shape: block">Lorem Ipsum

		<tr>
			<td>''underscore''
			<td>Lorem ispu<span style="border-bottom: 2px solid black; animation: caret-underscore-ref 2s step-end infinite;">m</span>
			<td contentEditable=true style="caret-shape: underscore">Lorem Ipsum
	</table>
</div>


<div class=example>
	''caret-shape/underscore'' or ''caret-shape/block'' carets are commonly used
	in terminals and command lines,
	as in this example.
	<pre><code class="lang-css">
	.console {
		caret-shape: underscore;
		background: black;
		color: white;
		font-family: monospace;
		padding: 1ex;
	}
	</code></pre>

	The simulated rendering below illustrates how this should look.
	<style>
	@keyframes terminal-caret-ref { 50% { border-color: transparent; } }
	</style>
	<pre style="background: black; color: white; font-family: monospace; padding: 1ex">
	user@host:css-ui-4 $ ls -a
	. .. Overview.bs Overview.html
	user@host:css-ui-4 $ <span style="border-bottom: 2px solid white;animation: terminal-caret-ref 2s step-end infinite;">&nbsp;</span>
	</pre>

	Focus the element below to see how your browser renders it.
	<pre contentEditable=true style="background: black; color: white; font-family: monospace; padding: 1ex; caret-shape: underscore;">
	user@host:css-ui-4 $ ls -a
	. .. Overview.bs Overview.html
	user@host:css-ui-4 $
	</pre>
</div>


<h4 id="caret">Insertion caret shorthand: 'caret'</h4>

<!-- Value: <<'caret-color'>> || <<'caret-animation'>> || <<'caret-shape'>> -->
<pre class='propdef shorthand'>
Name: caret
Value: <<'caret-color'>> || <<'caret-shape'>>
Initial: auto
Applies to: elements that accept input
Inherited: yes
Percentages: N/A
</pre>

This property is a shorthand for setting
'caret-color' <!--, 'caret-animation'--> and 'caret-shape' in one declaration.
Omitted values are set to their initial values.

<!--
<div class=example>
	This example illustrates using the various caret related properties
	in combination.
	They are used here to simulate the appearance of the caret
	on an old phosphor computer monitor.

	<pre><code class="lang-css">
	#old-screen {
		caret: block none;
		animation: old-caret 2s infinite;
		/*styling of the screen omitted for brevity */
	}
	@keyframes old-caret {
		from, 50% { caret-color: green; }
		75%, to { caret-color: transparent; }
	}
	</code></pre>

	The simulated rendering below illustrates how this should look.
	<style>
	.old-screen {
		border-radius: 1em;
		padding: 1em;
		color: green;
		font-family: monospace;
		white-space: pre;
		background: repeating-linear-gradient(#030 0px, #030 1px, #020 1px, #020 3px);
	}
	.old-screen span {
		display:inline-block;
		white-space: pre;
		caret: block 0s;
		animation: caret-old-ref 2s  infinite;

	}
	@keyframes caret-old-ref {
		from, 50% { background-color: green; }
		75%, to { background-color: transparent; }
	}
	</style>
	<div class="old-screen" style="height: 100px">&gt; <span>&nbsp;</span></div>

	Focus the element below to see how your browser renders it.
	<div class="old-screen" contentEditable="true" style="height: 100px">&gt; </div>
</div>
-->


<h3 id="keyboard">Keyboard control</h3>

<h4 id="nav-dir">Directional Focus Navigation: the 'nav-up', 'nav-right', 'nav-down', 'nav-left' properties</h4>

<pre class="propdef">
Name: nav-up , nav-right , nav-down , nav-left
Value: auto | <<id>> [ current | root | <<target-name>> ]?
Initial: auto
Applies to: all enabled elements
Inherited: no
Percentages: N/A
Computed value: as specified
Animation type: discrete
</pre>

<dl>
	<dt>auto
	<dd>The user agent automatically determines which element to navigate the focus to in response to directional navigational input.

	<dt><dfn noexport><<id>></dfn>
	<dd>
		The <<id>> value is an ID selector [[SELECT]].
		In response to directional navigation input corresponding to the property,
		the focus is navigated to the first element in tree order matching the selector.

		If this refers to the currently focused element,
		the directional navigation input respective to the nav- property is ignored &mdash;
		there is no need to refocus the same element.

		If no element matches the selector,
		the user agent automatically determines which element to navigate the focus to.

		If the focus is navigated to an element
		that was not otherwise focusable,
		it becomes focusable
		only as the result of this directional navigation,
		and the <css>:focus</css> pseudo-class matches the element
		while it is focused as such.

		Note: there were other options under consideration for such "not otherwise focusable" elements,
		including focus to the next otherwise focusable element in the document tree
		(including descendants of such a not otherwise focusable element).
		Input on such other options is welcome and explicitly solicited,
		especially from implementation experiences and author experience using the directional navigation properties in their content.

	<dt><dfn noexport><<target-name>></dfn>
	<dd>
		The &lt;target-name&gt; parameter indicates the target frame for the focus navigation.
		It is a <<string>> and it MUST NOT start with the underscore "_" character.
		Error handling: if it does start with an underscore, "_parent" navigates to the parent frame,
		"_root" is treated as ''root'',
		and other values navigate to a frame by that name if it exists.
		If the specified target frame does not exist,
		the parameter will be treated as the keyword ''current'',
		which means to simply use the frame that the element is in.
		The keyword ''root'' indicates that the user agent should target the full window.
</dl>

User agents for devices with directional navigation keys
respond by navigating the focus according to four respective nav-* directional navigation properties
(nav-up, nav-right, nav-down, nav-left).
This specification does not define which keys of a device are directional navigational keys.

Note: Typical personal computers have keyboards with four arrow keys.
One possible implementation would be to use those four arrow keys for directional navigation.
For accessibility and user convenience,
user agents should allow configuration of which keys on a keyboard are used for directional navigation.

<div class="example">
	<h5 id=example-positioned-buttons>Example: positioned buttons</h5>

	Here is an example of buttons positioned in a diamond shape
	whose directional focus navigation is set in such a way
	to navigate the focus clockwise (or counter-clockwise) around the diamond shape
	when the user chooses to navigate directionally.
	<pre><code class="lang-css">
	button { position:absolute }

	button#b1 {
		top:0; left:50%;
		nav-right:#b2; nav-left:#b4;
		nav-down:#b2; nav-up:#b4;
	}

	button#b2 {
		top:50%; left:100%;
		nav-right:#b3; nav-left:#b1;
		nav-down:#b3; nav-up:#b1;
	}

	button#b3 {
		top:100%; left:50%;
		nav-right:#b4; nav-left:#b2;
		nav-down:#b4; nav-up:#b2;
	}

	button#b4 {
		top:50%; left:0;
		nav-right:#b1; nav-left:#b3;
		nav-down:#b1; nav-up:#b3;
	}
	</code></pre>

	Whatever markup sequence the buttons may have
	(which is not specified in this example)
	is irrelevant in this case because they are positioned, and yet,
	it is still important to ensure focus navigation behaviors which relate reasonably to the specified layout.
</div>

<div class="example">
	<h5 id=example-moving-focus-to-inside-a-frame>Example: moving focus to inside a frame</h5>

	Moving the focus to an element in a specific frame requires both the element's id and the frame's name.

	This example shows how to make navigating left from the button with id "foo" move the focus to the element with id "bar" within the frame named "sidebar".

	<pre><code class="lang-css">
	button#foo { nav-left: #bar "sidebar"; }
	</code></pre>
</div>


<h4 id="input-method-editor">Obsolete: the ime-mode property</h4>

''ime-mode'' is a property somewhat implemented in some browsers,
that is problematic and officially obsoleted by this specification
and its predecessor [[CSS-UI-3]].

There is documentation of
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/ime-mode">non-interoperability of these implementations.</a>

User agents should not support the <css>ime-mode</css> property.

Authors must not use the ime-mode property.

Users may use the ime-mode property only for repair use-cases
where they have to work around bad sites and legacy implementations,
e.g. with a user style sheet rule like:
<div class="example">
	Example: user preference
	<pre><code class="lang-css">input[type=password] {
		ime-mode: auto&nbsp;!important;
	}
	</code></pre>
</div>

This example CSS may be placed into a user style sheet file to force password input fields to behave in a default manner.

This specification deliberately does not attempt to document the functionality of legacy ime-mode implementations nor what they specifically support because it does not make sense to pursue or recommend any such path.

<div class="note">
	Note: there are several [[HTML5]] features which authors should use
	to provide information to user agents that allow them to provide a better input user experience:

	<ul>
		<li>The global <code>lang</code> attribute

		<li>The <code>inputmode</code>, <code>pattern</code>, and <code>type</code> attributes of the input element
	</ul>
</div>


<h2 id="user-interaction">User Interaction</h2>

<h3 id="content-selection">Controlling content selection</h3>

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.

<pre class='propdef'>
	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
	Computed value: specified keyword
	Animation type: not animatable
</pre>

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 maps to a [=used value=] of ''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.
<strong class="advisement">To the extent possible,
authors should avoid using generated content
for non decorative purposes,
and should prefer including all the content in the DOM.</strong>
<em>This feature is at risk.</em>

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 <a>page-margin boxes</a>?
Should the [=used value=] of '''user-select/auto'' also be ''user-select/none'',
or would ''user-select/text'' be more appropriate?

The [=used value=] is the same as the [=computed value=],
except:

<ol>
	<li>
		on <a>editable element</a>s
		where the [=used value=] is always ''user-select/contain''
		regardless of the [=computed value=]

	<li>
		when the [=computed value=] is ''user-select/auto'',
		in which case the [=used value=] one of the other values as defined below
</ol>

For the purpose of this specification,
an <dfn>editable element</dfn> is either
an <a href="https://w3c.github.io/contentEditable/#dfn-editing-host">editing host</a>
or a <a spec=html>mutable</a> form control with textual content,
such as <{textarea}>.

Issue: Should there be constraints
on what happens to the used value
on elements that are editable descendants of editing hosts?
The semantics are not obvious.
Maybe ''user-select/none'' should map to ''user-select/text'',
or maybe all values should map to ''user-select/text''.

<dl dfn-type=value dfn-for=user-select>
	<dt><dfn>auto</dfn>
	<dd>
		The [=used value=] of ''user-select/auto'' is determined as follows:

		<ul>
			<li>
				On the ''::before'' and ''::after'' pseudo elements,
				the used value is ''user-select/none''

			<li>
				If the element is an <a>editable element</a>,
				the [=used value=] is ''user-select/contain''

			<li>
				Otherwise,
				if the [=used value=] of 'user-select' on the parent of this element is ''all'',
				the [=used value=] is ''all''

			<li>
				Otherwise,
				if the [=used value=] of 'user-select' on the parent of this element is ''user-select/none'',
				the [=used value=] is ''user-select/none''
			<li>
				Otherwise, the [=used value=] is ''user-select/text''
		</ul>

		Note: This unusual combination of a non inherited property with an initial value of ''user-select/auto''
		whose used 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.

	<dt><dfn>text</dfn>
	<dd>The element imposes no constraint on the selection.

	<dt><dfn caniuse="user-select-none">none</dfn>
	<dd>
		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 [=used 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 the [=used value=] of 'user-select' is not ''user-select/none'',
		these descendants must be included in a selection extending across the element.
		<span class=note>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 highly confusing to users.</span>

		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.

		<div class=note>
			Authors should be careful about not constraining the user unnecessarily.
			For example, setting ''user-select: none'' on the root element,
			and relaxing that restriction on a handful of elements the author judges useful to select can be frustrating to users:

			* Clicking in empty areas to undo the current selection will no longer be effective
			* The author may have overlooked some areas which should be selectable
			* Areas may be added later to the page without remembering to make them selectable
			* The user may want to select pieces of text other than the main content,
			    for instance to look them up in a dictionary or in some translation tool,
			    or to look for warnings and error messages in a search engine…

			Instead, a good practice is for authors is to selectively apply ''user-select: none'' to elements
			which seem likely to be accidentally selected
			when doing so would interfere with the more likely intended action.
			Accidentally leaving parts of the page that are unlikely to be interacted with selectable
			will likely cause much less frustration to users than the opposite.
		</div>

	<dt><dfn>contain</dfn>
	<dd>
		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 <code>user-select: element</code>.

	<dt><dfn>all</dfn>
	<dd>
		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 [=used 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 [=used 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.
</dl>

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:
<pre><code class="lang-css">
button, meter, progress, select { user-select: none; }
</code></pre>

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 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.


<h2 id="styling-widgets" oldids="form-styling, control-styling">Styling Widgets</h2>

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

<pre class="propdef">
Name: appearance
Value: ''appearance/none'' | ''auto'' | ''button'' | ''textfield'' | ''menulist-button'' | <<compat-auto>>
Initial: none
Applies To: all elements
Inherited: no
Computed value: specified keyword
Animation type: discrete
</pre>

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

The term <dfn export>widget</dfn> in this specification denotes elements that can have <dfn export>native appearance</dfn>,
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.
It is up to the host language (e.g., HTML [[HTML]]) to define which elements can have <a>native appearance</a>.

This specification introduces the 'appearance' property
to provide some control over this behavior.
In particular, using ''appearance: none'' allows authors
to suppress the <a>native appearance</a> of <a>widgets</a>,
so that CSS can be used to restyle them.

<details class=note>
	<summary>Note on the history of this feature</summary>

	This previously existed in prefixed form in most browsers.
	Before standardization, in addition to none,
	the possible values were a very long list of all the ways an element could look;
	each value being responsible for giving form control their specific look and feel.
	This list was different across browsers.

	The CSS Working Group concluded this was impractical to standardize,
	in part because many values applied to pseudo-elements that other browsers don't have,
	as they construct form elements differently,
	and which should not be standardized,
	since the ability to make form controls look substantially different on different platforms
	should be preserved.

	Also, the ability to turn any arbitrary element (including any form control)
	into any (other) arbitrary form control
	is considered a misfeature.

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

	However, there is evidence that this alone is not web compatible,
	due in part to uses such as:
	<pre><code highlight=css>
	input { appearance: none; }
	input[type=checkbox] { appearance: checkbox; }
	</code></pre>

	The design specified here is a compromise between the two,
	preserving the simplicity of the ''none | auto'' model
	while maintaining compatibility with existing content
	via a few additional keywords.

	The precise list of keywords needed for compatibility
	and their exact behavior
	is likely to be refined in future version of this specification
	to better handle compatibility with existing content.
	The CSS-WG welcomes relevant feedback.
</details>

<dl dfn-type=value dfn-for=appearance>
	<dt><dfn>none</dfn>
	<dd>
		The element is rendered following the usual rules of CSS.
		Replaced elements other than <a>widgets</a> are not affected by this,
		and remain replaced elements.
		<a>Widgets</a> must not have their <a>native appearance</a>.
		See [[#appearance-decorative]] and [[#appearance-semantics]] for details.

	<dt><dfn>auto</dfn>
	<dd>
		<a>Widgets</a> may have their <a>native appearance</a>.

		Elements other than <a>widgets</a> must be rendered as if ''appearance/none'' had been specified.

	<dt><dfn>button</dfn>
	<dd>
		The element is rendered with the look and feel of a push button,
		similar to the ''appearance: auto'' rendering of the [[HTML]] <{button}> element.

		UAs must treat this value as ''appearance/auto'' on <{input}> elements,
		<{textarea}> elements, <a spec="html">list box</a> <{select}> elements, <{meter}> elements, and <{progress}> elements.

		Note: Using ''appearance/button'' on a <a spec="html">drop-down box</a> <{select}> element works.

	<dt><dfn>textfield</dfn>
	<dd>
		For <{input}> elements where the <{input/type}> attribute is in the Search state,
		the element is rendered as a "normal" text entry widget,
		similar to an <{input}> element where the <{input/type}> attribute is in the Text state.

		For all other elements, this value has the same effect as ''appearance/auto''.

	<dt><dfn>menulist-button</dfn>
	<dd>
		For <a spec="html">drop-down box</a> <{select}> elements,
		the element is rendered as a drop-down box, including a "drop-down button",
		but not necessarily using a native control of the host operating system.
		For such elements, CSS properties such as 'color', 'background-color', and 'border'
		(that can be disregarded for ''appearance/auto'') should not be disregarded.

		For all other elements, this value has the same effect as ''appearance/auto''.

	<dt><dfn type="">&lt;compat-auto></dfn>
	<dd>
		These values exist for compatibility of content developed
		for earlier non standard versions of this property.
		They all have the same effect as ''appearance/auto''.

		<pre class=prod style="white-space: normal"><<compat-auto>> =  <dfn>searchfield</dfn> | <dfn>textarea</dfn> | <dfn>push-button</dfn> | <dfn>slider-horizontal</dfn> | <dfn>checkbox</dfn> | <dfn>radio</dfn> | <dfn>square-button</dfn> | <dfn>menulist</dfn> | <dfn>listbox</dfn> | <dfn>meter</dfn> | <dfn>progress-bar</dfn></pre>

		Issue: When ''appearance/auto'' is widely supported,
		recommend using it instead.

		Issue: If any of these value is not needed for web compat,
		they should be dropped from this list;
		conversely, any value needed for compat not included in this list should be added.

		Issue: It is possible that for compat reasons,
		some of these values need to be promoted to being full blown values
		with effects on arbitrary elements like ''button'',
		or that
		some of these values need to have some side effects on some <a>widgets</a>.

</dl>

<div class=issue>
	The values <code>slider-vertical</code> and <code>sliderthumb-vertical</code>
	are supported in some user agents to change the orientation of
	<code class="lang-markup">&lt;input type=range></code> elements.
	These values are not specified because changing the orientation of this control
	is better done with a separate mechanism.
	See issue <a href="https://github.com/whatwg/html/issues/4177">whatwg/html#4177</a>.
</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">
	input[type=checkbox] {
		all: unset; /* this shorthand includes resetting appearance to none */
		width: 1em;
		height: 1em;
		display: inline-block;
		background: red;
	}
	input[type=checkbox]:checked {
		border-radius: 50%;
		background: green;
	}
	input[type=checkbox]:focus-visible {
		outline: auto;
	}
	</code></pre>

	<code class="lang-markup">&lt;input type="checkbox"></code> would be rendered as
	<span style="display: inline-block; width: 1em; height: 1em; background: red;"></span>,
	while <code class="lang-markup">&lt;input type="checkbox" checked></code> would be rendered as
	<span style="display: inline-block; width: 1em; height: 1em; background: green; border-radius: 50%;"></span>,
	and activating (for example by clicking) the element would toggle the state as usual.
</div>

On <a>widgets</a> where the computed value is ''appearance/auto'' or one of the <<compat-auto>> values,
and on any element where the computed value is ''appearance/button'',
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:

<ul>
	<li>'appearance'
	<li>'display' (the [=inner display type=] may be ignored)
	<li>'visibility'
	<li>'position'
	<li>'top'
	<li>'right'
	<li>'bottom'
	<li>'left'
	<li>'float'
	<li>'clear'
	<li>'margin' and related long-hand properties
	<li>'unicode-bidi'
	<li>'direction'
	<li>'cursor'
	<li>'z-index'
</ul>

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 <a>widgets</a>,
so this specification needs to say something about this.

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

<h4 id=appearance-decorative>
Effects of 'appearance' on Decorative Aspects of Elements</h4>

All decorative visual aspects of a <a>widget</a> 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.

<div class=example>
	For example, the [[HTML]] <{select}> element 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' on a <{select}> element is ''appearance/none'' or ''appearance/button'',
	this must disappear.
</div>

UAs should include in their User Agent stylesheet style rules
to give <a>widgets</a> 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.

<div class=advisement>
	Authors may find it convenient to use ''all: unset'',
	to get fully unstyled <a>widgets</a>
	which they can then style as they want without interference from the browser's UA stylesheet.
	However, this also suppresses the focus indicators provided by the same UA stylesheet.
	In order avoid damaging accessibility,
	authors who do so should restore a focus indicator,
	for instance by using '':focus-visible { outline: auto; }''.
</div>

<h4 id=appearance-semantics>
Effects of 'appearance' on Semantic Aspects of Elements</h4>

UAs must preserve aspects of the <a>widget</a>
which are necessary to operate the <a>widget</a> with its original semantics.
The UA may however give them a different look and feel
as long as it remains possible to operate the <a>widget</a>.
Aspects of a <a>widget</a> which are merely needed to observe the state the <a>widget</a> is in
and are not needed to operate it
should be suppressed as well
when the same information can be conveyed using ordinary CSS.
Document languages should specify
for each <a>widget</a> that they define
what needs to be preserved.

<div class=example>
	For example,
	the slider of an <code class="lang-markup">&lt;input type=range></code> 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 <code class="lang-markup">&lt;input type=checkbox checked></code>
	must be suppressed,
	as it merely indicates the state the element is in,
	which can be styled in different ways using the '':checked'' selector.
</div>

The behavior and semantics of elements remain defined by the document language,
and are not influenced by this property.

<div class=example>
	For example, regardless of the computed value of 'appearance':

	<ul>
		<li>
			Elements which can be in different states keep this ability,
			and the relevant pseudo-classes match as usual.

			<li>
				If a <{select}> element is activated,
				the UI to choose one of the associated <{option}> elements is shown
				(although it may look different).

			<li>
				Event handlers attached to the element trigger as usual.
	</ul>
</div>

Conversely, changing the appearance of an element must not cause it
to acquire the semantics, pseudo classes, event handlers, etc,
that are typical of the element whose appearance it acquires.

<div class=example>
	For example, neither '':enabled'' nor '':disabled'' match on
	a <{div}> styled with ''appearance: button''.
	The ability for an element to be focused
	is also not changed by the 'appearance' property.
</div>

<h3 id=control-specific-rules>
Control Specific Rules</h3>

Issue: Maybe some or all of this section
should be moved to the [[HTML]] spec
at some point.

Issue: On some elements, setting some properties inhibits ''appearance: auto''.
For instance, even if 'appearance' is ''appearance/auto'',
buttons lose their native appearance when a 'border' is set.
This is not in contradiction with the definition of ''appearance/auto'',
since ''appearance: auto'' only means
UAs <em>may</em> use a native appearance,
but for greater interoperability,
it would be good to document
which properties on which elements
have this effect.

Issue: Documenting what UAs need to put in their UA stylesheet would be good.

<h4 id=input-rules>
Single-Line Text Input Controls</h4>

When 'appearance' is ''appearance/auto'',
single-line text input controls
such as [[!HTML]] <code highlight=html>&lt;input type=text></code>
must be rendered so that:

* The content is clipped in the inline direction to the <a>content edge</a>
* The content is clipped in the block direction to the <a>padding edge</a>
* The content is vertically centered
* The content does not wrap
* The 'text-overflow' property applies regardless of the value of the 'overflow' property

<hr title="Separator from footer">


<h2 class="no-num" id="acknowledgments">Appendix A. Acknowledgments</h2>

This appendix is <em>informative</em>.

This specification builds upon [[CSS-UI-3]],
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
<span class="h-card">Rossen Atanassov</span>,
<span class="h-card">Tab Atkins</span>,
<span class="h-card">L. David Baron</span>,
<span class="h-card">Bert Bos</span>,
<span class="h-card">Matthew Brealey</span>,
<span class="h-card">Rick Byers</span>,
<span class="h-card">Ada Chan</span>,
<span class="h-card">James Craig</span>,
<span class="h-card">Michael Cooper</span>,
<span class="h-card">Axel Dahmen</span>,
<span class="h-card">Michael Day</span>,
<span class="h-card">Micah Dubinko</span>,
<span class="h-card">Elika E.</span>,
<span class="h-card">Steve Falkenburg</span>,
<span class="h-card">Andrew Fedoniouk</span>,
<span class="h-card">Al Gilman</span>,
<span class="h-card">Ian Hickson</span>,
<span class="h-card">Bjoern Hoehrmann</span>,
<span class="h-card">Alan Hogan</span>,
<span class="h-card">David Hyatt</span>,
<span class="h-card">Richard Ishida</span>,
<span class="h-card">Sho Kuwamoto</span>,
<span class="h-card">Yves Lafon</span>,
<span class="h-card">Stuart Langridge</span>,
<span class="h-card">Susan Lesch</span>,
<span class="h-card">Peter Linss</span>,
<span class="h-card">Kang-Hao Lu</span>,
<span class="h-card">Masayuki Nakano</span>,
<span class="h-card">Mats Palmgren</span>,
<span class="h-card">Brad Pettit</span>,
<span class="h-card">Chris Rebert</span>,
<span class="h-card">François Remy</span>,
<span class="h-card">Andrey Rybka</span>,
<span class="h-card">Simon Sapin</span>,
<span class="h-card">Alexander Savenkov</span>,
<span class="h-card">Sebastian Schnitzenbaumer</span>,
<span class="h-card">Lea Verou</span>,
<span class="h-card">Etan Wexler</span>,
<span class="h-card">David Woolley</span>,
<span class="h-card">Frank Yan</span>,
<span class="h-card">Boris Zbarsky</span>,
and
<span class="h-card">Domel</span>.


<h2 class="no-num" id="changes">Appendix B. Changes</h2>

This appendix is <em>informative</em>.

<h3 id=changes-22-12-2017 class=no-num>Changes from the
<a href="https://www.w3.org/TR/2017/WD-css-ui-4-20171222/">22 December 2017 Working Draft</a></h3>

In addition to a number of editorial adjustments,
the following normative changes have been made:

<ul>
	<li>Added details about form control specific rendering rules
	<li>Clarify interaction between text-overflow and annonymous block containers
	<li>Require the ''cursor/pointer'' cursor for hyperlinks in all document formats
	<li>Moved the 'box-sizing' and 'text-overflow' properties to [[CSS-SIZING-3]] and [[CSS-OVERFLOW-4]] respectively.
	<li>Changed the requirement that the ''cursor/text'' cursor matches the writing mode from MAY to MUST
	<li>The definition of the appearance property has been significantly reworked to make the design compatible with existing web content
	<li>The logic that mapped ''user-select: auto'' to various values at computed value time has been changed to used value time
	<li>Clarify Author requirements on the ''cursor: pointer'' value
</ul>

<h3 id=changes-22-09-2015 class=no-num>Changes from the
<a href="https://www.w3.org/TR/2015/WD-css-ui-4-20150922/">22 Sep 2015 First Public Working Draft</a></h3>

In addition to a number of editorial adjustments,
the following normative changes have been made:

<ul>
	<li>
		The caret-animation property have been removed.
		It may be reintroduced later given sufficient evidence for use cases.

	<li>
		The ''resize'' property now also applies to
		replaced elements representing images or videos,
		and to iframes.

	<li>
		The string values and dual values of the text-overflow property were moved to this specification from level 3.

	<li>
		Move directional focus navigation properties from level 3 to level 4

	<li>
		Content from the now stable [[CSS-UI-3]] has been merged in.
</ul>


<h2 class="no-num" id="security-privacy-considerations">Appendix C. Considerations for Security and Privacy</h2>

This appendix is <em>informative</em>.

The W3C TAG is developing a
<a href="https://w3ctag.github.io/security-questionnaire/">Self-Review Questionnaire: Security and Privacy</a>
for editors of specifications to informatively answer.

Per the <a href="https://w3ctag.github.io/security-questionnaire/#questions">Questions to Consider</a>

<dl>
	<dt>Does this specification deal with personally-identifiable information?
	<dd>No.

	<dt>Does this specification deal with high-value data?
	<dd>No.

	<dt>Does this specification introduce new state for an origin that persists across browsing sessions?
	<dd>No.

	<dt>Does this specification expose persistent, cross-origin state to the web?
	<dd>No.

	<dt>Does this specification expose any other data to an origin that it doesn’t currently have access to?
	<dd>No.

	<dt>Does this specification enable new script execution/loading mechanisms?
	<dd>
		Yes to loading, but not to execution.

		The 'cursor' property accepts <<image>> values which may include URLs to be loaded.
		These may be SVG documents which may contain scripts,
		but this specification requires that scripts must not be run.

	<dt>Does this specification allow an origin access to a user’s location?
	<dd>No.

	<dt>Does this specification allow an origin access to sensors on a user’s device?
	<dd>
		Yes.

		The directional focus navigation properties indirectly allow access to the device's keyboard navigation input mechanism such as arrow keys.

	<dt>Does this specification allow an origin access to aspects of a user’s local computing environment?
	<dd>No.

	<dt>Does this specification allow an origin access to other devices?
	<dd>No.

	<dt>Does this specification allow an origin some measure of control over a user agent’s native UI?
	<dd>
		Yes.

		The 'cursor' and 'caret' property and <a>sub-properties</a>
		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.

	<dt>Does this specification expose temporary identifiers to the web?
	<dd>No.

	<dt>Does this specification distinguish between behavior in first-party and third-party contexts?
	<dd>No.

	<dt>How should this specification work in the context of a user agent’s "incognito" mode?
	<dd>No differently.

	<dt>Does this specification persist data to a user’s local device?
	<dd>No.

	<dt>Does this specification have a "Security Considerations" and "Privacy Considerations" section?
	<dd>Yes.

	<dt>Does this specification allow downgrading default security characteristics?
	<dd>No.
</ol>


<h2 class="no-num" id="default-style-sheet">Appendix D. Default style sheet additions for HTML</h2>

This appendix is <em>informative</em>.

Potential additions to the base style sheet to express HTML form controls, and a few dynamic presentation attributes:

<pre class="lang-css">
:enabled:focus {
	outline: 2px inset;
}

button,
input[type=button],
input[type=reset],
input[type=submit],
input[type=checkbox],
input[type=radio],
textarea,
input,
input[type=text],
input[type=password],
input[type=image] {
	display: inline-block;
}

input[type=button],
input[type=reset],
input[type=submit],
input[type=checkbox],
input[type=radio],
input,
input[type=text],
input[type=password],
input[type=image] {
	white-space: nowrap;
}

button {
	/* white space handling of BUTTON tags in particular */
	white-space:normal;
}

input[type=reset]:lang(en) {
	/* default content of HTML input type=reset button, per language */
	content: "Reset";
}

input[type=submit]:lang(en) {
	/* default content of HTML input type=submit button, per language */
	content: "Submit";
}

/* UAs should use language-specific Reset/Submit rules for others. */

input[type=button],
input[type=reset][value],
input[type=submit][value] {
	/* text content/labels of HTML "input" buttons */
	content: attr(value);
}

textarea {
	/* white space handling of TEXTAREA tags in particular */
	white-space:pre-wrap;
	resize: both;
}

input[type=hidden] {
	/* appearance of the HTML hidden text field in particular */
	display: none !important;
}

input[type=image] {
	content: attr(src,url);
	border: none;
}

select[size] {
	/* HTML4/XHTML1 &lt;select&gt; w/ size more than 1 - appearance of list */
	display: inline-block;
	height: attr(size,em);
}

select,select[size=1] {
	/* HTML4/XHTML1 &lt;select&gt; without size, or size=1 - popup-menu */
	display: inline-block;
	height: 1em;
	overflow: hidden;
}

select[size]:active {
	/* active HTML &lt;select&gt; w/ size more than 1 - appearance of active list */
	display: inline-block;
}

optgroup, option {
	display: block;
	white-space: nowrap;
}

optgroup[label],option[label] {
	content: attr(label);
}

option[selected]::before {
	display: inline;
	content: check;
}

/* Though FRAME resizing is not directly addressed by this specification,
   the following rules may provide an approximation of reasonable behavior. */

/*

frame { resize:both }
frame[noresize] { resize:none }

*/

</pre>
