-
Notifications
You must be signed in to change notification settings - Fork 709
/
Copy pathOverview.html
521 lines (421 loc) · 35 KB
/
Overview.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<!DOCTYPE html><html lang=en><head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title>CSS Will Change Module Level 1</title>
<link href=../default.css rel=stylesheet type=text/css>
<link href=../csslogo.ico rel="shortcut icon" type=image/x-icon>
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
</head>
<body class=h-entry>
<div class=head>
<p data-fill-with=logo><a class=logo href=http://www.w3.org/>
<img alt=W3C height=48 src=https://www.w3.org/Icons/w3c_home width=72>
</a>
</p>
<h1 class="p-name no-ref" id=title>CSS Will Change Module Level 1</h1>
<h2 class="no-num no-toc no-ref heading settled" id=subtitle><span class=content>Editor’s Draft,
<span class=dt-updated><span class=value-title title=20141125>25 November 2014</span></span></span></h2>
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/css-will-change/>http://dev.w3.org/csswg/css-will-change/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-will-change/>http://www.w3.org/TR/css-will-change/</a><dt>Feedback:<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-will-change%5D%20feedback">www-style@w3.org</a> with subject line “<kbd>[css-will-change] <var>… message topic …</var></kbd>” (<a href=http://lists.w3.org/Archives/Public/www-style/ rel=discussion>archives</a>)</span><dt class=editor>Editor:<dd class=editor><div class="p-author h-card vcard"><a class="p-name fn u-url url" href=http://xanthir.com/contact/>Tab Atkins Jr.</a> (<span class="p-org org">Google Inc.</span>)</div></dl></div>
<div data-fill-with=warning></div>
<p class=copyright data-fill-with=copyright><a href=http://www.w3.org/Consortium/Legal/ipr-notice#Copyright>Copyright</a> © 2014 <a href=http://www.w3.org/><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href=http://www.csail.mit.edu/><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href=http://www.ercim.eu/><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href=http://www.keio.ac.jp/>Keio</a>, <a href=http://ev.buaa.edu.cn/>Beihang</a>), All Rights Reserved. W3C <a href=http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer>liability</a>, <a href=http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks>trademark</a> and <a href=http://www.w3.org/Consortium/Legal/copyright-documents>document use</a> rules apply.
</p>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id=abstract><span class=content>Abstract</span></h2>
<div class=p-summary data-fill-with=abstract><p>This document defines the <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> CSS property, which allows an author to inform the UA ahead of time of what kinds of changes they are likely to make to an element. This allows the UA to optimize how they handle the element ahead of time, performing potentially-expensive work preparing for an animation before the animation actually begins.</p>
<a href=http://www.w3.org/TR/CSS/>CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.</div>
<h2 class="no-num no-toc no-ref heading settled" id=status><span class=content>Status of this document</span></h2>
<div data-fill-with=status><p>
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
<p>
The (<a href=http://lists.w3.org/Archives/Public/www-style/>archived</a>) public mailing list
<a href="mailto:www-style@w3.org?Subject=%5Bcss-will-change%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>
(see <a href=http://www.w3.org/Mail/Request>instructions</a>)
is preferred for discussion of this specification.
When sending e-mail,
please put the text “css-will-change” in the subject,
preferably like this:
“[css-will-change] <em>…summary of comment…</em>”
<p>
This document was produced by the <a href=http://www.w3.org/Style/CSS/members>CSS Working Group</a>
(part of the <a href=http://www.w3.org/Style/>Style Activity</a>).
<p>
This document was produced by a group operating under
the <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/>5 February 2004 W3C Patent Policy</a>.
W3C maintains a <a href=http://www.w3.org/2004/01/pp-impl/32061/status rel=disclosure>public list of any patent disclosures</a>
made in connection with the deliverables of the group;
that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual believes contains <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential>Essential Claim(s)</a>
must disclose the information in accordance with <a href=http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure>section 6 of the W3C Patent Policy</a>.
<p>
This document is governed by the <a href=http://www.w3.org/2014/Process-20140801/>1 August 2014 W3C Process Document</a>.
</div>
<div data-fill-with=at-risk></div>
<h2 class="no-num no-toc no-ref heading settled" id=contents><span class=content>Table of Contents</span></h2>
<div data-fill-with=table-of-contents role=navigation><ul class=toc role=directory><li><a href=#intro><span class=secno>1</span> <span class=content>
Introduction</span></a><ul class=toc><li><a href=#using><span class=secno>1.1</span> <span class=content>
Using <span class=property data-link-type=propdesc title=will-change>will-change</span> Well</span></a></ul><li><a href=#will-change><span class=secno>2</span> <span class=content>
Hinting at Future Behavior: the <span class=property data-link-type=propdesc title=will-change>will-change</span> property</span></a><li><a href=#acks><span class=secno>3</span> <span class=content>Acknowledgements</span></a><li><a href=#conformance><span class=secno></span> <span class=content>
Conformance</span></a><ul class=toc><li><a href=#conventions><span class=secno></span> <span class=content>
Document conventions</span></a><li><a href=#conformance-classes><span class=secno></span> <span class=content>
Conformance classes</span></a><li><a href=#partial><span class=secno></span> <span class=content>
Partial implementations</span></a><li><a href=#experimental><span class=secno></span> <span class=content>
Experimental implementations</span></a><li><a href=#testing><span class=secno></span> <span class=content>
Non-experimental implementations</span></a></ul><li><a href=#references><span class=secno></span> <span class=content>References</span></a><ul class=toc><li><a href=#normative><span class=secno></span> <span class=content>Normative References</span></a></ul><li><a href=#index><span class=secno></span> <span class=content>Index</span></a><li><a href=#property-index><span class=secno></span> <span class=content>Property Index</span></a></ul></div>
<main>
<h2 class="heading settled" data-level=1 id=intro><span class=secno>1. </span><span class=content>
Introduction</span><a class=self-link href=#intro></a></h2>
<p>Modern CSS renderers perform a number of complex optimizations in order to render webpages quickly and efficiently.
Unfortunately, employing these optimizations often has a non-trivial start-up cost,
which can have a negative impact on the responsiveness of a page.</p>
<div class=example>
For example, when using CSS 3D Transforms to move an element around the screen,
the element and its contents might be promoted to a “layer”,
where they can render independently from the rest of the page and be composited in later.
This isolates the rendering of the content so that the rest of the page doesn’t have to be rerendered
if the element’s transform is the only thing that changes between frames,
and often provides significant speed benefits.
<p>However, setting up the element in a fresh layer is a relatively expensive operation,
which can delay the start of a <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-transforms-1/#propdef-transform>transform</a> animation by a noticeable fraction of a second.</p>
</div>
<p>The <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> property defined in this specification allows an author to declare ahead-of-time what properties are likely to change in the future,
so the UA can set up the appropriate optimizations some time before they’re needed.
This way, when the actual change happens,
the page updates in a snappy manner.</p>
<h3 class="heading settled" data-level=1.1 id=using><span class=secno>1.1. </span><span class=content>
Using <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> Well</span><a class=self-link href=#using></a></h3>
<p>The <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> property,
like all performance hints,
can be somewhat difficult to learn how to use “properly”,
particularly since it has very little, if any, effect an author can directly detect.
However, there are several simple “Dos and Don’ts”
which hopefully will help develop a good intuition about how to use <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> well.</p>
<h4 class="no-num no-toc heading settled" id=dont-global><span class=content>
Don’t Spam <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> Across Too Many Properties or Elements</span><a class=self-link href=#dont-global></a></h4>
<p>A common initial response to seeing <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> is to assume that code like this is a good idea:</p>
<pre>* { will-change: all; }</pre>
<p>After all, this tells the browser to go ahead and optimize everything,
which has to be good right?</p>
<p>Wrong. The browser <em>already</em> tries as hard as it can to optimize everything.
Telling it to do so explicitly doesn’t help anything,
and in fact has the capacity to do a lot of harm;
some of the stronger optimizations that are likely to be tied to <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a>
end up using a lot of a machine’s resources,
and when overused like this can cause the page to slow down or even crash.</p>
<p>In addition, <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> does have <strong>some</strong> side-effects,
and it’s very unlikely that pages actually want all those side-effects on every element.</p>
<h4 class="no-num no-toc heading settled" id=css-sparingly><span class=content>
Use <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> Sparingly In Stylesheets</span><a class=self-link href=#css-sparingly></a></h4>
<p>Using <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> directly in a stylesheet
implies that the targeted elements are always a few moments away from changing.
This is <em>usually</em> not what you actually mean;
instead, <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> should usually be flipped on and off via scripting
before and after the change occurs (see <a data-section="" href=#dont-waste>
Don’t Waste Resources On Elements That Have Stopped Changing</a>).
However, there are some common circumstances in which it is appropriate to use <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> directly in a stylesheet.</p>
<div class=example>
For example,
specifying <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> for a small number of persistent UI elements in a page
which should react snappily to the user
is appropriate:
<pre>body > .sidebar {
will-change: transform;
/* Will use 'transform' to slide it out
when the user requests. */
}
</pre>
<p>Because this is limited to a small number of elements,
the fact that the optimization is rarely actually used
doesn’t hurt very much.</p>
</div>
<div class=example>
Sometimes an element really <em>does</em> change a property nearly constantly.
Perhaps it responds to the user’s mouse movements,
or just regularly takes some action that causes an animation.
In this case, just declaring the <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> value in the stylesheet is fine,
as it accurately describes that the element will regularly/constantly change,
and so should be kept optimized.
<pre>.cats-flying-around-the-screen {
will-change: left, top;
}
</pre>
</div>
<h4 class="no-num no-toc heading settled" id=give-time><span class=content>
Give <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> Sufficient Time To Work</span><a class=self-link href=#give-time></a></h4>
<p>Another common bad pattern is to apply <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> to an element
<em>immediately</em> before starting the animation or property change that it’s meant to help with.
Unfortunately, most of those optimizations need time to be applied,
and so they don’t have enough time to set-up when this is done,
and the <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> has little to no effect.
Instead, find some way to predict at least slightly ahead of time that something will change,
and set <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> <em>then</em>.</p>
<div class=example>
For example,
if an element is going to change when a user clicks on it,
setting <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> on hover will usually give at least 200 milliseconds
for the optimizations to be set up,
as human reaction time is relatively slow.
This can be done either via scripting,
or rather simply with a CSS rule:
<pre>.element { transition: opacity .2s; opacity: 1; }
.element:hover { will-change: opacity; }
.element:active { opacity: .3; }
</pre>
<p>However, a rule like that is useless if the effect is going to happen on hover.
In cases like these, it is often still possible to find some way to predict the action before it occurs.
For example, hovering an ancestor may give enough lead time:</p>
<pre>.element { transition: opacity .2s; opacity: 1; }
.container:hover > .element { will-change: opacity; }
.element:hover { opacity: .3; }
</pre>
</div>
<h4 class="no-num no-toc heading settled" id=dont-waste><span class=content>
Don’t Waste Resources On Elements That Have Stopped Changing</span><a class=self-link href=#dont-waste></a></h4>
<p>Because the optimizations browsers use for changing some properties are expensive,
browsers remove them and revert to normal behavior as soon as they can in normal circumstances.
However, <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> will generally override this behavior,
maintaining the optimizations for much longer than the browser would otherwise do.</p>
<p>As such, whenever you add <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> to an element,
especially via scripting,
don’t forget to <em>remove</em> it after the element is done changing,
so the browser can recover whatever resources the optimizations are claiming.</p>
<h2 class="heading settled" data-level=2 id=will-change><span class=secno>2. </span><span class=content>
Hinting at Future Behavior: the <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> property</span><a class=self-link href=#will-change></a></h2>
<table class="definition propdef"><tr><th>Name:<td><dfn class=css data-dfn-type=property data-export="" id=propdef-will-change>will-change<a class=self-link href=#propdef-will-change></a></dfn><tr><th>Value:<td class=prod>auto <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one>|</a> <a class="production css" data-link-type=type href=#typedef-animateable-feature><animateable-feature></a><a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#mult-comma>#</a><tr><th>Initial:<td>auto<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>no<tr><th>Percentages:<td>n/a<tr><th>Media:<td>all<tr><th>Computed value:<td>specified value<tr><th>Animatable:<td>no</table>
<pre class=prod><dfn data-dfn-type=type data-export="" id=typedef-animateable-feature><animateable-feature><a class=self-link href=#typedef-animateable-feature></a></dfn> = scroll-position <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one>|</a> contents <a data-link-for="" data-link-type=grammar href=http://dev.w3.org/csswg/css-values-3/#comb-one>|</a> <a class=production data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#identifier-value><custom-ident></a></pre>
<p>The <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> property provides a rendering hint to the user agent,
stating what kinds of changes the author expects to perform on the element.
This allows the user agent to perform ahead-of-time any optimizations necessary for rendering those changes smoothly,
avoiding “jank” when the author does begin changing or animating that feature.</p>
<div class=note role=note>
Different browsers can use the information from <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> in different ways,
and even a single browser might use it in different ways at different time.
For example, a browser that promotes elements to their own “GPU layer”
when they have <a class=css data-link-type=propdesc href=#propdef-will-change title=will-change>will-change: transform</a> specified
might avoid doing that when there are <em>too many</em> elements declaring that,
to avoid exhausting GPU memory.
</div>
<p>Values have the following meanings:</p>
<dl data-dfn-for=will-change data-dfn-type=value>
<dt><dfn class=css data-dfn-for=will-change data-dfn-type=value data-export="" id=valdef-will-change-auto>auto<a class=self-link href=#valdef-will-change-auto></a></dfn>
<dd>
Expresses no particular intent;
the user agent should apply whatever heuristics and optimizations it normally does.
<dt><dfn class=css data-dfn-for=will-change data-dfn-type=value data-export="" id=valdef-will-change-scroll-position>scroll-position<a class=self-link href=#valdef-will-change-scroll-position></a></dfn>
<dd>
Indicates that the author expects to animate or change the scroll position of the element in the near future.
<p class=example>
For example, browsers often only render the content in the "scroll window" on a scrollable element,
and some of the content past that window,
balancing memory and time savings from the skipped rendering against making scrolling look nice.
A browser might take this value as a signal to expand the range of content around the scroll window that is rendered,
so that longer/faster scrolls can be done smoothly.
<dt><dfn class=css data-dfn-for=will-change data-dfn-type=value data-export="" id=valdef-will-change-contents>contents<a class=self-link href=#valdef-will-change-contents></a></dfn>
<dd>
Indicates that the author expects to animate or change something about the element’s contents in the near future.
<div class=example>
For example, browsers often “cache” rendering of elements over time,
because most things don’t change very often,
or only change their position.
However, if an element <em>does</em> change its contents continually,
producing and maintaining this cache is a waste of time.
A browser might take this value as a signal to cache less aggressively on the element,
or avoid caching at all and just continually re-render the element from scratch.
<p>This value is mostly intended to help browsers optimize JS-based animations of content,
which change aspects of an element’s contents many times per second.
This kind of optimization, when possible,
is already done automatically by browsers when declarative animations are used.</p>
</div>
<p class=note role=note>Note: This value more-or-less applies to the entire subtree of the element its declared on,
as it indicates the browser should count on *any* of the descendants changing in some way.
Using this on an element “high up” in your document might be very bad for your page’s performance;
try to only use this on elements near the “bottom” of your document tree,
containing as little of the document as possible.</p>
<dt><dfn class=css data-dfn-for=will-change data-dfn-type=value data-export="" id=valdef-will-change-custom-ident><a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#identifier-value><custom-ident></a><a class=self-link href=#valdef-will-change-custom-ident></a></dfn>
<dd>
Indicates that the author expects to animate or change the property with the given name on the element in the near future.
If the property given is a shorthand,
it indicates the expectation for all the longhands the shorthand expands to.
<p class=example>
For example, setting <a class=css data-link-type=propdesc href=#propdef-will-change title=will-change>will-change: background;</a>
is identical to setting <a class=css data-link-type=propdesc href=#propdef-will-change title=will-change>will-change: background-image, background-position, ...</a>
for all the properties that <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#background>background</a> expands into.
<p>The <a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#identifier-value><custom-ident></a> production used here excludes the keywords <span class=css>will-change</span>, <span class=css>none</span>, <span class=css>all</span>, <a class=css data-link-type=maybe href=#valdef-will-change-auto>auto</a>, <a class=css data-link-type=maybe href=#valdef-will-change-scroll-position>scroll-position</a>, and <a class=css data-link-type=maybe href=#valdef-will-change-contents>contents</a>,
in addition to the keywords normally excluded from <a class="production css" data-link-type=type href=http://dev.w3.org/csswg/css-values-3/#identifier-value><custom-ident></a>.</p>
<p class=note role=note>Note: Note that most properties will have no effect when specified,
as the user agent doesn’t perform any special optimizations for changes in most properties.
It is still <em>safe</em> to specify them, though;
it’ll simply have no effect.</p>
<p class=example>
For example, browsers often handle elements with <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-transforms-1/#propdef-transform>transform</a> set to a non-initial value very differently from normal elements,
perhaps rendering them to their own “GPU layer”
or using other mechanisms to make it easier to quickly make the sort of transformations that <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-transforms-1/#propdef-transform>transform</a> can produce.
A browser might take a value of <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-transforms-1/#propdef-transform>transform</a> as a signal
that it should go ahead and promote the element to its own layer immediately,
before the element starts to be transformed,
to avoid any delay involved in rerendering the old and new layers.
<p>If any non-initial value of a property would create a stacking context on the element,
specifying that property in <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> must create a stacking context on the element.</p>
<p>If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements,
specifying that property in <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> must cause the element to generate a containing block for fixed-position elements.</p>
<p>If a non-initial value of a property would cause rendering differences on the element
(such as using a different anti-aliasing strategy for text),
the user agent should use that alternate rendering when the property is specified in <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a>,
to avoid sudden rendering differences when the property is eventually changed.</p>
<p class=example>
For example, setting <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#opacity>opacity</a> to any value other than <span class=css>1</span> creates a stacking context on the element.
Thus, setting <a class=css data-link-type=propdesc href=#propdef-will-change title=will-change>will-change: opacity</a> also creates a stacking context,
even if <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#opacity>opacity</a> is <em>currently</em> still equal to <span class=css>1</span>.
</dl>
<p>The <a class=property data-link-type=propdesc href=#propdef-will-change>will-change</a> property has no <em>direct</em> effect on the element it is specified on,
beyond the creation of stacking contexts and containing blocks as specified above.
It is solely a rendering hint to the user agent,
allowing it set up potentially-expensive optimizations for certain types of changes
before the changes actually start occurring.</p>
<h2 class="heading settled" data-level=3 id=acks><span class=secno>3. </span><span class=content>Acknowledgements</span><a class=self-link href=#acks></a></h2>
<p>Thanks to Benoit Gerard for originally suggesting the <span class=css>will-animate</span> property,
and doing a lot of the initial design work.</p>
</main>
<h2 class="no-ref no-num heading settled" id=conformance><span class=content>
Conformance</span><a class=self-link href=#conformance></a></h2>
<h3 class="no-ref heading settled" id=conventions><span class=content>
Document conventions</span><a class=self-link href=#conventions></a></h3>
<p>Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words "MUST",
"MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
<p>All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes. <a data-biblio-type=normative data-link-type=biblio href=#biblio-rfc2119 title=RFC2119>[RFC2119]</a></p>
<p>Examples in this specification are introduced with the words "for example"
or are set apart from the normative text with <code>class="example"</code>,
like this:
<div class=example>
<p>This is an example of an informative example.</p>
</div>
<p>Informative notes begin with the word "Note" and are set apart from the
normative text with <code>class="note"</code>, like this:
<p class=note role=note>Note, this is an informative note.</p>
<p>Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with <code><strong class="advisement"></code>, like
this:
<strong class=advisement>
UAs MUST provide an accessible alternative.
</strong>
<h3 class="no-ref heading settled" id=conformance-classes><span class=content>
Conformance classes</span><a class=self-link href=#conformance-classes></a></h3>
<p>Conformance to this specification
is defined for three conformance classes:
<dl>
<dt>style sheet
<dd>A <a href=http://www.w3.org/TR/CSS21/conform.html#style-sheet>CSS
style sheet</a>.
<dt>renderer
<dd>A <a href=http://www.w3.org/TR/CSS21/conform.html#user-agent>UA</a>
that interprets the semantics of a style sheet and renders
documents that use them.
<dt>authoring tool
<dd>A <a href=http://www.w3.org/TR/CSS21/conform.html#user-agent>UA</a>
that writes a style sheet.
</dl>
<p>A style sheet is conformant to this specification
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module.
<p>A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.)
<p>An authoring tool is conformant to this specification
if it writes style sheets that are syntactically correct according to the
generic CSS grammar and the individual grammars of each feature in
this module, and meet all other conformance requirements of style sheets
as described in this module.
<h3 class="no-ref heading settled" id=partial><span class=content>
Partial implementations</span><a class=self-link href=#partial></a></h3>
<p>So that authors can exploit the forward-compatible parsing rules to
assign fallback values, CSS renderers <strong>must</strong>
treat as invalid (and <a href=http://www.w3.org/TR/CSS21/conform.html#ignore>ignore
as appropriate</a>) any at-rules, properties, property values, keywords,
and other syntactic constructs for which they have no usable level of
support. In particular, user agents <strong>must not</strong> selectively
ignore unsupported component values and honor supported values in a single
multi-value property declaration: if any value is considered invalid
(as unsupported values must be), CSS requires that the entire declaration
be ignored.</p>
<h3 class="no-ref heading settled" id=experimental><span class=content>
Experimental implementations</span><a class=self-link href=#experimental></a></h3>
<p>To avoid clashes with future CSS features, the CSS2.1 specification
reserves a <a href=http://www.w3.org/TR/CSS21/syndata.html#vendor-keywords>prefixed
syntax</a> for proprietary and experimental extensions to CSS.
<p>Prior to a specification reaching the Candidate Recommendation stage
in the W3C process, all implementations of a CSS feature are considered
experimental. The CSS Working Group recommends that implementations
use a vendor-prefixed syntax for such features, including those in
W3C Working Drafts. This avoids incompatibilities with future changes
in the draft.
</p>
<h3 class="no-ref heading settled" id=testing><span class=content>
Non-experimental implementations</span><a class=self-link href=#testing></a></h3>
<p>Once a specification reaches the Candidate Recommendation stage,
non-experimental implementations are possible, and implementors should
release an unprefixed implementation of any CR-level feature they
can demonstrate to be correctly implemented according to spec.
<p>To establish and maintain the interoperability of CSS across
implementations, the CSS Working Group requests that non-experimental
CSS renderers submit an implementation report (and, if necessary, the
testcases used for that implementation report) to the W3C before
releasing an unprefixed implementation of any CSS features. Testcases
submitted to W3C are subject to review and correction by the CSS
Working Group.
<p>Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group’s website at
<a href=http://www.w3.org/Style/CSS/Test/>http://www.w3.org/Style/CSS/Test/</a>.
Questions should be directed to the
<a href=http://lists.w3.org/Archives/Public/public-css-testsuite>public-css-testsuite@w3.org</a>
mailing list.
<h2 class="no-num heading settled" id=references><span class=content>References</span><a class=self-link href=#references></a></h2><h3 class="no-num heading settled" id=normative><span class=content>Normative References</span><a class=self-link href=#normative></a></h3><dl><dt id=biblio-rfc2119 title=rfc2119><a class=self-link href=#biblio-rfc2119></a>[rfc2119]<dd>S. Bradner. <a href=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl><h2 class="no-num heading settled" id=index><span class=content>Index</span><a class=self-link href=#index></a></h2><ul class=indexlist><li><animateable-feature>, <a href=#typedef-animateable-feature title="section 2">2</a><li>auto, <a href=#valdef-will-change-auto title="section 2">2</a><li>contents, <a href=#valdef-will-change-contents title="section 2">2</a><li><custom-ident>, <a href=#valdef-will-change-custom-ident title="section 2">2</a><li>scroll-position, <a href=#valdef-will-change-scroll-position title="section 2">2</a><li>will-change, <a href=#propdef-will-change title="section 2">2</a></ul><h2 class="no-num heading settled" id=property-index><span class=content>Property Index</span><a class=self-link href=#property-index></a></h2><table class="proptable data"><thead><tr><th scope=col>Name<th scope=col>Value<th scope=col>Initial<th scope=col>Applies to<th scope=col>Inh.<th scope=col>%ages<th scope=col>Media<th scope=col>Animatable<th scope=col>Computed value<tbody><tr><th scope=row><a class=css data-link-type=property href=#propdef-will-change>will-change</a><td>auto | <animateable-feature>#<td>auto<td>all elements<td>no<td>n/a<td>all<td>no<td>specified value</table>