Skip to content

Commit 6ddf5aa

Browse files
authored
[css-ui-4] Add 'interactivity' property, per #10711 (#11178)
* [css-ui-4] Add 'interactivity' property, per #10711 * [css-ui-4] Sigh, inheritance *does* work on the flat tree, I'm dumb. * [css-ui-4] Ensure 'interactivity' can make things inert, but can't *escape* inertness; defer more to the host language.
1 parent ca723c8 commit 6ddf5aa

File tree

1 file changed

+87
-1
lines changed

1 file changed

+87
-1
lines changed

css-ui-4/Overview.bs

+87-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Ignore Can I Use URL Failure: https://drafts.csswg.org/css-ui-4/
6262
Ignore Can I Use URL Failure: http://drafts.csswg.org/css-ui-4/
6363
Ignore Can I Use URL Failure: https://www.w3.org/TR/css-ui-4/
6464
Ignore Can I Use URL Failure: http://www.w3.org/TR/css-ui-4/
65+
Indent: 2
6566
</pre>
6667

6768
<pre class=link-defaults>
@@ -103,7 +104,8 @@ spec:css-backgrounds-3; type:property; text:border-left-color
103104
</pre>
104105
<pre class=anchors>
105106
urlPrefix: https://html.spec.whatwg.org/multipage/; spec:HTML
106-
text:password; type:attr-value; for:input/type; url: input.html#attr-input-type-password-keyword
107+
type:attr-value; text:password; for:input/type; url: input.html#attr-input-type-password-keyword
108+
type:element-attr; text:inert; for:html-global; url: interaction.html#the-inert-attribute
107109
</pre>
108110

109111
<style>
@@ -1978,6 +1980,90 @@ Exclusion from Hit-testing: the 'pointer-events' property</h3>
19781980
with more possible values.
19791981
The effect of such values outside of SVG is currently not defined.
19801982

1983+
<h3 id="inertness">
1984+
Preventing All Interaction: the 'interactivity' property</h3>
1985+
1986+
<pre class=propdef>
1987+
Name: interactivity
1988+
Value: auto | inert
1989+
Initial: auto
1990+
Applies to: all elements
1991+
Inherited: yes
1992+
Percentages: N/A
1993+
Computed Value: as specified
1994+
Animation type: discrete
1995+
</pre>
1996+
1997+
The 'interactivity' property specifies whether an element and its [=flat tree=] descendants
1998+
(including [=text runs=])
1999+
are [=inert=] or not.
2000+
2001+
<dl dfn-type=value dfn-for=interactivity>
2002+
: <dfn>auto</dfn>
2003+
:: The element's [=inert|inertness=] is determined by the [=host language=].
2004+
<span class=note>(This will <em>usually</em> mean the element is not [=inert=].)</span>
2005+
2006+
: <dfn>inert</dfn>
2007+
:: The element is [=inert=].
2008+
</dl>
2009+
2010+
<div algorithm>
2011+
When an [=element=] or [=text run=] is <dfn export>inert</dfn>:
2012+
2013+
* Hit-testing must act as if 'pointer-event' was ''pointer-events/none'',
2014+
regardless of its actual value.
2015+
* Text selection must act as if 'user-select' was ''user-select/none'',
2016+
regardless of its actual value.
2017+
* If the [=element=] or [=text run=] is editable,
2018+
it must behave as if it was non-editable.
2019+
* The [=element=] or [=text run=] should be ignored
2020+
for the purposes of find-in-page and similar searching actions.
2021+
2022+
User agents may allow the user
2023+
to override the restrictions on find-in-page and text selection.
2024+
</div>
2025+
2026+
Note: This property allows an author to force an element [=inert=],
2027+
but doesn't allow making an element *non*-[=inert=],
2028+
just deferring inertness to the host language.
2029+
For example, in HTML, while a modal dialog is being displayed,
2030+
the rest of the page is forced inert automatically,
2031+
regardless of the value of this property.
2032+
In general, host languages can make use of more information about the document
2033+
than CSS has easy access to
2034+
to determine what the best inertness behavior is for users.
2035+
2036+
Note: [=Inert=] nodes generally cannot be focused,
2037+
and user agents do not expose the inert nodes
2038+
to accessibility APIs or assistive technologies.
2039+
An inert subtree should not contain any content or controls
2040+
which are critical to understanding or using aspects of the page
2041+
which are not in the inert state.
2042+
Content in an inert subtree will not be perceivable by all users, or interactive.
2043+
Authors should not specify elements as inert
2044+
unless the content they represent are also visually obscured in some way.
2045+
In most cases,
2046+
authors should not specify the inert attribute on individual form controls.
2047+
In these instances, the <{input/disabled}> attribute is probably more appropriate.
2048+
2049+
<div class=issue>
2050+
The following should be inserted into the HTML stylesheet,
2051+
to ensure that top-level modal dialogs become uninert by default:
2052+
2053+
<pre highlight=css>
2054+
[inert] {
2055+
interactivity: inert;
2056+
}
2057+
dialog:modal {
2058+
interactivity: auto;
2059+
}
2060+
</pre>
2061+
2062+
The <css>dialog:modal</css> selector above needs to be expanded
2063+
for any other elements that escape inertness by default.
2064+
</div>
2065+
2066+
19812067

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

0 commit comments

Comments
 (0)