зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1216030 - Part 6: Add KeyframeEffectReadOnly::IsGeometricProperty. r=bbirtles
This method will be private soon.
This commit is contained in:
Родитель
74c73fa482
Коммит
84322d36f1
|
@ -1710,6 +1710,23 @@ KeyframeEffectReadOnly::GetFrames(JSContext*& aCx,
|
|||
}
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
KeyframeEffectReadOnly::IsGeometricProperty(
|
||||
const nsCSSProperty aProperty)
|
||||
{
|
||||
switch (aProperty) {
|
||||
case eCSSProperty_bottom:
|
||||
case eCSSProperty_height:
|
||||
case eCSSProperty_left:
|
||||
case eCSSProperty_right:
|
||||
case eCSSProperty_top:
|
||||
case eCSSProperty_width:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
KeyframeEffectReadOnly::CanAnimateTransformOnCompositor(
|
||||
const nsIFrame* aFrame,
|
||||
|
|
|
@ -284,6 +284,7 @@ public:
|
|||
// If |aContent| is nullptr, no logging is performed
|
||||
static bool CanAnimateTransformOnCompositor(const nsIFrame* aFrame,
|
||||
const nsIContent* aContent);
|
||||
static bool IsGeometricProperty(const nsCSSProperty aProperty);
|
||||
protected:
|
||||
virtual ~KeyframeEffectReadOnly();
|
||||
void ResetIsRunningOnCompositor();
|
||||
|
|
|
@ -35,22 +35,6 @@ using mozilla::dom::KeyframeEffectReadOnly;
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
/* static */ bool
|
||||
IsGeometricProperty(nsCSSProperty aProperty)
|
||||
{
|
||||
switch (aProperty) {
|
||||
case eCSSProperty_bottom:
|
||||
case eCSSProperty_height:
|
||||
case eCSSProperty_left:
|
||||
case eCSSProperty_right:
|
||||
case eCSSProperty_top:
|
||||
case eCSSProperty_width:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
CommonAnimationManager::CommonAnimationManager(nsPresContext *aPresContext)
|
||||
: mPresContext(aPresContext)
|
||||
{
|
||||
|
@ -448,7 +432,7 @@ AnimationCollection::CanAnimatePropertyOnCompositor(
|
|||
{
|
||||
bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
|
||||
|
||||
if (IsGeometricProperty(aProperty)) {
|
||||
if (KeyframeEffectReadOnly::IsGeometricProperty(aProperty)) {
|
||||
if (shouldLog) {
|
||||
nsCString message;
|
||||
message.AppendLiteral("Performance warning: Async animation of "
|
||||
|
|
|
@ -37,8 +37,6 @@ namespace mozilla {
|
|||
class RestyleTracker;
|
||||
struct AnimationCollection;
|
||||
|
||||
bool IsGeometricProperty(nsCSSProperty aProperty);
|
||||
|
||||
class CommonAnimationManager : public nsIStyleRuleProcessor {
|
||||
public:
|
||||
explicit CommonAnimationManager(nsPresContext *aPresContext);
|
||||
|
|
Загрузка…
Ссылка в новой задаче