Skip to content

Commit 5189d1f

Browse files
committed
[css-will-change] Add some more notes and clarifications to will-change:contents.
--HG-- extra : rebase_source : db2306cdce4d55b6f8d8e57be3b699a9b0eca04b
1 parent f35b866 commit 5189d1f

2 files changed

Lines changed: 110 additions & 72 deletions

File tree

css-will-change/Overview.bs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,27 @@ Hinting at Future Behavior: the 'will-change' property</h2>
214214
<dd>
215215
Indicates that the author expects to animate or change something about the element's contents in the near future.
216216

217-
<p class='example'>
217+
<div class='example'>
218218
For example, browsers often “cache” rendering of elements over time,
219219
because most things don't change very often,
220220
or only change their position.
221-
However, if an element <em>does</em> change its contents regularly,
221+
However, if an element <em>does</em> change its contents continually,
222222
producing and maintaining this cache is a waste of time.
223223
A browser might take this value as a signal to cache less aggressively on the element,
224224
or avoid caching at all and just continually re-render the element from scratch.
225225

226+
This value is mostly intended to help browsers optimize JS-based animations of content,
227+
which change aspects of an element's contents many times per second.
228+
This kind of optimization, when possible,
229+
is already done automatically by browsers when declarative animations are used.
230+
</div>
231+
232+
Note: This value more-or-less applies to the entire subtree of the element its declared on,
233+
as it indicates the browser should count on *any* of the descendants changing in some way.
234+
Using this on an element “high up” in your document might be very bad for your page's performance;
235+
try to only use this on elements near the “bottom” of your document tree,
236+
containing as little of the document as possible.
237+
226238
<dt><dfn><<custom-ident>></dfn>
227239
<dd>
228240
Indicates that the author expects to animate or change the property with the given name on the element in the near future.

0 commit comments

Comments
 (0)