Bug 1518374 - Mark GetKeyframes and GetTargetComputedStyle as const; r=hiro
authorBrian Birtles <birtles@gmail.com>
Tue, 08 Jan 2019 06:42:17 +0000
changeset 452825 c19867adc2c78839543c18eecd2c6425e736b894
parent 452824 d497b0f223c9f1836cf320b594964794fd54f4bd
child 452826 b1f4b8412f62416c82bf0dba41ca7cb7125910e9
push id75608
push userbbirtles@mozilla.com
push dateTue, 08 Jan 2019 06:49:53 +0000
treeherderautoland@4ad5b70956ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518374 - Mark GetKeyframes and GetTargetComputedStyle as const; r=hiro Depends on D15899 Differential Revision: https://phabricator.services.mozilla.com/D15900
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -758,17 +758,17 @@ void KeyframeEffect::RequestRestyle(
   if (presContext && mAnimation) {
         mTarget->mElement, mTarget->mPseudoType, aRestyleType,
-already_AddRefed<ComputedStyle> KeyframeEffect::GetTargetComputedStyle() {
+already_AddRefed<ComputedStyle> KeyframeEffect::GetTargetComputedStyle() const {
   if (!GetRenderedDocument()) {
     return nullptr;
              "Should only have a document when we have a target element");
   nsAtom* pseudo =
@@ -990,17 +990,17 @@ void KeyframeEffect::GetProperties(
 void KeyframeEffect::GetKeyframes(JSContext*& aCx, nsTArray<JSObject*>& aResult,
-                                  ErrorResult& aRv) {
+                                  ErrorResult& aRv) const {
   if (!aResult.SetCapacity(mKeyframes.Length(), mozilla::fallible)) {
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -154,17 +154,17 @@ class KeyframeEffect : public AnimationE
   // This method calls GetTargetComputedStyle which is not safe to use when
   // we are in the middle of updating style. If we need to use this when
   // updating style, we should pass the ComputedStyle into this method and use
   // that to update the properties rather than calling
   // GetComputedStyle.
   void SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
   void GetKeyframes(JSContext*& aCx, nsTArray<JSObject*>& aResult,
-                    ErrorResult& aRv);
+                    ErrorResult& aRv) const;
   void GetProperties(nsTArray<AnimationPropertyDetails>& aProperties,
                      ErrorResult& aRv) const;
   IterationCompositeOperation IterationComposite() const;
   void SetIterationComposite(
       const IterationCompositeOperation& aIterationComposite);
   CompositeOperation Composite() const;
@@ -356,17 +356,17 @@ class KeyframeEffect : public AnimationE
   // have changed, or when the target frame might have changed.
   void MaybeUpdateFrameForCompositor();
   // Looks up the ComputedStyle associated with the target element, if any.
   // We need to be careful to *not* call this when we are updating the style
   // context. That's because calling GetComputedStyle when we are in the process
   // of building a ComputedStyle may trigger various forms of infinite
   // recursion.
-  already_AddRefed<ComputedStyle> GetTargetComputedStyle();
+  already_AddRefed<ComputedStyle> GetTargetComputedStyle() const;
   // A wrapper for marking cascade update according to the current
   // target and its effectSet.
   void MarkCascadeNeedsUpdate();
   void EnsureBaseStyles(const ComputedStyle* aComputedValues,
                         const nsTArray<AnimationProperty>& aProperties,
                         bool* aBaseStylesChanged);