The default bug view has changed. See this FAQ.

Help CSS authors diagnose why animations aren't async

RESOLVED FIXED in mozilla17

Status

()

Core
Layout
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dzbarsky, Assigned: dzbarsky)

Tracking

unspecified
mozilla17
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
Created attachment 647803 [details] [diff] [review]
Patch
Assignee: nobody → dzbarsky
Status: NEW → ASSIGNED
Attachment #647803 - Flags: review?(jones.chris.g)
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.
Attachment #647803 - Flags: review?(jones.chris.g)
(Assignee)

Comment 3

5 years ago
Created attachment 648053 [details] [diff] [review]
Patch
Attachment #647803 - Attachment is obsolete: true
Attachment #648053 - Flags: review?(jones.chris.g)
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.
Attachment #648053 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/8bdecf300a07
https://hg.mozilla.org/mozilla-central/rev/8bdecf300a07
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.