Skip to content

Commit 6a712f0

Browse files
committed
[css-ui-4] Define the interest-delay properties. #9236
1 parent 71f8f1d commit 6a712f0

File tree

1 file changed

+84
-1
lines changed

1 file changed

+84
-1
lines changed

css-ui-4/Overview.bs

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ spec:selectors-4; type:selector; text::disabled
9595
spec:css-color-4; type:property; text:color
9696
spec:selectors-4; type:selector; text::focus
9797
spec:selectors-4; type:selector; text::focus-visible
98+
spec:selectors-4; type:dfn; text:host language
9899
spec:css-backgrounds-3; type:property; text:border-radius
99100
spec:css-backgrounds-3; type:property; text:border-color
100101
spec:css-backgrounds-3; type:property; text:border-top-color
@@ -136,6 +137,7 @@ spec:css-borders-4; type:property;
136137
text:border-inline-start-color
137138
text:border-inline-end-color
138139
spec:dom; type:dfn; text:element
140+
spec:infra; type:dfn; text:user agent
139141
</pre>
140142
<pre class=anchors>
141143
urlPrefix: https://html.spec.whatwg.org/multipage/; spec:HTML
@@ -2027,7 +2029,7 @@ are [=inert=] or not.
20272029

20282030
<dl dfn-type=value dfn-for=interactivity>
20292031
: <dfn>auto</dfn>
2030-
:: The element's [=inert|inertness=] is determined by the <l spec=selectors-4>[=host language=]</l>.
2032+
:: The element's [=inert|inertness=] is determined by the [=host language=].
20312033
<span class=note>(This will <em>usually</em> mean the element is not [=inert=].)</span>
20322034

20332035
: <dfn>inert</dfn>
@@ -2091,6 +2093,87 @@ In these instances, the <{input/disabled}> attribute is probably more appropriat
20912093
</div>
20922094

20932095

2096+
<h3 id="interest">
2097+
User Interest Delay</h3>
2098+
2099+
<pre class="propdef">
2100+
Name: interest-delay-start, interest-delay-end
2101+
Value: normal | <<time>>
2102+
Initial: ''interest-delay/normal''
2103+
Applies to: all elements
2104+
Inherited: yes
2105+
Percentages: n/a
2106+
Computed value: the keyword ''interest-delay/normal'' or a computed time
2107+
Canonical order: per grammar
2108+
Animation type: by computed value type
2109+
</pre>
2110+
2111+
<pre class="propdef shorthand">
2112+
Name: interest-delay
2113+
Value: <<'interest-delay-start'>>
2114+
</pre>
2115+
2116+
Some [=host language=] features
2117+
can be activated when a user "shows interest" in an element.
2118+
Exactly what this means is up to the [=host language=] and [=user agent=]
2119+
(for example, the HTML <{html-global/interestfor}> attribute),
2120+
but a common property of such features
2121+
is that "interest" shouldn't be gained or lost <em>instantly</em>.
2122+
2123+
For example, if "interest" can be shown by hovering the cursor over an element,
2124+
briefly passing the cursor over the element
2125+
while moving the cursor over the page
2126+
should not (at least by default) indicate "interest"--
2127+
that could result in UI confusingly popping up and disappearing
2128+
while the user is performing unrelated tasks.
2129+
2130+
Similarly, once interest has been shown,
2131+
it should not (at least by default)
2132+
<em>lose</em> interest instantaneously either.
2133+
Again, as an example,
2134+
if the user "shows interest" in a link by hovering the cursor over it,
2135+
causing a child popup list to appear next to it,
2136+
moving the cursor from the link to the popup
2137+
likely involves briefly leaving both the link and the list,
2138+
but shouldn't cause the list to "lose interest"
2139+
and close the popup.
2140+
2141+
The 'interest-delay' shorthand,
2142+
and its 'interest-delay-start' and 'interest-delay-end' longhands,
2143+
allow control of the <dfn export>interest start delay</dfn>
2144+
and <dfn>interest end delay</dfn>
2145+
for these features
2146+
on a given element.
2147+
Its possible values are:
2148+
2149+
<dl dfn-type=value dfn-for="interest-delay, interest-delay-start, interest-delay-end">
2150+
: <dfn>normal</dfn>
2151+
:: The [=interest start delay=] and/or the [=interest end delay=]
2152+
are UA-defined.
2153+
They can be chosen to match platform conventions.
2154+
2155+
These delays <em>should not</em> be zero.
2156+
They <em>may</em> be different from each other,
2157+
and may vary depending on the way the user is showing interest.
2158+
(For example, a "hover" and a "long press"
2159+
might use different delays for indicating interest.)
2160+
2161+
: <dfn><<time>></dfn>
2162+
:: Specifies that the [=interest start delay=] and/or the [=interest end delay=]
2163+
are the specified duration.
2164+
</dl>
2165+
2166+
The 'interest-delay' shorthand
2167+
sets both 'interest-delay-start' and 'interest-delay-end'
2168+
to the same specified value.
2169+
2170+
Note: In the future, the syntax of these properties might be expanded
2171+
to allow for customizing the delay
2172+
depending on feature
2173+
and how the user is showing interest.
2174+
(For example, providing different delays
2175+
for hovering vs long-pressing.)
2176+
20942177

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

0 commit comments

Comments
 (0)