Last Comment Bug 779385 - Help CSS authors diagnose why animations aren't async
: Help CSS authors diagnose why animations aren't async
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: David Zbarsky (:dzbarsky)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-31 18:26 PDT by David Zbarsky (:dzbarsky)
Modified: 2012-08-03 07:32 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (2.97 KB, patch)
2012-07-31 18:27 PDT, David Zbarsky (:dzbarsky)
no flags Details | Diff | Review
Patch (2.45 KB, patch)
2012-08-01 13:06 PDT, David Zbarsky (:dzbarsky)
cjones.bugs: review+
Details | Diff | Review

Description David Zbarsky (:dzbarsky) 2012-07-31 18:26:46 PDT

    
Comment 1 David Zbarsky (:dzbarsky) 2012-07-31 18:27:43 PDT
Created attachment 647803 [details] [diff] [review]
Patch
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-01 00:31:25 PDT
Comment on attachment 647803 [details] [diff] [review]
Patch

>diff --git a/layout/style/AnimationCommon.cpp b/layout/style/AnimationCommon.cpp

>+#include "prenv.h"
>+#include "nsIConsoleService.h"
>+#include "nsServiceManagerUtils.h"

Don't need any of these.
 
> bool
> CommonElementAnimationData::CanAnimatePropertyOnCompositor(const dom::Element *aElement,
>                                                            nsCSSProperty aProperty)
> {
>+  bool shouldLog = PR_GetEnv("MOZ_LOG_OMTA");

Make this a cached pref.

>+      console->LogStringMessage(
>+        NS_LITERAL_STRING("Cannot OMTA opacity because opacity animations are disabled").get());

Since we're cutting corners here, let's not give the wrong impression
by logging this on the console.  Instead, if the pref is set, write
with printf_stderr(...).  (That goes to logcat on android.)

I'm not a big fan of this message.  How about,

 Performance warning: Async animation of 'opacity' is disabled

>+          NS_LITERAL_STRING("Cannot OMTA transform because of preserve-3d").get());

 Gecko bug: Async animation of 'preserve-3d' transforms is not supported.  See bug XXXXXX.

>+          NS_LITERAL_STRING("Cannot OMTA transform because frame has SVG transform").get());

 Gecko bug: Async 'transform' animations of frames with SVG transforms is not supported.  See bug XXXXXX.

>+        NS_LITERAL_STRING("Cannot OMTA transform because transform animations are disabled").get());

 Performance warning: Async animation of 'transform' is disabled

>+    const nsAFlatCString propName = nsCSSProps::GetStringValue(aProperty);
>+    nsCString message;
>+    message += "Cannot OMTA animation due to property: ";
>+    message += propName;
>+    console->LogStringMessage(NS_ConvertUTF8toUTF16(message).get());

 Performance warning: Async animation cancelled because of unsupported property '%s'

Where do we warn about disabling animations because the underlying
frame isn't hitting our prerender optimization?  That would be very
useful.
Comment 3 David Zbarsky (:dzbarsky) 2012-08-01 13:06:17 PDT
Created attachment 648053 [details] [diff] [review]
Patch
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-08-01 18:44:14 PDT
Comment on attachment 648053 [details] [diff] [review]
Patch

>diff --git a/layout/style/AnimationCommon.cpp b/layout/style/AnimationCommon.cpp

> bool
> CommonElementAnimationData::CanAnimatePropertyOnCompositor(const dom::Element *aElement,
>                                                            nsCSSProperty aProperty)
> {
>+  static bool sShouldLog;
>+  static bool sShouldLogPrefCached = false;

This is automatically initialized, can remove the assignment.

r=me with that.
Comment 5 David Zbarsky (:dzbarsky) 2012-08-02 23:33:05 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/8bdecf300a07
Comment 6 Ed Morley [:emorley] 2012-08-03 07:32:01 PDT
https://hg.mozilla.org/mozilla-central/rev/8bdecf300a07

Note You need to log in before you can comment on or make changes to this bug.