Skip to content

Commit 2c2b991

Browse files
committed
[css-ui-4] Remove caret-blink-time, add caret-animation
1 parent 3f1d9db commit 2c2b991

File tree

1 file changed

+46
-38
lines changed

1 file changed

+46
-38
lines changed

css-ui-4/Overview.bs

+46-38
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ Abstract: This is a delta specification over CSS-UI Level 3.
9393
ensuring good visibility and contrast means not using
9494
currentColor.
9595

96-
<h4 id="caret-blink-time">Blinking speed of the insertion caret: 'caret-blink-time'</h4>
96+
<h4 id="caret-animation">Animation of the insertion caret: 'caret-animation'</h4>
9797

9898
<pre class='propdef'>
99-
Name: caret-blink-time
100-
Value: auto | <<time>>{1,2}
99+
Name: caret-animation
100+
Value: auto | blink | none | fade
101101
Initial: auto
102102
Applies to: elements that accept input
103103
Inherited: yes
104104
Percentages: N/A
105105
Media: interactive
106-
Computed value: Same as specified value, except if only 1 <<time>> is specified, in which case the computed value has 2 instances of <<time>>, both with the same value as the one which was specified.
106+
Computed value: Same as specified value.
107107
Animatable: no
108108
</pre>
109109

@@ -113,42 +113,50 @@ This property allows the author
113113
to control the speed at which it blinks,
114114
or to turn off blinking entirely.
115115

116-
Issue: Do we actually need fine control over the timing,
117-
or would "caret-blink: auto | no-blink" be enough?
118116

119-
When the computed value is ''caret-blink-time/auto'',
120-
the UA determines the speed at which the cursor blinks,
121-
if at all. It should follow platform conventions and settings.
117+
<dl dfn-type=value dfn-for=caret-animation>
118+
<dt><dfn>auto</dfn>
119+
<dd>The UA determines how the caret should be animated, if at all.
120+
It should match platform conventions,
121+
and may be adjusted based on context.
122122

123-
If two <<time>> values are specified,
124-
the caret blinks.
125-
The first value indicates how long the caret stays on,
126-
and the second value how long the caret stays off.
127-
If the second value is ommitted,
128-
it defaults to the same as the first one.
129-
Both values must be zero or more.
123+
Note: This is typically rendered as a blinking caret.
130124

131-
Note: See <a href="http://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]].
125+
<dt><dfn>blink</dfn>
126+
<dd>The UA must display a blinking caret.
127+
For accessibility reasons, and based on user preferences,
128+
The UA may display a non animated caret instead.
132129

133-
If the second value is 0,
134-
or if both values are 0,
135-
the caret does not blink and is always on.
130+
<dt><dfn>none</dfn>
131+
<dd>The UA must not animate the caret.
136132

137-
Note: It is recommended to stop the caret from blinking using ''caret-blink-time: 0''
138-
when applying custom animations using [[CSS3-ANIMATIONS]],
139-
to prevent the blinking and the animation to interfere.
133+
Note: This is only about UA driven animations of the caret.
134+
If CSS animations are used to animate the caret color,
135+
these should still apply normally.
140136

141-
If the first value is 0 and the second is not,
142-
the caret is always off,
143-
making it effectively invisible.
137+
<dt><dfn>fade</dfn>
138+
<dd>The UA must display a caret repeatedly fading in and out,
139+
similarly to ''caret-animation/blink'' except it appears and
140+
disappears progressively rather than suddenly.
141+
For accessibility reasons, and based on user preferences,
142+
The UA may display a non animated caret instead.
143+
</dl>
144144

145-
<div class=example>
146-
The following rule gives a caret that stays on for 1 second,
147-
and off for half a second.
148-
<pre><code class="lang-css">
149-
input { caret-blink-time: 1s 500ms; }
150-
</code></pre>
151-
</div>
145+
Issue: Do we need the accessibility escape hatch on blink and fade?
146+
Would it be enough instead to expect the UI to put
147+
<code>caret-animation:fixed !important</code> in the
148+
user stylesheet when it wants to prevent the caret
149+
from blinking?
150+
151+
The UA determines the speed at which the cursor blinks or fades.
152+
It should follow platform conventions and settings.
153+
154+
Note: It is recommended to stop the caret from blinking or fading
155+
using ''caret-animation: none''
156+
when applying custom animations using [[CSS3-ANIMATIONS]],
157+
to prevent the blinking or fading and the css animation to interfere.
158+
159+
Note: See <a href="http://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]].
152160

153161
<div class=example>
154162
A user who is disturbed by or has adverse reactions to blinking or flashing visuals
@@ -158,7 +166,7 @@ input { caret-blink-time: 1s 500ms; }
158166

159167
<pre><code class="lang-css">
160168
/* prevent the caret from blinking/flashing */
161-
:read-write { caret-blink-time: 0 !important; }
169+
:read-write { caret-animation: none !important; }
162170

163171
/* prevent changes of caret-color, including animations */
164172
:read-write { caret-color:auto !important; }
@@ -180,7 +188,7 @@ for details.
180188
This makes it alternate between 2 colors.
181189
<pre><code class="lang-css">
182190
textarea {
183-
caret-blink-time: 0;
191+
caret-animation: none;
184192
caret-color: blue;
185193
animation: caret-alternate 2s step-end infinite;
186194
}
@@ -225,7 +233,7 @@ means a character with a non-zero advance measure.
225233

226234
<dl dfn-type=value dfn-for=caret-shape>
227235
<dt><dfn>auto</dfn>
228-
<dd>The UA determine the shape of the caret.
236+
<dd>The UA determines the shape of the caret.
229237
It should match platform conventions,
230238
and may be adjusted based on context.
231239
For example, if a UA switches between insert mode and overtype mode when the
@@ -333,7 +341,7 @@ The stacking position of the caret is left undefined, within the following const
333341

334342
<pre class='propdef'>
335343
Name: caret
336-
Value: <<'caret-color'>> || <<'caret-blink-time'>> || <<'caret-shape'>>
344+
Value: <<'caret-color'>> || <<'caret-animation'>> || <<'caret-shape'>>
337345
Initial: auto
338346
Applies to: elements that accept input
339347
Inherited: yes
@@ -344,7 +352,7 @@ Animatable: See individual properties
344352
</pre>
345353

346354
This property is a shorthand for setting
347-
'caret-color', 'caret-blink-time' and 'caret-shape' in one declaration.
355+
'caret-color', 'caret-animation' and 'caret-shape' in one declaration.
348356
Omitted values are set to their initial values.
349357

350358
<div class=example>

0 commit comments

Comments
 (0)