зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset a4fb4e4b1c8b (bug 1180125)
This commit is contained in:
Родитель
132cd4706c
Коммит
c86b8ab1b4
|
@ -527,7 +527,7 @@ Animation::CanThrottle() const
|
|||
}
|
||||
|
||||
void
|
||||
Animation::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
|
||||
Animation::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties,
|
||||
bool& aNeedsRefreshes)
|
||||
{
|
||||
|
@ -1046,7 +1046,7 @@ Animation::GetPresContext() const
|
|||
AnimationCollection*
|
||||
Animation::GetCollection() const
|
||||
{
|
||||
CommonAnimationManager* manager = GetAnimationManager();
|
||||
css::CommonAnimationManager* manager = GetAnimationManager();
|
||||
if (!manager) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -35,10 +35,11 @@ class nsIDocument;
|
|||
class nsPresContext;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
struct AnimationCollection;
|
||||
namespace css {
|
||||
class AnimValuesStyleRule;
|
||||
class CommonAnimationManager;
|
||||
} // namespace css
|
||||
|
||||
namespace dom {
|
||||
|
||||
|
@ -291,7 +292,7 @@ public:
|
|||
* the style rule on the next refresh driver tick as well (because it
|
||||
* is running and has an effect to sample).
|
||||
*/
|
||||
void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
|
||||
void ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties,
|
||||
bool& aNeedsRefreshes);
|
||||
protected:
|
||||
|
@ -340,7 +341,7 @@ protected:
|
|||
|
||||
nsIDocument* GetRenderedDocument() const;
|
||||
nsPresContext* GetPresContext() const;
|
||||
virtual CommonAnimationManager* GetAnimationManager() const = 0;
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const = 0;
|
||||
AnimationCollection* GetCollection() const;
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> mGlobal;
|
||||
|
|
|
@ -299,8 +299,9 @@ KeyframeEffectReadOnly::HasAnimationOfProperties(
|
|||
}
|
||||
|
||||
void
|
||||
KeyframeEffectReadOnly::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties)
|
||||
KeyframeEffectReadOnly::ComposeStyle(
|
||||
nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties)
|
||||
{
|
||||
ComputedTiming computedTiming = GetComputedTiming();
|
||||
|
||||
|
@ -369,7 +370,7 @@ KeyframeEffectReadOnly::ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
|
|||
|
||||
if (!aStyleRule) {
|
||||
// Allocate the style rule now that we know we have animation data.
|
||||
aStyleRule = new AnimValuesStyleRule();
|
||||
aStyleRule = new css::AnimValuesStyleRule();
|
||||
}
|
||||
|
||||
double positionInSegment =
|
||||
|
|
|
@ -26,8 +26,9 @@ struct JSContext;
|
|||
class nsCSSPropertySet;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
namespace css {
|
||||
class AnimValuesStyleRule;
|
||||
} // namespace css
|
||||
|
||||
/**
|
||||
* Input timing parameters.
|
||||
|
@ -318,7 +319,7 @@ public:
|
|||
// Animation for the current time except any properties already contained
|
||||
// in |aSetProperties|.
|
||||
// Any updated properties are added to |aSetProperties|.
|
||||
void ComposeStyle(nsRefPtr<AnimValuesStyleRule>& aStyleRule,
|
||||
void ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
|
||||
nsCSSPropertySet& aSetProperties);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -963,7 +963,7 @@ RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
|
|||
#ifdef DEBUG
|
||||
// reget frame from content since it may have been regenerated...
|
||||
if (changeData->mContent) {
|
||||
if (!CommonAnimationManager::ContentOrAncestorHasAnimation(changeData->mContent)) {
|
||||
if (!css::CommonAnimationManager::ContentOrAncestorHasAnimation(changeData->mContent)) {
|
||||
nsIFrame* frame = changeData->mContent->GetPrimaryFrame();
|
||||
if (frame) {
|
||||
DebugVerifyStyleTree(frame);
|
||||
|
@ -2625,7 +2625,7 @@ ElementRestyler::AddLayerChangesForAnimation()
|
|||
RestyleManager::GetMaxAnimationGenerationForFrame(mFrame);
|
||||
|
||||
nsChangeHint hint = nsChangeHint(0);
|
||||
const auto& layerInfo = CommonAnimationManager::sLayerAnimationInfo;
|
||||
const auto& layerInfo = css::CommonAnimationManager::sLayerAnimationInfo;
|
||||
for (size_t i = 0; i < ArrayLength(layerInfo); i++) {
|
||||
Layer* layer =
|
||||
FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo[i].mLayerType);
|
||||
|
|
|
@ -310,7 +310,7 @@ nsLayoutStatics::Initialize()
|
|||
|
||||
#ifdef DEBUG
|
||||
nsStyleContext::Initialize();
|
||||
mozilla::CommonAnimationManager::Initialize();
|
||||
mozilla::css::CommonAnimationManager::Initialize();
|
||||
#endif
|
||||
|
||||
MediaDecoder::InitStatics();
|
||||
|
|
|
@ -51,6 +51,8 @@ IsGeometricProperty(nsCSSProperty aProperty)
|
|||
}
|
||||
}
|
||||
|
||||
namespace css {
|
||||
|
||||
CommonAnimationManager::CommonAnimationManager(nsPresContext *aPresContext)
|
||||
: mPresContext(aPresContext)
|
||||
, mIsObservingRefreshDriver(false)
|
||||
|
@ -438,7 +440,7 @@ CommonAnimationManager::LayerAnimationRecordFor(nsCSSProperty aProperty)
|
|||
/* static */ void
|
||||
CommonAnimationManager::Initialize()
|
||||
{
|
||||
const auto& info = CommonAnimationManager::sLayerAnimationInfo;
|
||||
const auto& info = css::CommonAnimationManager::sLayerAnimationInfo;
|
||||
for (size_t i = 0; i < ArrayLength(info); i++) {
|
||||
auto record = info[i];
|
||||
MOZ_ASSERT(nsCSSProps::PropHasFlags(record.mProperty,
|
||||
|
@ -532,6 +534,8 @@ AnimValuesStyleRule::List(FILE* out, int32_t aIndent) const
|
|||
}
|
||||
#endif
|
||||
|
||||
} // namespace css
|
||||
|
||||
bool
|
||||
AnimationCollection::CanAnimatePropertyOnCompositor(
|
||||
const dom::Element *aElement,
|
||||
|
@ -693,7 +697,7 @@ AnimationCollection::PostUpdateLayerAnimations()
|
|||
CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR) &&
|
||||
!propsHandled.HasProperty(prop)) {
|
||||
propsHandled.AddProperty(prop);
|
||||
nsChangeHint changeHint = CommonAnimationManager::
|
||||
nsChangeHint changeHint = css::CommonAnimationManager::
|
||||
LayerAnimationRecordFor(prop)->mChangeHint;
|
||||
dom::Element* element = GetElementToRestyle();
|
||||
if (element) {
|
||||
|
@ -918,7 +922,7 @@ AnimationCollection::CanThrottleAnimation(TimeStamp aTime)
|
|||
}
|
||||
|
||||
|
||||
const auto& info = CommonAnimationManager::sLayerAnimationInfo;
|
||||
const auto& info = css::CommonAnimationManager::sLayerAnimationInfo;
|
||||
for (size_t i = 0; i < ArrayLength(info); i++) {
|
||||
auto record = info[i];
|
||||
if (!HasAnimationOfProperty(record.mProperty)) {
|
||||
|
|
|
@ -35,6 +35,8 @@ namespace mozilla {
|
|||
class RestyleTracker;
|
||||
struct AnimationCollection;
|
||||
|
||||
namespace css {
|
||||
|
||||
bool IsGeometricProperty(nsCSSProperty aProperty);
|
||||
|
||||
class CommonAnimationManager : public nsIStyleRuleProcessor,
|
||||
|
@ -55,9 +57,9 @@ public:
|
|||
#ifdef MOZ_XUL
|
||||
virtual void RulesMatching(XULTreeRuleProcessorData* aData) override;
|
||||
#endif
|
||||
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
|
||||
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
const MOZ_MUST_OVERRIDE override;
|
||||
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
|
||||
const MOZ_MUST_OVERRIDE override;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -75,7 +77,7 @@ public:
|
|||
// Tell the restyle tracker about all the styles that we're currently
|
||||
// animating, so that it can update the animation rule for these
|
||||
// elements.
|
||||
void AddStyleUpdatesTo(RestyleTracker& aTracker);
|
||||
void AddStyleUpdatesTo(mozilla::RestyleTracker& aTracker);
|
||||
|
||||
AnimationCollection*
|
||||
GetAnimations(dom::Element *aElement,
|
||||
|
@ -104,13 +106,13 @@ public:
|
|||
Cannot_Throttle
|
||||
};
|
||||
|
||||
nsIStyleRule* GetAnimationRule(dom::Element* aElement,
|
||||
nsIStyleRule* GetAnimationRule(mozilla::dom::Element* aElement,
|
||||
nsCSSPseudoElements::Type aPseudoType);
|
||||
|
||||
static bool ExtractComputedValueForTransition(
|
||||
nsCSSProperty aProperty,
|
||||
nsStyleContext* aStyleContext,
|
||||
StyleAnimationValue& aComputedValue);
|
||||
mozilla::StyleAnimationValue& aComputedValue);
|
||||
|
||||
// For CSS properties that may be animated on a separate layer, represents
|
||||
// a record of the corresponding layer type and change hint.
|
||||
|
@ -136,7 +138,7 @@ protected:
|
|||
virtual ~CommonAnimationManager();
|
||||
|
||||
// For ElementCollectionRemoved
|
||||
friend struct AnimationCollection;
|
||||
friend struct mozilla::AnimationCollection;
|
||||
|
||||
void AddElementCollection(AnimationCollection* aCollection);
|
||||
void ElementCollectionRemoved() { MaybeStartOrStopObservingRefreshDriver(); }
|
||||
|
@ -197,14 +199,15 @@ public:
|
|||
virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
|
||||
#endif
|
||||
|
||||
void AddValue(nsCSSProperty aProperty, StyleAnimationValue &aStartValue)
|
||||
void AddValue(nsCSSProperty aProperty,
|
||||
mozilla::StyleAnimationValue &aStartValue)
|
||||
{
|
||||
PropertyValuePair v = { aProperty, aStartValue };
|
||||
mPropertyValuePairs.AppendElement(v);
|
||||
}
|
||||
|
||||
// Caller must fill in returned value.
|
||||
StyleAnimationValue* AddEmptyValue(nsCSSProperty aProperty)
|
||||
mozilla::StyleAnimationValue* AddEmptyValue(nsCSSProperty aProperty)
|
||||
{
|
||||
PropertyValuePair *p = mPropertyValuePairs.AppendElement();
|
||||
p->mProperty = aProperty;
|
||||
|
@ -213,7 +216,7 @@ public:
|
|||
|
||||
struct PropertyValuePair {
|
||||
nsCSSProperty mProperty;
|
||||
StyleAnimationValue mValue;
|
||||
mozilla::StyleAnimationValue mValue;
|
||||
};
|
||||
|
||||
void AddPropertiesToSet(nsCSSPropertySet& aSet) const
|
||||
|
@ -230,6 +233,8 @@ private:
|
|||
InfallibleTArray<PropertyValuePair> mPropertyValuePairs;
|
||||
};
|
||||
|
||||
} // namespace css
|
||||
|
||||
typedef InfallibleTArray<nsRefPtr<dom::Animation>> AnimationPtrArray;
|
||||
|
||||
enum EnsureStyleRuleFlags {
|
||||
|
@ -240,7 +245,7 @@ enum EnsureStyleRuleFlags {
|
|||
struct AnimationCollection : public PRCList
|
||||
{
|
||||
AnimationCollection(dom::Element *aElement, nsIAtom *aElementProperty,
|
||||
CommonAnimationManager *aManager)
|
||||
mozilla::css::CommonAnimationManager *aManager)
|
||||
: mElement(aElement)
|
||||
, mElementProperty(aElementProperty)
|
||||
, mManager(aManager)
|
||||
|
@ -276,9 +281,9 @@ struct AnimationCollection : public PRCList
|
|||
|
||||
void EnsureStyleRuleFor(TimeStamp aRefreshTime, EnsureStyleRuleFlags aFlags);
|
||||
|
||||
bool CanThrottleTransformChanges(TimeStamp aTime);
|
||||
bool CanThrottleTransformChanges(mozilla::TimeStamp aTime);
|
||||
|
||||
bool CanThrottleAnimation(TimeStamp aTime);
|
||||
bool CanThrottleAnimation(mozilla::TimeStamp aTime);
|
||||
|
||||
enum CanAnimateFlags {
|
||||
// Testing for width, height, top, right, bottom, or left.
|
||||
|
@ -373,10 +378,10 @@ public:
|
|||
return nsCSSPseudoElements::ePseudo_after;
|
||||
}
|
||||
|
||||
dom::Element* GetElementToRestyle() const;
|
||||
mozilla::dom::Element* GetElementToRestyle() const;
|
||||
|
||||
void PostRestyleForAnimation(nsPresContext *aPresContext) {
|
||||
dom::Element* element = GetElementToRestyle();
|
||||
mozilla::dom::Element* element = GetElementToRestyle();
|
||||
if (element) {
|
||||
nsRestyleHint hint = IsForTransitions() ? eRestyle_CSSTransitions
|
||||
: eRestyle_CSSAnimations;
|
||||
|
@ -395,9 +400,9 @@ public:
|
|||
// i.e., in an atom list)
|
||||
nsIAtom *mElementProperty;
|
||||
|
||||
CommonAnimationManager *mManager;
|
||||
mozilla::css::CommonAnimationManager *mManager;
|
||||
|
||||
AnimationPtrArray mAnimations;
|
||||
mozilla::AnimationPtrArray mAnimations;
|
||||
|
||||
// This style rule contains the style data for currently animating
|
||||
// values. It only matches when styling with animation. When we
|
||||
|
@ -406,7 +411,7 @@ public:
|
|||
// afterwards with animation.
|
||||
// NOTE: If we don't need to apply any styles, mStyleRule will be
|
||||
// null, but mStyleRuleRefreshTime will still be valid.
|
||||
nsRefPtr<AnimValuesStyleRule> mStyleRule;
|
||||
nsRefPtr<mozilla::css::AnimValuesStyleRule> mStyleRule;
|
||||
|
||||
// RestyleManager keeps track of the number of animation
|
||||
// 'mini-flushes' (see nsTransitionManager::UpdateAllThrottledStyles()).
|
||||
|
|
|
@ -1005,7 +1005,7 @@ nsAnimationManager::FlushAnimations(FlushFlags aFlags)
|
|||
AnimationCollection::CanAnimateFlags(0)) &&
|
||||
collection->CanThrottleAnimation(now);
|
||||
|
||||
nsRefPtr<AnimValuesStyleRule> oldStyleRule = collection->mStyleRule;
|
||||
nsRefPtr<css::AnimValuesStyleRule> oldStyleRule = collection->mStyleRule;
|
||||
collection->EnsureStyleRuleFor(now, canThrottleTick
|
||||
? EnsureStyleRule_IsThrottled
|
||||
: EnsureStyleRule_IsNotThrottled);
|
||||
|
|
|
@ -163,7 +163,7 @@ protected:
|
|||
MOZ_ASSERT(!mOwningElement.IsSet(), "Owning element should be cleared "
|
||||
"before a CSS animation is destroyed");
|
||||
}
|
||||
virtual CommonAnimationManager* GetAnimationManager() const override;
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const override;
|
||||
|
||||
void QueueEvents();
|
||||
|
||||
|
@ -240,11 +240,11 @@ protected:
|
|||
} /* namespace mozilla */
|
||||
|
||||
class nsAnimationManager final
|
||||
: public mozilla::CommonAnimationManager
|
||||
: public mozilla::css::CommonAnimationManager
|
||||
{
|
||||
public:
|
||||
explicit nsAnimationManager(nsPresContext *aPresContext)
|
||||
: mozilla::CommonAnimationManager(aPresContext)
|
||||
: mozilla::css::CommonAnimationManager(aPresContext)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ protected:
|
|||
"before a CSS transition is destroyed");
|
||||
}
|
||||
|
||||
virtual CommonAnimationManager* GetAnimationManager() const override;
|
||||
virtual css::CommonAnimationManager* GetAnimationManager() const override;
|
||||
|
||||
// The (pseudo-)element whose computed transition-property refers to this
|
||||
// transition (if any).
|
||||
|
@ -173,11 +173,11 @@ protected:
|
|||
} // namespace mozilla
|
||||
|
||||
class nsTransitionManager final
|
||||
: public mozilla::CommonAnimationManager
|
||||
: public mozilla::css::CommonAnimationManager
|
||||
{
|
||||
public:
|
||||
explicit nsTransitionManager(nsPresContext *aPresContext)
|
||||
: mozilla::CommonAnimationManager(aPresContext)
|
||||
: mozilla::css::CommonAnimationManager(aPresContext)
|
||||
, mInAnimationOnlyStyleUpdate(false)
|
||||
{
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче