Bug 1309109 part 3 - Rename ServoDeclarationBlock to RawServoDeclarationBlock. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Tue, 11 Oct 2016 22:29:33 +1100
changeset 426166 1d32b4281488945d2839c4b2009a83b1892491e9
parent 426165 03c7ec24733666b5ad42b7c1b9a6b32e6dba8cac
child 426167 660d4e1b274346aafa50d1c595891798227129af
push id32640
push userxquan@mozilla.com
push dateTue, 18 Oct 2016 00:25:47 +0000
reviewersheycam
bugs1309109
milestone52.0a1
Bug 1309109 part 3 - Rename ServoDeclarationBlock to RawServoDeclarationBlock. r?heycam So that the new subclass of DeclarationBlock could just be ServoDeclarationBlock. MozReview-Commit-ID: 55KgfmWmmyU
dom/animation/KeyframeEffectReadOnly.h
dom/animation/KeyframeUtils.cpp
dom/base/nsAttrValue.cpp
dom/base/nsAttrValue.h
dom/base/nsAttrValueInlines.h
layout/style/ServoBindingHelpers.h
layout/style/ServoBindingList.h
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
layout/style/StyleAnimationValue.cpp
layout/style/StyleAnimationValue.h
layout/style/nsHTMLCSSStyleSheet.cpp
servo/components/style/binding_tools/regen.py
servo/components/style/gecko/wrapper.rs
servo/components/style/gecko_bindings/bindings.rs
servo/ports/geckolib/glue.rs
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -15,17 +15,17 @@
 #include "nsWrapperCache.h"
 #include "mozilla/AnimationPerformanceWarning.h"
 #include "mozilla/AnimationTarget.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ComputedTimingFunction.h"
 #include "mozilla/EffectCompositor.h"
 #include "mozilla/KeyframeEffectParams.h"
 #include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords
-#include "mozilla/ServoBindingHelpers.h" // ServoDeclarationBlock and
+#include "mozilla/ServoBindingHelpers.h" // RawServoDeclarationBlock and
                                          // associated RefPtrTraits
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/dom/AnimationEffectReadOnly.h"
 #include "mozilla/dom/Element.h"
 
 struct JSContext;
 class JSObject;
 class nsCSSPropertyIDSet;
@@ -62,17 +62,17 @@ struct PropertyValuePair
   // The specified value for the property. For shorthand properties or invalid
   // property values, we store the specified property value as a token stream
   // (string).
   nsCSSValue mValue;
 
   // The specified value when using the Servo backend. However, even when
   // using the Servo backend, we still fill in |mValue| in the case where we
   // fail to parse the value since we use it to store the original string.
-  RefPtr<ServoDeclarationBlock> mServoDeclarationBlock;
+  RefPtr<RawServoDeclarationBlock> mServoDeclarationBlock;
 
   bool operator==(const PropertyValuePair& aOther) const {
     return mProperty == aOther.mProperty &&
            mValue == aOther.mValue &&
            !mServoDeclarationBlock == !aOther.mServoDeclarationBlock &&
            (!mServoDeclarationBlock ||
             Servo_DeclarationBlock_Equals(mServoDeclarationBlock,
                                           aOther.mServoDeclarationBlock));
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -1001,17 +1001,17 @@ MakePropertyValuePair(nsCSSPropertyID aP
     RefPtr<ThreadSafeURIHolder> referrer =
       new ThreadSafeURIHolder(aDocument->GetDocumentURI());
     RefPtr<ThreadSafePrincipalHolder> principal =
       new ThreadSafePrincipalHolder(aDocument->NodePrincipal());
 
     nsCString baseString;
     aDocument->GetDocumentURI()->GetSpec(baseString);
 
-    RefPtr<ServoDeclarationBlock> servoDeclarationBlock =
+    RefPtr<RawServoDeclarationBlock> servoDeclarationBlock =
       Servo_ParseProperty(
         reinterpret_cast<const uint8_t*>(name.get()), name.Length(),
         reinterpret_cast<const uint8_t*>(value.get()), value.Length(),
         reinterpret_cast<const uint8_t*>(baseString.get()), baseString.Length(),
         base, referrer, principal).Consume();
 
     if (servoDeclarationBlock) {
       result.mServoDeclarationBlock = servoDeclarationBlock.forget();
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -458,17 +458,17 @@ nsAttrValue::SetTo(css::Declaration* aVa
   NS_ADDREF(cont->mValue.mGeckoCSSDeclaration = aValue);
   cont->mType = eGeckoCSSDeclaration;
   NS_ADDREF(cont);
   SetMiscAtomOrString(aSerialized);
   MOZ_ASSERT(cont->mValue.mRefCount == 1);
 }
 
 void
-nsAttrValue::SetTo(already_AddRefed<ServoDeclarationBlock> aValue,
+nsAttrValue::SetTo(already_AddRefed<RawServoDeclarationBlock> aValue,
                    const nsAString* aSerialized)
 {
   MiscContainer* cont = EnsureEmptyMiscContainer();
   MOZ_ASSERT(cont->mValue.mRefCount == 0);
   cont->mValue.mServoCSSDeclaration = aValue.take();
   cont->mType = eServoCSSDeclaration;
   NS_ADDREF(cont);
   SetMiscAtomOrString(aSerialized);
@@ -1768,17 +1768,17 @@ nsAttrValue::ParseStyleAttribute(const n
       NS_ADDREF(cont);
       SetPtrValueAndType(cont, eOtherBase);
       return true;
     }
   }
 
   if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) {
     NS_ConvertUTF16toUTF8 value(aString);
-    RefPtr<ServoDeclarationBlock> decl = Servo_ParseStyleAttribute(
+    RefPtr<RawServoDeclarationBlock> decl = Servo_ParseStyleAttribute(
         reinterpret_cast<const uint8_t*>(value.get()),
         value.Length(), sheet).Consume();
     MOZ_ASSERT(decl);
     SetTo(decl.forget(), &aString);
   } else {
     css::Loader* cssLoader = ownerDoc->CSSLoader();
     nsCSSParser cssParser(cssLoader);
 
--- a/dom/base/nsAttrValue.h
+++ b/dom/base/nsAttrValue.h
@@ -30,17 +30,17 @@
 
 // Undefine LoadImage to prevent naming conflict with Windows.
 #undef LoadImage
 
 class nsAString;
 class nsIDocument;
 class nsStyledElement;
 struct MiscContainer;
-struct ServoDeclarationBlock;
+struct RawServoDeclarationBlock;
 
 namespace mozilla {
 namespace css {
 class Declaration;
 struct URLValue;
 struct ImageValue;
 } // namespace css
 } // namespace mozilla
@@ -146,17 +146,17 @@ public:
 
   void SetTo(const nsAttrValue& aOther);
   void SetTo(const nsAString& aValue);
   void SetTo(nsIAtom* aValue);
   void SetTo(int16_t aInt);
   void SetTo(int32_t aInt, const nsAString* aSerialized);
   void SetTo(double aValue, const nsAString* aSerialized);
   void SetTo(mozilla::css::Declaration* aValue, const nsAString* aSerialized);
-  void SetTo(already_AddRefed<ServoDeclarationBlock> aDeclarationBlock,
+  void SetTo(already_AddRefed<RawServoDeclarationBlock> aDeclarationBlock,
              const nsAString* aSerialized);
   void SetTo(mozilla::css::URLValue* aValue, const nsAString* aSerialized);
   void SetTo(const nsIntMargin& aValue);
   void SetTo(const nsSVGAngle& aValue, const nsAString* aSerialized);
   void SetTo(const nsSVGIntegerPair& aValue, const nsAString* aSerialized);
   void SetTo(const nsSVGLength2& aValue, const nsAString* aSerialized);
   void SetTo(const mozilla::SVGLengthList& aValue,
              const nsAString* aSerialized);
@@ -199,17 +199,17 @@ public:
   const nsCheapString GetStringValue() const;
   inline nsIAtom* GetAtomValue() const;
   inline int32_t GetIntegerValue() const;
   bool GetColorValue(nscolor& aColor) const;
   inline int16_t GetEnumValue() const;
   inline float GetPercentValue() const;
   inline AtomArray* GetAtomArrayValue() const;
   inline mozilla::css::Declaration* GetGeckoCSSDeclarationValue() const;
-  inline ServoDeclarationBlock* GetServoCSSDeclarationValue() const;
+  inline RawServoDeclarationBlock* GetServoCSSDeclarationValue() const;
   inline mozilla::css::URLValue* GetURLValue() const;
   inline mozilla::css::ImageValue* GetImageValue() const;
   inline double GetDoubleValue() const;
   bool GetIntMarginValue(nsIntMargin& aMargin) const;
 
   /**
    * Returns the string corresponding to the stored enum value.
    *
--- a/dom/base/nsAttrValueInlines.h
+++ b/dom/base/nsAttrValueInlines.h
@@ -27,17 +27,17 @@ struct MiscContainer final
   union {
     struct {
       union {
         int32_t mInteger;
         nscolor mColor;
         uint32_t mEnumValue;
         int32_t mPercent;
         mozilla::css::Declaration* mGeckoCSSDeclaration;
-        ServoDeclarationBlock* mServoCSSDeclaration;
+        RawServoDeclarationBlock* mServoCSSDeclaration;
         mozilla::css::URLValue* mURL;
         mozilla::css::ImageValue* mImage;
         nsAttrValue::AtomArray* mAtomArray;
         nsIntMargin* mIntMargin;
         const nsSVGAngle* mSVGAngle;
         const nsSVGIntegerPair* mSVGIntegerPair;
         const nsSVGLength2* mSVGLength;
         const mozilla::SVGLengthList* mSVGLengthList;
@@ -150,17 +150,17 @@ nsAttrValue::GetAtomArrayValue() const
 
 inline mozilla::css::Declaration*
 nsAttrValue::GetGeckoCSSDeclarationValue() const
 {
   NS_PRECONDITION(Type() == eGeckoCSSDeclaration, "wrong type");
   return GetMiscContainer()->mValue.mGeckoCSSDeclaration;
 }
 
-inline ServoDeclarationBlock*
+inline RawServoDeclarationBlock*
 nsAttrValue::GetServoCSSDeclarationValue() const
 {
   NS_PRECONDITION(Type() == eServoCSSDeclaration, "wrong type");
   return GetMiscContainer()->mValue.mServoCSSDeclaration;
 }
 
 inline mozilla::css::URLValue*
 nsAttrValue::GetURLValue() const
--- a/layout/style/ServoBindingHelpers.h
+++ b/layout/style/ServoBindingHelpers.h
@@ -24,17 +24,17 @@ namespace mozilla {
     static void Release(type_* aPtr)        \
     {                                       \
       Servo_##name_##_Release(aPtr);        \
     }                                       \
   }
 
 DEFINE_REFPTR_TRAITS(StyleSheet, RawServoStyleSheet);
 DEFINE_REFPTR_TRAITS(ComputedValues, ServoComputedValues);
-DEFINE_REFPTR_TRAITS(DeclarationBlock, ServoDeclarationBlock);
+DEFINE_REFPTR_TRAITS(DeclarationBlock, RawServoDeclarationBlock);
 
 #undef DEFINE_REFPTR_TRAITS
 
 template<>
 class DefaultDelete<RawServoStyleSet>
 {
 public:
   void operator()(RawServoStyleSet* aPtr) const
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -44,50 +44,50 @@ SERVO_BINDING_FUNC(Servo_StyleSet_Prepen
 SERVO_BINDING_FUNC(Servo_StyleSet_RemoveStyleSheet, void,
                    RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet)
 SERVO_BINDING_FUNC(Servo_StyleSet_InsertStyleSheetBefore, void,
                    RawServoStyleSetBorrowed set, RawServoStyleSheetBorrowed sheet,
                    RawServoStyleSheetBorrowed reference)
 
 // Animations API
 SERVO_BINDING_FUNC(Servo_ParseProperty,
-                   ServoDeclarationBlockStrong,
+                   RawServoDeclarationBlockStrong,
                    const uint8_t* property_bytes,
                    uint32_t property_length,
                    const uint8_t* value_bytes,
                    uint32_t value_length,
                    const uint8_t* base_bytes,
                    uint32_t base_length,
                    ThreadSafeURIHolder* base,
                    ThreadSafeURIHolder* referrer,
                    ThreadSafePrincipalHolder* principal)
 SERVO_BINDING_FUNC(Servo_RestyleWithAddedDeclaration,
                    ServoComputedValuesStrong,
-                   ServoDeclarationBlockBorrowed declarations,
+                   RawServoDeclarationBlockBorrowed declarations,
                    ServoComputedValuesBorrowed previous_style)
 
 // Style attribute
-SERVO_BINDING_FUNC(Servo_ParseStyleAttribute, ServoDeclarationBlockStrong,
+SERVO_BINDING_FUNC(Servo_ParseStyleAttribute, RawServoDeclarationBlockStrong,
                    const uint8_t* bytes, uint32_t length,
                    nsHTMLCSSStyleSheet* cache)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_AddRef, void,
-                   ServoDeclarationBlockBorrowed declarations)
+                   RawServoDeclarationBlockBorrowed declarations)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_Release, void,
-                   ServoDeclarationBlockBorrowed declarations)
+                   RawServoDeclarationBlockBorrowed declarations)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_Equals, bool,
-                   ServoDeclarationBlockBorrowed a,
-                   ServoDeclarationBlockBorrowed b)
+                   RawServoDeclarationBlockBorrowed a,
+                   RawServoDeclarationBlockBorrowed b)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_GetCache, nsHTMLCSSStyleSheet*,
-                   ServoDeclarationBlockBorrowed declarations)
+                   RawServoDeclarationBlockBorrowed declarations)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_SetImmutable, void,
-                   ServoDeclarationBlockBorrowed declarations)
+                   RawServoDeclarationBlockBorrowed declarations)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_ClearCachePointer, void,
-                   ServoDeclarationBlockBorrowed declarations)
+                   RawServoDeclarationBlockBorrowed declarations)
 SERVO_BINDING_FUNC(Servo_DeclarationBlock_SerializeOneValue, void,
-                   ServoDeclarationBlockBorrowed declarations,
+                   RawServoDeclarationBlockBorrowed declarations,
                    nsString* buffer)
 
 // CSS supports()
 SERVO_BINDING_FUNC(Servo_CSSSupports, bool,
                    const uint8_t* name, uint32_t name_length,
                    const uint8_t* value, uint32_t value_length)
 
 // Computed style data
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -39,17 +39,17 @@ using namespace mozilla::dom;
   type_##Strong::Consume() {            \
     RefPtr<type_> result;               \
     result.swap(mPtr);                  \
     return result.forget();             \
   }
 
 IMPL_STRONG_REF_TYPE_FOR(ServoComputedValues)
 IMPL_STRONG_REF_TYPE_FOR(RawServoStyleSheet)
-IMPL_STRONG_REF_TYPE_FOR(ServoDeclarationBlock)
+IMPL_STRONG_REF_TYPE_FOR(RawServoDeclarationBlock)
 
 #undef IMPL_STRONG_REF_TYPE_FOR
 
 uint32_t
 Gecko_ChildrenCount(RawGeckoNodeBorrowed aNode)
 {
   return aNode->GetChildCount();
 }
@@ -307,17 +307,17 @@ Gecko_StoreStyleDifference(RawGeckoNodeB
 
   primaryFrame->StyleContext()->StoreChangeHint(aChangeHintToStore);
 #else
   MOZ_CRASH("stylo: Shouldn't call Gecko_StoreStyleDifference in "
             "non-stylo build");
 #endif
 }
 
-ServoDeclarationBlock*
+RawServoDeclarationBlock*
 Gecko_GetServoDeclarationBlock(RawGeckoElementBorrowed aElement)
 {
   const nsAttrValue* attr = aElement->GetParsedAttr(nsGkAtoms::style);
   if (!attr || attr->Type() != nsAttrValue::eServoCSSDeclaration) {
     return nullptr;
   }
   return attr->GetServoCSSDeclarationValue();
 }
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -45,17 +45,17 @@ struct RawServoStyleSheet;
 struct RawServoStyleSet;
 class nsHTMLCSSStyleSheet;
 struct nsStyleList;
 struct nsStyleImage;
 struct nsStyleGradientStop;
 class nsStyleGradient;
 class nsStyleCoord;
 struct nsStyleDisplay;
-struct ServoDeclarationBlock;
+struct RawServoDeclarationBlock;
 
 namespace mozilla {
 namespace dom {
 class StyleChildrenIterator;
 }
 }
 
 using mozilla::dom::StyleChildrenIterator;
@@ -96,17 +96,17 @@ using mozilla::dom::StyleChildrenIterato
 
 #define DECL_NULLABLE_OWNED_REF_TYPE_FOR(type_)    \
   typedef type_* type_##OwnedOrNull;               \
   DECL_NULLABLE_BORROWED_REF_TYPE_FOR(type_)       \
   DECL_NULLABLE_BORROWED_MUT_REF_TYPE_FOR(type_)
 
 DECL_ARC_REF_TYPE_FOR(ServoComputedValues)
 DECL_ARC_REF_TYPE_FOR(RawServoStyleSheet)
-DECL_ARC_REF_TYPE_FOR(ServoDeclarationBlock)
+DECL_ARC_REF_TYPE_FOR(RawServoDeclarationBlock)
 
 DECL_OWNED_REF_TYPE_FOR(RawServoStyleSet)
 DECL_NULLABLE_OWNED_REF_TYPE_FOR(StyleChildrenIterator)
 DECL_OWNED_REF_TYPE_FOR(StyleChildrenIterator)
 
 // We don't use BorrowedMut because the nodes may alias
 // Servo itself doesn't directly read or mutate these;
 // it only asks Gecko to do so. In case we wish to in
@@ -211,17 +211,18 @@ nsIAtom* Gecko_GetElementId(RawGeckoElem
 
 SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_, RawGeckoElementBorrowed)
 SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS(Gecko_Snapshot,
                                               ServoElementSnapshot*)
 
 #undef SERVO_DECLARE_ELEMENT_ATTR_MATCHING_FUNCTIONS
 
 // Style attributes.
-ServoDeclarationBlockBorrowedOrNull Gecko_GetServoDeclarationBlock(RawGeckoElementBorrowed element);
+RawServoDeclarationBlockBorrowedOrNull
+Gecko_GetServoDeclarationBlock(RawGeckoElementBorrowed element);
 
 // Atoms.
 nsIAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
 void Gecko_AddRefAtom(nsIAtom* aAtom);
 void Gecko_ReleaseAtom(nsIAtom* aAtom);
 const uint16_t* Gecko_GetAtomAsUTF16(nsIAtom* aAtom, uint32_t* aLength);
 bool Gecko_AtomEqualsUTF8(nsIAtom* aAtom, const char* aString, uint32_t aLength);
 bool Gecko_AtomEqualsUTF8IgnoreCase(nsIAtom* aAtom, const char* aString, uint32_t aLength);
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -22,17 +22,17 @@
 #include "nsStyleSet.h"
 #include "nsComputedDOMStyle.h"
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
 #include "mozilla/css/Declaration.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Likely.h"
-#include "mozilla/ServoBindings.h" // ServoDeclarationBlock
+#include "mozilla/ServoBindings.h" // RawServoDeclarationBlock
 #include "gfxMatrix.h"
 #include "gfxQuaternion.h"
 #include "nsIDocument.h"
 #include "nsIFrame.h"
 #include "gfx2DGlue.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
@@ -3228,33 +3228,33 @@ StyleAnimationValue::ComputeValues(
                                          aResult);
 }
 
 /* static */ bool
 StyleAnimationValue::ComputeValues(
   nsCSSPropertyID aProperty,
   CSSEnabledState aEnabledState,
   nsStyleContext* aStyleContext,
-  const ServoDeclarationBlock& aDeclarations,
+  const RawServoDeclarationBlock& aDeclarations,
   nsTArray<PropertyStyleAnimationValuePair>& aValues)
 {
   MOZ_ASSERT(aStyleContext->PresContext()->StyleSet()->IsServo(),
              "Should be using ServoStyleSet if we have a"
-             " ServoDeclarationBlock");
+             " RawServoDeclarationBlock");
 
   if (!nsCSSProps::IsEnabled(aProperty, aEnabledState)) {
     return false;
   }
 
   const ServoComputedValues* previousStyle =
     aStyleContext->StyleSource().AsServoComputedValues();
 
   // FIXME: Servo bindings don't yet represent const-ness so we just
   // cast it away for now.
-  auto declarations = const_cast<ServoDeclarationBlock*>(&aDeclarations);
+  auto declarations = const_cast<RawServoDeclarationBlock*>(&aDeclarations);
   RefPtr<ServoComputedValues> computedValues =
     Servo_RestyleWithAddedDeclaration(declarations, previousStyle).Consume();
   if (!computedValues) {
     return false;
   }
 
   RefPtr<nsStyleContext> tmpStyleContext =
     NS_NewStyleContext(aStyleContext, aStyleContext->PresContext(),
--- a/layout/style/StyleAnimationValue.h
+++ b/layout/style/StyleAnimationValue.h
@@ -15,17 +15,17 @@
 #include "nsCoord.h"
 #include "nsColor.h"
 #include "nsCSSProps.h"
 #include "nsCSSValue.h"
 
 class nsIFrame;
 class nsStyleContext;
 class gfx3DMatrix;
-struct ServoDeclarationBlock;
+struct RawServoDeclarationBlock;
 
 namespace mozilla {
 
 namespace css {
 class StyleRule;
 } // namespace css
 
 namespace dom {
@@ -232,24 +232,24 @@ public:
                 mozilla::CSSEnabledState aEnabledState,
                 mozilla::dom::Element* aTargetElement,
                 nsStyleContext* aStyleContext,
                 const nsCSSValue& aSpecifiedValue,
                 bool aUseSVGMode,
                 nsTArray<PropertyStyleAnimationValuePair>& aResult);
 
   /**
-   * A variant of ComputeValues that takes a ServoDeclarationBlock as the
-   * specified value.
+   * A variant of ComputeValues that takes a RawServoDeclarationBlock
+   * as the specified value.
    */
   static MOZ_MUST_USE bool
   ComputeValues(nsCSSPropertyID aProperty,
                 mozilla::CSSEnabledState aEnabledState,
                 nsStyleContext* aStyleContext,
-                const ServoDeclarationBlock& aDeclarations,
+                const RawServoDeclarationBlock& aDeclarations,
                 nsTArray<PropertyStyleAnimationValuePair>& aValues);
 
   /**
    * Creates a specified value for the given computed value.
    *
    * The first two overloads fill in an nsCSSValue object; the third
    * produces a string.  For the overload that takes a const
    * StyleAnimationValue& reference, the nsCSSValue result may depend on
--- a/layout/style/nsHTMLCSSStyleSheet.cpp
+++ b/layout/style/nsHTMLCSSStyleSheet.cpp
@@ -40,17 +40,17 @@ nsHTMLCSSStyleSheet::~nsHTMLCSSStyleShee
     // we're iterating the hashtable.
     switch (value->mType) {
       case nsAttrValue::eGeckoCSSDeclaration: {
         css::Declaration* declaration = value->mValue.mGeckoCSSDeclaration;
         declaration->SetHTMLCSSStyleSheet(nullptr);
         break;
       }
       case nsAttrValue::eServoCSSDeclaration: {
-        ServoDeclarationBlock* declarations =
+        RawServoDeclarationBlock* declarations =
           value->mValue.mServoCSSDeclaration;
         Servo_DeclarationBlock_ClearCachePointer(declarations);
         break;
       }
       default:
         MOZ_ASSERT_UNREACHABLE("unexpected cached nsAttrValue type");
         break;
     }
--- a/servo/components/style/binding_tools/regen.py
+++ b/servo/components/style/binding_tools/regen.py
@@ -227,17 +227,17 @@ COMPILATION_TARGETS = {
             "FontFamilyType", "nsIAtom", "nsStyleContext", "StyleClipPath",
             "StyleBasicShapeType", "StyleBasicShape", "nsCSSShadowArray",
             "nsIPrincipal", "nsIURI",
             "RawGeckoNode", "RawGeckoElement", "RawGeckoDocument",
             "nsString"
         ],
         "servo_nullable_arc_types": [
             "ServoComputedValues", "RawServoStyleSheet",
-            "ServoDeclarationBlock"
+            "RawServoDeclarationBlock"
         ],
         "servo_owned_types": [
             "RawServoStyleSet",
             "StyleChildrenIterator",
         ],
         "servo_immutable_borrow_types": [
             "RawGeckoNode",
             "RawGeckoElement",
--- a/servo/components/style/gecko/wrapper.rs
+++ b/servo/components/style/gecko/wrapper.rs
@@ -76,17 +76,17 @@ impl PartialEq for GeckoDeclarationBlock
             (&None, &None) => true,
             (&Some(ref s), &Some(ref other)) => *s.read() == *other.read(),
             _ => false,
         }
     }
 }
 
 unsafe impl HasFFI for GeckoDeclarationBlock {
-    type FFIType = bindings::ServoDeclarationBlock;
+    type FFIType = bindings::RawServoDeclarationBlock;
 }
 unsafe impl HasArcFFI for GeckoDeclarationBlock {}
 
 
 // We can eliminate OpaqueStyleData when the bindings move into the style crate.
 fn to_opaque_style_data(d: *mut NonOpaqueStyleData) -> *mut OpaqueStyleData {
     d as *mut OpaqueStyleData
 }
--- a/servo/components/style/gecko_bindings/bindings.rs
+++ b/servo/components/style/gecko_bindings/bindings.rs
@@ -5,21 +5,21 @@ pub type ServoComputedValuesBorrowedOrNu
 pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;
 enum ServoComputedValuesVoid{ }
 pub struct ServoComputedValues(ServoComputedValuesVoid);
 pub type RawServoStyleSheetStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoStyleSheet>;
 pub type RawServoStyleSheetBorrowedOrNull<'a> = Option<&'a RawServoStyleSheet>;
 pub type RawServoStyleSheetBorrowed<'a> = &'a RawServoStyleSheet;
 enum RawServoStyleSheetVoid{ }
 pub struct RawServoStyleSheet(RawServoStyleSheetVoid);
-pub type ServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<ServoDeclarationBlock>;
-pub type ServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a ServoDeclarationBlock>;
-pub type ServoDeclarationBlockBorrowed<'a> = &'a ServoDeclarationBlock;
-enum ServoDeclarationBlockVoid{ }
-pub struct ServoDeclarationBlock(ServoDeclarationBlockVoid);
+pub type RawServoDeclarationBlockStrong = ::gecko_bindings::sugar::ownership::Strong<RawServoDeclarationBlock>;
+pub type RawServoDeclarationBlockBorrowedOrNull<'a> = Option<&'a RawServoDeclarationBlock>;
+pub type RawServoDeclarationBlockBorrowed<'a> = &'a RawServoDeclarationBlock;
+enum RawServoDeclarationBlockVoid{ }
+pub struct RawServoDeclarationBlock(RawServoDeclarationBlockVoid);
 pub type RawGeckoNodeBorrowed<'a> = &'a RawGeckoNode;
 pub type RawGeckoNodeBorrowedOrNull<'a> = Option<&'a RawGeckoNode>;
 pub type RawGeckoElementBorrowed<'a> = &'a RawGeckoElement;
 pub type RawGeckoElementBorrowedOrNull<'a> = Option<&'a RawGeckoElement>;
 pub type RawGeckoDocumentBorrowed<'a> = &'a RawGeckoDocument;
 pub type RawGeckoDocumentBorrowedOrNull<'a> = Option<&'a RawGeckoDocument>;
 pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet;
 pub type RawServoStyleSetBorrowedMut<'a> = &'a mut RawServoStyleSet;
@@ -362,17 +362,17 @@ extern "C" {
 extern "C" {
     pub fn Gecko_SnapshotClassOrClassList(element: *mut ServoElementSnapshot,
                                           class_: *mut *mut nsIAtom,
                                           classList: *mut *mut *mut nsIAtom)
      -> u32;
 }
 extern "C" {
     pub fn Gecko_GetServoDeclarationBlock(element: RawGeckoElementBorrowed)
-     -> ServoDeclarationBlockBorrowedOrNull;
+     -> RawServoDeclarationBlockBorrowedOrNull;
 }
 extern "C" {
     pub fn Gecko_Atomize(aString: *const ::std::os::raw::c_char, aLength: u32)
      -> *mut nsIAtom;
 }
 extern "C" {
     pub fn Gecko_AddRefAtom(aAtom: *mut nsIAtom);
 }
@@ -846,59 +846,59 @@ extern "C" {
 extern "C" {
     pub fn Servo_ParseProperty(property_bytes: *const u8,
                                property_length: u32, value_bytes: *const u8,
                                value_length: u32, base_bytes: *const u8,
                                base_length: u32,
                                base: *mut ThreadSafeURIHolder,
                                referrer: *mut ThreadSafeURIHolder,
                                principal: *mut ThreadSafePrincipalHolder)
-     -> ServoDeclarationBlockStrong;
+     -> RawServoDeclarationBlockStrong;
 }
 extern "C" {
     pub fn Servo_RestyleWithAddedDeclaration(declarations:
-                                                 ServoDeclarationBlockBorrowed,
+                                                 RawServoDeclarationBlockBorrowed,
                                              previous_style:
                                                  ServoComputedValuesBorrowed)
      -> ServoComputedValuesStrong;
 }
 extern "C" {
     pub fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
                                      cache: *mut nsHTMLCSSStyleSheet)
-     -> ServoDeclarationBlockStrong;
+     -> RawServoDeclarationBlockStrong;
 }
 extern "C" {
     pub fn Servo_DeclarationBlock_AddRef(declarations:
-                                             ServoDeclarationBlockBorrowed);
+                                             RawServoDeclarationBlockBorrowed);
 }
 extern "C" {
     pub fn Servo_DeclarationBlock_Release(declarations:
-                                              ServoDeclarationBlockBorrowed);
+                                              RawServoDeclarationBlockBorrowed);
 }
 extern "C" {
-    pub fn Servo_DeclarationBlock_Equals(a: ServoDeclarationBlockBorrowed,
-                                         b: ServoDeclarationBlockBorrowed)
+    pub fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
+                                         b: RawServoDeclarationBlockBorrowed)
      -> bool;
 }
 extern "C" {
     pub fn Servo_DeclarationBlock_GetCache(declarations:
-                                               ServoDeclarationBlockBorrowed)
+                                               RawServoDeclarationBlockBorrowed)
      -> *mut nsHTMLCSSStyleSheet;
 }
 extern "C" {
     pub fn Servo_DeclarationBlock_SetImmutable(declarations:
-                                                   ServoDeclarationBlockBorrowed);
+                                                   RawServoDeclarationBlockBorrowed);
 }
 extern "C" {
     pub fn Servo_DeclarationBlock_ClearCachePointer(declarations:
-                                                        ServoDeclarationBlockBorrowed);
+                                                        RawServoDeclarationBlockBorrowed);
 }
 extern "C" {
     pub fn Servo_DeclarationBlock_SerializeOneValue(declarations:
-                                                        ServoDeclarationBlockBorrowed,
+                                                        RawServoDeclarationBlockBorrowed,
                                                     buffer: *mut nsString);
 }
 extern "C" {
     pub fn Servo_CSSSupports(name: *const u8, name_length: u32,
                              value: *const u8, value_length: u32) -> bool;
 }
 extern "C" {
     pub fn Servo_ComputedValues_Get(node: RawGeckoNodeBorrowed)
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -22,17 +22,17 @@ use style::gecko::selector_impl::{GeckoS
 use style::gecko::snapshot::GeckoElementSnapshot;
 use style::gecko::traversal::RecalcStyleOnly;
 use style::gecko::wrapper::{DUMMY_BASE_URL, GeckoDeclarationBlock};
 use style::gecko::wrapper::{GeckoElement, GeckoNode};
 use style::gecko_bindings::bindings::{RawGeckoElementBorrowed, RawGeckoNodeBorrowed};
 use style::gecko_bindings::bindings::{RawServoStyleSetBorrowed, RawServoStyleSetOwned};
 use style::gecko_bindings::bindings::{RawServoStyleSheetBorrowed, ServoComputedValuesBorrowed};
 use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedValuesStrong};
-use style::gecko_bindings::bindings::{ServoDeclarationBlockBorrowed, ServoDeclarationBlockStrong};
+use style::gecko_bindings::bindings::{RawServoDeclarationBlockBorrowed, RawServoDeclarationBlockStrong};
 use style::gecko_bindings::bindings::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
 use style::gecko_bindings::bindings::{nsHTMLCSSStyleSheet, ServoComputedValuesBorrowedOrNull};
 use style::gecko_bindings::bindings::Gecko_Utf8SliceToString;
 use style::gecko_bindings::ptr::{GeckoArcPrincipal, GeckoArcURI};
 use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom};
 use style::gecko_bindings::structs::ServoElementSnapshot;
 use style::gecko_bindings::structs::nsRestyleHint;
 use style::gecko_bindings::structs::nsString;
@@ -122,17 +122,17 @@ fn restyle_subtree(node: GeckoNode, raw_
 #[no_mangle]
 pub extern "C" fn Servo_RestyleSubtree(node: RawGeckoNodeBorrowed,
                                        raw_data: RawServoStyleSetBorrowed) -> () {
     let node = GeckoNode(node);
     restyle_subtree(node, raw_data);
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_RestyleWithAddedDeclaration(declarations: ServoDeclarationBlockBorrowed,
+pub extern "C" fn Servo_RestyleWithAddedDeclaration(declarations: RawServoDeclarationBlockBorrowed,
                                                     previous_style: ServoComputedValuesBorrowed)
   -> ServoComputedValuesStrong
 {
     match GeckoDeclarationBlock::as_arc(&declarations).declarations {
         Some(ref declarations) => {
             let declaration_block = ApplicableDeclarationBlock {
                 mixed_declarations: declarations.clone(),
                 importance: Importance::Normal,
@@ -376,17 +376,17 @@ pub extern "C" fn Servo_ParseProperty(pr
                                       property_length: u32,
                                       value_bytes: *const u8,
                                       value_length: u32,
                                       base_bytes: *const u8,
                                       base_length: u32,
                                       base: *mut ThreadSafeURIHolder,
                                       referrer: *mut ThreadSafeURIHolder,
                                       principal: *mut ThreadSafePrincipalHolder)
-                                      -> ServoDeclarationBlockStrong {
+                                      -> RawServoDeclarationBlockStrong {
     // All this string wrangling is temporary until the Gecko string bindings land (bug 1294742).
     let name = unsafe { from_utf8_unchecked(slice::from_raw_parts(property_bytes,
                                                                   property_length as usize)) };
     let value_str = unsafe { from_utf8_unchecked(slice::from_raw_parts(value_bytes,
                                                                        value_length as usize)) };
     let base_str = unsafe { from_utf8_unchecked(slice::from_raw_parts(base_bytes,
                                                                       base_length as usize)) };
     let base_url = Url::parse(base_str).unwrap();
@@ -399,80 +399,80 @@ pub extern "C" fn Servo_ParseProperty(pr
     let context = ParserContext::new_with_extra_data(Origin::Author, &base_url,
                                                      Box::new(StdoutErrorReporter),
                                                      extra_data);
 
     let mut results = vec![];
     match PropertyDeclaration::parse(name, &context, &mut Parser::new(value_str),
                                      &mut results, false) {
         PropertyDeclarationParseResult::ValidOrIgnoredDeclaration => {},
-        _ => return ServoDeclarationBlockStrong::null(),
+        _ => return RawServoDeclarationBlockStrong::null(),
     }
 
     let results = results.into_iter().map(|r| (r, Importance::Normal)).collect();
 
     Arc::new(GeckoDeclarationBlock {
         declarations: Some(Arc::new(RwLock::new(PropertyDeclarationBlock {
             declarations: results,
             important_count: 0,
         }))),
         cache: AtomicPtr::new(ptr::null_mut()),
         immutable: AtomicBool::new(false),
     }).into_strong()
 }
 #[no_mangle]
 pub extern "C" fn Servo_ParseStyleAttribute(bytes: *const u8, length: u32,
                                             cache: *mut nsHTMLCSSStyleSheet)
-                                            -> ServoDeclarationBlockStrong {
+                                            -> RawServoDeclarationBlockStrong {
     let value = unsafe { from_utf8_unchecked(slice::from_raw_parts(bytes, length as usize)) };
     Arc::new(GeckoDeclarationBlock {
         declarations: GeckoElement::parse_style_attribute(value).map(|block| {
             Arc::new(RwLock::new(block))
         }),
         cache: AtomicPtr::new(cache),
         immutable: AtomicBool::new(false),
     }).into_strong()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: ServoDeclarationBlockBorrowed) {
+pub extern "C" fn Servo_DeclarationBlock_AddRef(declarations: RawServoDeclarationBlockBorrowed) {
     unsafe { GeckoDeclarationBlock::addref(declarations) };
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_Release(declarations: ServoDeclarationBlockBorrowed) {
+pub extern "C" fn Servo_DeclarationBlock_Release(declarations: RawServoDeclarationBlockBorrowed) {
     unsafe { GeckoDeclarationBlock::release(declarations) };
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_Equals(a: ServoDeclarationBlockBorrowed,
-                                                b: ServoDeclarationBlockBorrowed)
+pub extern "C" fn Servo_DeclarationBlock_Equals(a: RawServoDeclarationBlockBorrowed,
+                                                b: RawServoDeclarationBlockBorrowed)
                                                 -> bool {
     GeckoDeclarationBlock::as_arc(&a) == GeckoDeclarationBlock::as_arc(&b)
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_GetCache(declarations: ServoDeclarationBlockBorrowed)
+pub extern "C" fn Servo_DeclarationBlock_GetCache(declarations: RawServoDeclarationBlockBorrowed)
                                                  -> *mut nsHTMLCSSStyleSheet {
     GeckoDeclarationBlock::as_arc(&declarations).cache.load(Ordering::Relaxed)
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_SetImmutable(declarations: ServoDeclarationBlockBorrowed) {
+pub extern "C" fn Servo_DeclarationBlock_SetImmutable(declarations: RawServoDeclarationBlockBorrowed) {
     GeckoDeclarationBlock::as_arc(&declarations).immutable.store(true, Ordering::Relaxed)
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_ClearCachePointer(declarations: ServoDeclarationBlockBorrowed) {
+pub extern "C" fn Servo_DeclarationBlock_ClearCachePointer(declarations: RawServoDeclarationBlockBorrowed) {
     GeckoDeclarationBlock::as_arc(&declarations).cache.store(ptr::null_mut(), Ordering::Relaxed)
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
-    declarations: ServoDeclarationBlockBorrowed,
+    declarations: RawServoDeclarationBlockBorrowed,
     buffer: *mut nsString)
 {
     let mut string = String::new();
 
     if let Some(ref declarations) = GeckoDeclarationBlock::as_arc(&declarations).declarations {
         declarations.read().to_css(&mut string).unwrap();
         // FIXME: We are expecting |declarations| to be a declaration block with either a single
         // longhand property-declaration or a series of longhand property-declarations that make