Bug 1458580 - Rename GetSMILStyleOverride since it can't return null. r=emilio
authorrahul0379 <rahul0379@gmail.com>
Sun, 20 May 2018 23:15:02 +0530
changeset 419842 fc4ca25a0f39
parent 419841 11f4d626ab56
child 419843 5bb547481faf
push id103628
push userecoal95@gmail.com
push dateFri, 25 May 2018 10:14:09 +0000
treeherdermozilla-inbound@fc4ca25a0f39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1458580
milestone62.0a1
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 1458580 - Rename GetSMILStyleOverride since it can't return null. r=emilio MozReview-Commit-ID: JzV5hQBvlpJ
dom/base/Element.cpp
dom/base/Element.h
dom/smil/nsSMILCSSProperty.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2034,17 +2034,17 @@ Element::UnbindFromTree(bool aDeep, bool
     shadowRoot->SetIsComposedDocParticipant(false);
   }
 
   MOZ_ASSERT(!HasAnyOfFlags(kAllServoDescendantBits));
   MOZ_ASSERT(!document || document->GetServoRestyleRoot() != this);
 }
 
 nsDOMCSSAttributeDeclaration*
-Element::GetSMILOverrideStyle()
+Element::SMILOverrideStyle()
 {
   Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots();
 
   if (!slots->mSMILOverrideStyle) {
     slots->mSMILOverrideStyle = new nsDOMCSSAttributeDeclaration(this, true);
   }
 
   return slots->mSMILOverrideStyle;
@@ -4484,17 +4484,17 @@ NoteDirtyElement(Element* aElement, uint
       return;
     }
 
     // If the parent is styled but is display:none, we're done.
     //
     // We can't check for a frame here, since <frame> elements inside <frameset>
     // still need to generate a frame, even if they're display: none. :(
     //
-    // The servo traversal doesn't keep style data under display: none subtrees, 
+    // The servo traversal doesn't keep style data under display: none subtrees,
     // so in order for it to not need to cleanup each time anything happens in a
     // display: none subtree, we keep it clean.
     //
     // Also, we can't be much more smarter about using the parent's frame in
     // order to avoid work here, because since the style system keeps style data
     // in, e.g., subtrees under a leaf frame, missing restyles and such in there
     // has observable behavior via getComputedStyle, for example.
     if (Servo_Element_IsDisplayNone(parent->AsElement())) {
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -356,17 +356,17 @@ public:
   /**
    * Get the SMIL override style for this element. This is a style declaration
    * that is applied *after* the inline style, and it can be used e.g. to store
    * animated style values.
    *
    * Note: This method is analogous to the 'GetStyle' method in
    * nsGenericHTMLElement and nsStyledElement.
    */
-  nsDOMCSSAttributeDeclaration* GetSMILOverrideStyle();
+  nsDOMCSSAttributeDeclaration* SMILOverrideStyle();
 
   /**
    * Returns if the element is labelable as per HTML specification.
    */
   virtual bool IsLabelable() const;
 
   /**
    * Returns if the element is interactive content as per HTML specification.
--- a/dom/smil/nsSMILCSSProperty.cpp
+++ b/dom/smil/nsSMILCSSProperty.cpp
@@ -102,27 +102,24 @@ nsSMILCSSProperty::ValueFromString(const
   }
   return NS_OK;
 }
 
 nsresult
 nsSMILCSSProperty::SetAnimValue(const nsSMILValue& aValue)
 {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
-  return mElement->GetSMILOverrideStyle()->SetSMILValue(mPropID, aValue);
+  return mElement->SMILOverrideStyle()->SetSMILValue(mPropID, aValue);
 }
 
 void
 nsSMILCSSProperty::ClearAnimValue()
 {
   // Put empty string in override style for our property
-  nsDOMCSSAttributeDeclaration* overrideDecl = mElement->GetSMILOverrideStyle();
-  if (overrideDecl) {
-    overrideDecl->SetPropertyValue(mPropID, EmptyString(), nullptr);
-  }
+  mElement->SMILOverrideStyle()->SetPropertyValue(mPropID, EmptyString(), nullptr);
 }
 
 // Based on http://www.w3.org/TR/SVG/propidx.html
 // static
 bool
 nsSMILCSSProperty::IsPropertyAnimatable(nsCSSPropertyID aPropID)
 {
   // Bug 1353918: Drop this check