W3C home > Mailing lists > Public > www-style@w3.org > December 2013

Re: Proposal: will-animate property

From: Robert O'Callahan <robert@ocallahan.org>
Date: Tue, 3 Dec 2013 09:33:50 +1300
Message-ID: <CAOp6jLYsxdwxKYdB+5RxZwj=EZGmtyVuysmbQ+k2Nz8a9woHQw@mail.gmail.com>
To: Dirk Schulze <dschulze@adobe.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, Benoit Girard <bgirard@mozilla.com>, Ali Juma <ajuma@chromium.org>, Matt Woodrow <matt@mozilla.com>, Cameron McCormack <cmccormack@mozilla.com>, www-style <www-style@w3.org>, "Tab Atkins Jr." <jackalmage@gmail.com>
On Mon, Dec 2, 2013 at 11:56 PM, Dirk Schulze <dschulze@adobe.com> wrote:

> Cameron mentioned that SVG 1.2 Tiny introduced the ‘buffered-rendering’
> property. At the time of writing this specification, the property seemed to
> be a good idea. As implementations evolved, the hint could not provide any
> additional value to implementations like WebKit and Gecko.
>

'buffered-rendering' is not the right level of abstraction; it's too
strongly tied to a particular implementation detail.

That said, there are situations where we could benefit from
'buffered-rendering' or 'will-animate', and I think there always will be. I
can't think of a heuristic that will capture the case where a fresh page is
loaded, JS picks a normal-looking element from the DOM and sets its inline
opacity or transform style.
(I've thought a lot about more advanced heuristics, like examining
selectors in the page's stylesheets to see which elements could potentially
have CSS animations or transitions triggered if a class is applied, for
example. But advanced heuristics are difficult to implement and very
difficult for authors to understand. You also run into the problem of the
rendering potentially being different when an element is in a stacking
context vs when it is not.) Predicting the future behavior of programs is
an intrinsically hard problem.

As soon as we speak about creating a stacking context - so change of actual
> behavior - it could suddenly turn into a burden for the future.
>

That is true. However, properties that induce stacking contexts are
numerous and one more is a very minor burden.

Beside that, it is unclear if authors are using the property correctly. My
> assumption is that quite often authors will use the property because they
> are told to use it. This can cause problems similar to the use of
> translateZ(0) today. Authors use translateZ(0) to HW accelerate their
> content. Sadly quite often the content is to huge for buffering it on the
> GPU which can cause massive slowdowns and (sometimes) even crashes of the
> browser.
>

Authors will definitely abuse 'will-animate'. We will need to provide
guidance for appropriate use of 'will-animate' and come up with anti-abuse
heuristics.

I think we'll be telling authors to minimize the number of elements to
which they apply 'will-animate' (perhaps by adding 'will-animate' shortly
before the animation starts), and to ensure those elements are not much
bigger than the viewport, and that if these constraints are violated we
will stop optimizing 'will-animate' on some of the elements, or all of the
elements, or even the entire domain.

Last but not least, implementations have different compositors with
> different needs. It seems unclear if all implementations can benefit the
> same way in all situations. It could very well be that some implementations
> benefit differently which causes a higher diversity on performance across
> implementations. It could even happen that a performance boost by the hint
> on one implementation could cause the opposite effect on another platform.
>

That's true for a property like 'buffered-rendering' that appears to force
a particular implementation. But 'will-animate' is the right level of
abstraction to give the implementation the information it needs to make the
right decision. If the decision is "we don't need to do anything special to
handle animation of this property", that's fine.

Rob
-- 
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w
Received on Monday, 2 December 2013 20:34:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:17 UTC