Bug 1466963: Inline DeclarationBlock's methods since they just forward to Servo. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 05 Jun 2018 21:30:13 +0200
changeset 421688 9463a724277072a3ad9e35f82776fe16f56d7750
parent 421687 6245a29f2539b162a3d8bc5cc456c9e47bce4888
child 421689 a1ddb11380aa908878e89d743af5ad6039be709f
push id104090
push userecoal95@gmail.com
push dateThu, 07 Jun 2018 09:23:02 +0000
treeherdermozilla-inbound@a1ddb11380aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1466963
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 1466963: Inline DeclarationBlock's methods since they just forward to Servo. r=xidorn MozReview-Commit-ID: 1IObGPXljuM
layout/style/DeclarationBlock.cpp
layout/style/DeclarationBlock.h
--- a/layout/style/DeclarationBlock.cpp
+++ b/layout/style/DeclarationBlock.cpp
@@ -20,47 +20,9 @@ DeclarationBlock::FromCssText(const nsAS
 {
   NS_ConvertUTF16toUTF8 value(aCssText);
   RefPtr<RawServoDeclarationBlock> raw =
       Servo_ParseStyleAttribute(&value, aExtraData, aMode, aLoader).Consume();
   RefPtr<DeclarationBlock> decl = new DeclarationBlock(raw.forget());
   return decl.forget();
 }
 
-// TODO: We can make them inline.
-void
-DeclarationBlock::GetPropertyValue(const nsAString& aProperty,
-                                   nsAString& aValue) const
-{
-  NS_ConvertUTF16toUTF8 property(aProperty);
-  Servo_DeclarationBlock_GetPropertyValue(mRaw, &property, &aValue);
-}
-
-void
-DeclarationBlock::GetPropertyValueByID(nsCSSPropertyID aPropID,
-                                       nsAString& aValue) const
-{
-  Servo_DeclarationBlock_GetPropertyValueById(mRaw, aPropID, &aValue);
-}
-
-bool
-DeclarationBlock::GetPropertyIsImportant(const nsAString& aProperty) const
-{
-  NS_ConvertUTF16toUTF8 property(aProperty);
-  return Servo_DeclarationBlock_GetPropertyIsImportant(mRaw, &property);
-}
-
-bool
-DeclarationBlock::RemoveProperty(const nsAString& aProperty)
-{
-  AssertMutable();
-  NS_ConvertUTF16toUTF8 property(aProperty);
-  return Servo_DeclarationBlock_RemoveProperty(mRaw, &property);
-}
-
-bool
-DeclarationBlock::RemovePropertyByID(nsCSSPropertyID aPropID)
-{
-  AssertMutable();
-  return Servo_DeclarationBlock_RemovePropertyById(mRaw, aPropID);
-}
-
 } // namespace mozilla
--- a/layout/style/DeclarationBlock.h
+++ b/layout/style/DeclarationBlock.h
@@ -184,23 +184,47 @@ public:
   }
 
   bool GetNthProperty(uint32_t aIndex, nsAString& aReturn) const
   {
     aReturn.Truncate();
     return Servo_DeclarationBlock_GetNthProperty(mRaw, aIndex, &aReturn);
   }
 
-  void GetPropertyValue(const nsAString& aProperty, nsAString& aValue) const;
-  void GetPropertyValueByID(nsCSSPropertyID aPropID, nsAString& aValue) const;
-  bool GetPropertyIsImportant(const nsAString& aProperty) const;
+  void GetPropertyValue(const nsAString& aProperty, nsAString& aValue) const
+  {
+    NS_ConvertUTF16toUTF8 property(aProperty);
+    Servo_DeclarationBlock_GetPropertyValue(mRaw, &property, &aValue);
+  }
+
+  void GetPropertyValueByID(nsCSSPropertyID aPropID, nsAString& aValue) const
+  {
+    Servo_DeclarationBlock_GetPropertyValueById(mRaw, aPropID, &aValue);
+  }
+
+  bool GetPropertyIsImportant(const nsAString& aProperty) const
+  {
+    NS_ConvertUTF16toUTF8 property(aProperty);
+    return Servo_DeclarationBlock_GetPropertyIsImportant(mRaw, &property);
+  }
+
   // Returns whether the property was removed.
-  bool RemoveProperty(const nsAString& aProperty);
+  bool RemoveProperty(const nsAString& aProperty)
+  {
+    AssertMutable();
+    NS_ConvertUTF16toUTF8 property(aProperty);
+    return Servo_DeclarationBlock_RemoveProperty(mRaw, &property);
+  }
+
   // Returns whether the property was removed.
-  bool RemovePropertyByID(nsCSSPropertyID aProperty);
+  bool RemovePropertyByID(nsCSSPropertyID aProperty)
+  {
+    AssertMutable();
+    return Servo_DeclarationBlock_RemovePropertyById(mRaw, aProperty);
+  }
 
 private:
   ~DeclarationBlock() = default;
   union {
     // We only ever have one of these since we have an
     // nsHTMLCSSStyleSheet only for style attributes, and style
     // attributes never have an owning rule.