Bug 1344533 - Replace OwningElementRef::GetRenderedPresContext with nsContentUtils::GetContextForContext(). r?boris
MozReview-Commit-ID: HaAvgNcORQb
deleted file mode 100644
--- a/layout/style/AnimationCommon.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AnimationCommon.h"
-#include "nsTransitionManager.h"
-#include "nsAnimationManager.h"
-
-#include "ActiveLayerTracker.h"
-#include "gfxPlatform.h"
-#include "nsCSSPropertyIDSet.h"
-#include "nsCSSValue.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsStyleContext.h"
-#include "nsIFrame.h"
-#include "nsLayoutUtils.h"
-#include "FrameLayerBuilder.h"
-#include "nsDisplayList.h"
-#include "mozilla/AnimationUtils.h"
-#include "mozilla/EffectCompositor.h"
-#include "mozilla/EffectSet.h"
-#include "mozilla/MemoryReporting.h"
-#include "mozilla/dom/KeyframeEffectReadOnly.h"
-#include "nsRuleProcessorData.h"
-#include "nsStyleSet.h"
-#include "nsStyleChangeList.h"
-
-using mozilla::dom::Animation;
-using mozilla::dom::KeyframeEffectReadOnly;
-
-namespace mozilla {
-
-nsPresContext*
-OwningElementRef::GetRenderedPresContext() const
-{
- if (!mElement) {
- return nullptr;
- }
-
- nsIDocument* doc = mElement->GetComposedDoc();
- if (!doc) {
- return nullptr;
- }
-
- nsIPresShell* shell = doc->GetShell();
- if (!shell) {
- return nullptr;
- }
-
- return shell->GetPresContext();
-}
-
-} // namespace mozilla
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -124,18 +124,16 @@ public:
bool IsSet() const { return !!mElement; }
void GetElement(dom::Element*& aElement,
CSSPseudoElementType& aPseudoType) const {
aElement = mElement;
aPseudoType = mPseudoType;
}
- nsPresContext* GetRenderedPresContext() const;
-
private:
dom::Element* MOZ_NON_OWNING_REF mElement;
CSSPseudoElementType mPseudoType;
};
template <class EventInfo>
class DelayedEventDispatcher
{
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -142,17 +142,16 @@ EXPORTS.mozilla.css += [
'NameSpaceRule.h',
'Rule.h',
'SheetParsingMode.h',
'StyleRule.h',
]
UNIFIED_SOURCES += [
'AnimationCollection.cpp',
- 'AnimationCommon.cpp',
'BindingStyleRule.cpp',
'CounterStyleManager.cpp',
'CSS.cpp',
'CSSLexer.cpp',
'CSSRuleList.cpp',
'CSSStyleSheet.cpp',
'CSSVariableDeclarations.cpp',
'CSSVariableResolver.cpp',
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -13,16 +13,17 @@
#include "mozilla/ServoStyleSet.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/dom/KeyframeEffectReadOnly.h"
#include "nsPresContext.h"
#include "nsStyleSet.h"
#include "nsStyleChangeList.h"
+#include "nsContentUtils.h"
#include "nsCSSRules.h"
#include "mozilla/GeckoRestyleManager.h"
#include "nsLayoutUtils.h"
#include "nsIFrame.h"
#include "nsIDocument.h"
#include "nsDOMMutationObserver.h"
#include "nsIPresShell.h"
#include "nsIPresShellInlines.h"
@@ -186,17 +187,18 @@ CSSAnimation::QueueEvents(StickyTimeDura
}
dom::Element* owningElement;
CSSPseudoElementType owningPseudoType;
mOwningElement.GetElement(owningElement, owningPseudoType);
MOZ_ASSERT(owningElement, "Owning element should be set");
// Get the nsAnimationManager so we can queue events on it
- nsPresContext* presContext = mOwningElement.GetRenderedPresContext();
+ nsPresContext* presContext =
+ nsContentUtils::GetContextForContent(owningElement);
if (!presContext) {
return;
}
nsAnimationManager* manager = presContext->AnimationManager();
const StickyTimeDuration zeroDuration;
uint64_t currentIteration = 0;
ComputedTiming::AnimationPhase currentPhase;
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -6,16 +6,17 @@
/* Code to start and animate CSS transitions. */
#include "nsTransitionManager.h"
#include "nsAnimationManager.h"
#include "mozilla/dom/CSSTransitionBinding.h"
#include "nsIContent.h"
+#include "nsContentUtils.h"
#include "nsStyleContext.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/TimeStamp.h"
#include "nsRefreshDriver.h"
#include "nsRuleProcessorData.h"
#include "nsRuleWalker.h"
#include "nsCSSPropertyIDSet.h"
#include "mozilla/EffectCompositor.h"
@@ -184,17 +185,18 @@ CSSTransition::QueueEvents(StickyTimeDur
return;
}
dom::Element* owningElement;
CSSPseudoElementType owningPseudoType;
mOwningElement.GetElement(owningElement, owningPseudoType);
MOZ_ASSERT(owningElement, "Owning element should be set");
- nsPresContext* presContext = mOwningElement.GetRenderedPresContext();
+ nsPresContext* presContext =
+ nsContentUtils::GetContextForContent(owningElement);
if (!presContext) {
return;
}
const StickyTimeDuration zeroDuration = StickyTimeDuration();
TransitionPhase currentPhase;
StickyTimeDuration intervalStartTime;