Bug 1499408 - Part 2: Have css::URLValue get URLExtraData from its CssUrlData. r=emilio
authorCameron McCormack <cam@mcc.id.au>
Wed, 17 Oct 2018 09:43:32 +0000
changeset 500122 4ffda0cdc604ee19810a2fcfc255e1838f98c2a1
parent 500121 23ee4dcfdbaf0d4508d76ac9f8cb9bbcf3e61db7
child 500123 2920174a5acf0599f64672b65e2cae110b8a6dbc
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1499408
milestone64.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 1499408 - Part 2: Have css::URLValue get URLExtraData from its CssUrlData. r=emilio MozReview-Commit-ID: IqZGzkHlSZD Depends on D8874 Differential Revision: https://phabricator.services.mozilla.com/D8875
dom/base/Element.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/style/FontFaceSet.cpp
layout/style/GeckoBindings.cpp
layout/style/GeckoBindings.h
layout/style/ImageLoader.cpp
layout/style/ServoBindings.h
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
layout/svg/SVGObserverUtils.cpp
layout/svg/SVGObserverUtils.h
layout/svg/nsSVGFilterInstance.cpp
servo/components/style/gecko/url.rs
servo/ports/geckolib/glue.rs
servo/ports/geckolib/stylesheet_loader.rs
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -617,17 +617,17 @@ Element::WrapObject(JSContext *aCx, JS::
     bool ok = GetBindingURL(doc, getter_AddRefs(bindingURL));
     if (!ok) {
       dom::Throw(aCx, NS_ERROR_FAILURE);
       return nullptr;
     }
 
     if (bindingURL) {
       nsCOMPtr<nsIURI> uri = bindingURL->GetURI();
-      nsCOMPtr<nsIPrincipal> principal = bindingURL->mExtraData->Principal();
+      nsCOMPtr<nsIPrincipal> principal = bindingURL->ExtraData()->Principal();
 
       // We have a binding that must be installed.
       bool dummy;
 
       nsXBLService* xblService = nsXBLService::GetInstance();
       if (!xblService) {
         dom::Throw(aCx, NS_ERROR_NOT_AVAILABLE);
         return nullptr;
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2421,17 +2421,17 @@ nsCSSFrameConstructor::ConstructDocEleme
 
     nsXBLService* xblService = nsXBLService::GetInstance();
     if (!xblService) {
       return nullptr;
     }
 
     RefPtr<nsXBLBinding> binding;
     rv = xblService->LoadBindings(aDocElement, display->mBinding->GetURI(),
-                                  display->mBinding->mExtraData->Principal(),
+                                  display->mBinding->ExtraData()->Principal(),
                                   getter_AddRefs(binding), &resolveStyle);
     if (NS_FAILED(rv) && rv != NS_ERROR_XBL_BLOCKED) {
       // Binding will load asynchronously.
       return nullptr;
     }
 
     if (binding) {
       // For backwards compat, keep firing the root's constructor
@@ -5575,17 +5575,17 @@ nsCSSFrameConstructor::LoadXBLBindingIfN
     return { };
   }
 
   auto newPendingBinding = MakeUnique<PendingBinding>();
 
   bool resolveStyle;
   nsresult rv = xblService->LoadBindings(aContent.AsElement(),
                                          binding->GetURI(),
-                                         binding->mExtraData->Principal(),
+                                         binding->ExtraData()->Principal(),
                                          getter_AddRefs(newPendingBinding->mBinding),
                                          &resolveStyle);
   if (NS_FAILED(rv)) {
     if (rv == NS_ERROR_XBL_BLOCKED) {
       return { aContent, aStyle };
     }
     return { };
   }
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -1097,20 +1097,21 @@ FontFaceSet::FindOrCreateUserFontEntryFr
           face->mReferrerPolicy = mozilla::net::RP_Unset;
           break;
         }
         case StyleFontFaceSourceListComponent::Tag::Url: {
           face->mSourceType = gfxFontFaceSrc::eSourceType_URL;
           const URLValue* url = component.url._0;
           nsIURI* uri = url->GetURI();
           face->mURI = uri ? new gfxFontSrcURI(uri) : nullptr;
-          face->mReferrer = url->mExtraData->GetReferrer();
-          face->mReferrerPolicy = url->mExtraData->GetReferrerPolicy();
+          URLExtraData* extraData = url->ExtraData();
+          face->mReferrer = extraData->GetReferrer();
+          face->mReferrerPolicy = extraData->GetReferrerPolicy();
           face->mOriginPrincipal =
-            new gfxFontSrcPrincipal(url->mExtraData->Principal());
+            new gfxFontSrcPrincipal(extraData->Principal());
 
           // agent and user stylesheets are treated slightly differently,
           // the same-site origin check and access control headers are
           // enforced against the sheet principal rather than the document
           // principal to allow user stylesheets to include @font-face rules
           face->mUseOriginPrincipal = (aSheetType == SheetType::User ||
                                        aSheetType == SheetType::Agent);
 
--- a/layout/style/GeckoBindings.cpp
+++ b/layout/style/GeckoBindings.cpp
@@ -1992,22 +1992,19 @@ void
 Gecko_nsStyleSVG_CopyContextProperties(nsStyleSVG* aDst, const nsStyleSVG* aSrc)
 {
   aDst->mContextProps = aSrc->mContextProps;
   aDst->mContextPropsBits = aSrc->mContextPropsBits;
 }
 
 
 css::URLValue*
-Gecko_URLValue_Create(RawServoCssUrlDataStrong aCssUrl,
-                      URLExtraData* aExtraData,
-                      CORSMode aCORSMode)
+Gecko_URLValue_Create(RawServoCssUrlDataStrong aCssUrl, CORSMode aCORSMode)
 {
-  RefPtr<css::URLValue> url =
-    new css::URLValue(aCssUrl.Consume(), aExtraData, aCORSMode);
+  RefPtr<css::URLValue> url = new css::URLValue(aCssUrl.Consume(), aCORSMode);
   return url.forget().take();
 }
 
 MOZ_DEFINE_MALLOC_SIZE_OF(GeckoURLValueMallocSizeOf)
 
 size_t
 Gecko_URLValue_SizeOfIncludingThis(URLValue* aURL)
 {
@@ -2565,58 +2562,55 @@ LoadImportSheet(css::Loader* aLoader,
     RefPtr<StyleSheet> emptySheet =
       aParent->CreateEmptyChildSheet(media.forget());
     // Make a dummy URI if we don't have one because some methods assume
     // non-null URIs.
     if (!uri) {
       NS_NewURI(getter_AddRefs(uri), NS_LITERAL_CSTRING("about:invalid"));
     }
     emptySheet->SetURIs(uri, uri, uri);
-    emptySheet->SetPrincipal(aURL->mExtraData->Principal());
+    emptySheet->SetPrincipal(aURL->ExtraData()->Principal());
     emptySheet->SetComplete();
     aParent->PrependStyleSheet(emptySheet);
     return emptySheet.forget();
   }
 
   RefPtr<StyleSheet> sheet =
     static_cast<StyleSheet*>(aParent->GetFirstChild());
   return sheet.forget();
 }
 
 StyleSheet*
 Gecko_LoadStyleSheet(css::Loader* aLoader,
                      StyleSheet* aParent,
                      SheetLoadData* aParentLoadData,
                      css::LoaderReusableStyleSheets* aReusableSheets,
                      RawServoCssUrlDataStrong aCssUrl,
-                     URLExtraData* aExtraData,
                      RawServoMediaListStrong aMediaList)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // The CORS mode in the URLValue is irrelevant here.
   // (CORS_NONE is used for all imported sheets in Load::LoadChildSheet.)
-  RefPtr<css::URLValue> url =
-    new css::URLValue(aCssUrl.Consume(), aExtraData, CORS_NONE);
+  RefPtr<css::URLValue> url = new css::URLValue(aCssUrl.Consume(), CORS_NONE);
   return LoadImportSheet(aLoader, aParent, aParentLoadData, aReusableSheets,
                          url, aMediaList.Consume()).take();
 }
 
 void
 Gecko_LoadStyleSheetAsync(css::SheetLoadDataHolder* aParentData,
                           RawServoCssUrlDataStrong aCssUrl,
-                          URLExtraData* aExtraData,
                           RawServoMediaListStrong aMediaList,
                           RawServoImportRuleStrong aImportRule)
 {
   RefPtr<SheetLoadDataHolder> loadData = aParentData;
   // The CORS mode in the URLValue is irrelevant here.
   // (CORS_NONE is used for all imported sheets in Load::LoadChildSheet.)
   RefPtr<css::URLValue> urlVal =
-    new css::URLValue(aCssUrl.Consume(), aExtraData, CORS_NONE);
+    new css::URLValue(aCssUrl.Consume(), CORS_NONE);
   RefPtr<RawServoMediaList> mediaList = aMediaList.Consume();
   RefPtr<RawServoImportRule> importRule = aImportRule.Consume();
   NS_DispatchToMainThread(NS_NewRunnableFunction(__func__,
                                                  [data = std::move(loadData),
                                                   url = std::move(urlVal),
                                                   media = std::move(mediaList),
                                                   import = std::move(importRule)]() mutable {
     MOZ_ASSERT(NS_IsMainThread());
--- a/layout/style/GeckoBindings.h
+++ b/layout/style/GeckoBindings.h
@@ -125,23 +125,21 @@ void Gecko_StyleSheet_FinishAsyncParse(
   StyleUseCountersOwnedOrNull use_counters);
 
 mozilla::StyleSheet* Gecko_LoadStyleSheet(
   mozilla::css::Loader* loader,
   mozilla::StyleSheet* parent,
   mozilla::css::SheetLoadData* parent_load_data,
   mozilla::css::LoaderReusableStyleSheets* reusable_sheets,
   RawServoCssUrlDataStrong url,
-  RawGeckoURLExtraData* url_extra_data,
   RawServoMediaListStrong media_list);
 
 void Gecko_LoadStyleSheetAsync(
   mozilla::css::SheetLoadDataHolder* parent_data,
   RawServoCssUrlDataStrong url,
-  RawGeckoURLExtraData* url_extra_data,
   RawServoMediaListStrong media_list,
   RawServoImportRuleStrong import_rule);
 
 // Selector Matching.
 uint64_t Gecko_ElementState(RawGeckoElementBorrowed element);
 bool Gecko_IsRootElement(RawGeckoElementBorrowed element);
 
 bool Gecko_MatchLang(
@@ -639,17 +637,16 @@ void Gecko_nsStyleSVG_CopyDashArray(nsSt
 void Gecko_nsStyleSVG_SetContextPropertiesLength(nsStyleSVG* svg, uint32_t len);
 
 void Gecko_nsStyleSVG_CopyContextProperties(
   nsStyleSVG* dst,
   const nsStyleSVG* src);
 
 mozilla::css::URLValue* Gecko_URLValue_Create(
   RawServoCssUrlDataStrong url,
-  RawGeckoURLExtraData* extra_data,
   mozilla::CORSMode aCORSMode);
 
 size_t Gecko_URLValue_SizeOfIncludingThis(mozilla::css::URLValue* url);
 
 void Gecko_GetComputedURLSpec(
   const mozilla::css::URLValue* url,
   nsCString* spec);
 
--- a/layout/style/ImageLoader.cpp
+++ b/layout/style/ImageLoader.cpp
@@ -478,18 +478,17 @@ ImageLoader::LoadImage(URLValue* aImage,
   nsIURI* uri = aImage->GetURI();
   if (!uri) {
     return;
   }
 
   int32_t loadFlags = nsIRequest::LOAD_NORMAL |
                       nsContentUtils::CORSModeToLoadImageFlags(aImage->CorsMode());
 
-  URLExtraData* data = aImage->mExtraData;
-
+  URLExtraData* data = aImage->ExtraData();
 
   RefPtr<imgRequestProxy> request;
   nsresult rv = nsContentUtils::LoadImage(uri, aLoadingDoc, aLoadingDoc,
                                           data->Principal(), 0,
                                           data->GetReferrer(),
                                           data->GetReferrerPolicy(),
                                           nullptr,
                                           loadFlags,
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -1090,16 +1090,19 @@ void Servo_ProcessInvalidations(
 
 bool Servo_HasPendingRestyleAncestor(RawGeckoElementBorrowed element);
 
 void Servo_CssUrlData_GetSerialization(
   RawServoCssUrlDataBorrowed url,
   uint8_t const** chars,
   uint32_t* len);
 
+RawGeckoURLExtraDataBorrowedMut Servo_CssUrlData_GetExtraData(
+  RawServoCssUrlDataBorrowed url);
+
 // CSS parsing utility functions.
 
 bool Servo_IsValidCSSColor(const nsAString* value);
 
 bool Servo_ComputeColor(
   RawServoStyleSetBorrowedOrNull set,
   nscolor current_color,
   const nsAString* value,
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -821,44 +821,44 @@ css::URLValue::~URLValue()
 }
 
 bool
 css::URLValue::Equals(const URLValue& aOther) const
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   bool eq;
-  const URLExtraData* self = mExtraData;
-  const URLExtraData* other = aOther.mExtraData;
+  const URLExtraData* self = ExtraData();
+  const URLExtraData* other = aOther.ExtraData();
   return GetString() == aOther.GetString() &&
           (GetURI() == aOther.GetURI() || // handles null == null
            (mURI && aOther.mURI &&
             NS_SUCCEEDED(mURI->Equals(aOther.mURI, &eq)) &&
             eq)) &&
           (self->BaseURI() == other->BaseURI() ||
            (NS_SUCCEEDED(self->BaseURI()->Equals(other->BaseURI(), &eq)) &&
             eq)) &&
           self->Principal()->Equals(other->Principal()) &&
           IsLocalRef() == aOther.IsLocalRef();
 }
 
 bool
 css::URLValue::DefinitelyEqualURIs(const URLValue& aOther) const
 {
-  if (mExtraData->BaseURI() != aOther.mExtraData->BaseURI()) {
+  if (ExtraData()->BaseURI() != aOther.ExtraData()->BaseURI()) {
     return false;
   }
   return GetString() == aOther.GetString();
 }
 
 bool
 css::URLValue::DefinitelyEqualURIsAndPrincipal(
     const URLValue& aOther) const
 {
-  return mExtraData->Principal() == aOther.mExtraData->Principal() &&
+  return ExtraData()->Principal() == aOther.ExtraData()->Principal() &&
          DefinitelyEqualURIs(aOther);
 }
 
 nsDependentCSubstring
 css::URLValue::GetString() const
 {
   const uint8_t* chars;
   uint32_t len;
@@ -871,17 +871,17 @@ css::URLValue::GetURI() const
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mURIResolved) {
     MOZ_ASSERT(!mURI);
     nsCOMPtr<nsIURI> newURI;
     NS_NewURI(getter_AddRefs(newURI),
               GetString(),
-              nullptr, mExtraData->BaseURI());
+              nullptr, ExtraData()->BaseURI());
     mURI = newURI.forget();
     mURIResolved = true;
   }
 
   return mURI;
 }
 
 bool
@@ -968,17 +968,16 @@ css::URLValue::GetSourceString(nsString&
 
 size_t
 css::URLValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   // Measurement of the following members may be added later if DMD finds it
   // is worthwhile:
   // - mURI
   // - mString
-  // - mExtraData
 
   // Only measure it if it's unshared, to avoid double-counting.
   size_t n = 0;
   if (mRefCnt <= 1) {
     n += aMallocSizeOf(this);
   }
   return n;
 }
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -85,32 +85,35 @@ class CSSStyleSheet;
         delete (to_);                                                          \
         return nullptr;                                                        \
       }                                                                        \
       dest->member_ = clm_clone;                                               \
       dest = clm_clone;                                                        \
     }                                                                          \
   }
 
+// Forward declaration copied here since ServoBindings.h #includes nsCSSValue.h.
+extern "C" {
+  RawGeckoURLExtraDataBorrowedMut Servo_CssUrlData_GetExtraData(
+    RawServoCssUrlDataBorrowed url);
+}
+
 namespace mozilla {
 namespace css {
 
 struct URLValue final
 {
 public:
-  // aCssUrl and aExtraData must not be null.
+  // aCssUrl must not be null.
   URLValue(already_AddRefed<RawServoCssUrlData> aCssUrl,
-           URLExtraData* aExtraData,
            CORSMode aCORSMode)
-    : mExtraData(aExtraData)
-    , mURIResolved(false)
+    : mURIResolved(false)
     , mCssUrl(aCssUrl)
     , mCORSMode(aCORSMode)
   {
-    MOZ_ASSERT(mExtraData);
     MOZ_ASSERT(mCssUrl);
   }
 
   // Returns true iff all fields of the two URLValue objects are equal.
   //
   // Only safe to call on the main thread, since this will call Equals on the
   // nsIURI and nsIPrincipal objects stored on the URLValue objects.
   bool Equals(const URLValue& aOther) const;
@@ -150,25 +153,26 @@ public:
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   imgRequestProxy* LoadImage(nsIDocument* aDocument);
 
   uint64_t LoadID() const { return mLoadID; }
 
   CORSMode CorsMode() const { return mCORSMode; }
 
+  URLExtraData* ExtraData() const
+  {
+    return Servo_CssUrlData_GetExtraData(mCssUrl);
+  }
+
 private:
   // mURI stores the lazily resolved URI.  This may be null if the URI is
   // invalid, even once resolved.
   mutable nsCOMPtr<nsIURI> mURI;
 
-public:
-  RefPtr<URLExtraData> mExtraData;
-
-private:
   mutable bool mURIResolved;
 
   // mIsLocalRef is set when url starts with a U+0023 number sign(#) character.
   mutable Maybe<bool> mIsLocalRef;
 
   RefPtr<RawServoCssUrlData> mCssUrl;
 
   const CORSMode mCORSMode;
--- a/layout/svg/SVGObserverUtils.cpp
+++ b/layout/svg/SVGObserverUtils.cpp
@@ -41,19 +41,19 @@ ResolveURLUsingLocalRef(nsIFrame* aFrame
     uri = SVGObserverUtils::GetBaseURLForLocalRef(aFrame->GetContent(), uri);
     uri = aURL->ResolveLocalRef(uri);
   }
 
   if (!uri) {
     return nullptr;
   }
 
-  return do_AddRef(new URLAndReferrerInfo(uri,
-                                          aURL->mExtraData->GetReferrer(),
-                                          aURL->mExtraData->GetReferrerPolicy()));
+  RefPtr<URLAndReferrerInfo> info =
+    new URLAndReferrerInfo(uri, aURL->ExtraData());
+  return info.forget();
 }
 
 
 namespace mozilla {
 
 class SVGFilterObserverList;
 
 
@@ -660,18 +660,17 @@ SVGFilterObserverList::SVGFilterObserver
     if (aFilteredFrame) {
       filterURL = ResolveURLUsingLocalRef(aFilteredFrame, aFilters[i].GetURL());
     } else {
       nsCOMPtr<nsIURI> resolvedURI =
         aFilters[i].GetURL()->ResolveLocalRef(aFilteredElement);
       if (resolvedURI) {
         filterURL = new URLAndReferrerInfo(
           resolvedURI,
-          aFilters[i].GetURL()->mExtraData->GetReferrer(),
-          aFilters[i].GetURL()->mExtraData->GetReferrerPolicy());
+          aFilters[i].GetURL()->ExtraData());
       }
     }
 
     RefPtr<SVGFilterObserver> observer =
       new SVGFilterObserver(filterURL, aFilteredElement, this);
     mObservers.AppendElement(observer);
   }
 }
--- a/layout/svg/SVGObserverUtils.h
+++ b/layout/svg/SVGObserverUtils.h
@@ -50,19 +50,27 @@ namespace mozilla {
 class URLAndReferrerInfo
 {
 public:
   URLAndReferrerInfo(nsIURI* aURI, nsIURI* aReferrer,
                      mozilla::net::ReferrerPolicy aReferrerPolicy)
     : mURI(aURI)
     , mReferrer(aReferrer)
     , mReferrerPolicy(aReferrerPolicy)
- {
-   MOZ_ASSERT(aURI);
- }
+  {
+    MOZ_ASSERT(aURI);
+  }
+
+  URLAndReferrerInfo(nsIURI* aURI, URLExtraData* aExtraData)
+    : mURI(aURI)
+    , mReferrer(aExtraData->GetReferrer())
+    , mReferrerPolicy(aExtraData->GetReferrerPolicy())
+  {
+    MOZ_ASSERT(aURI);
+  }
 
   NS_INLINE_DECL_REFCOUNTING(URLAndReferrerInfo)
 
   nsIURI* GetURI() { return mURI; }
   nsIURI* GetReferrer() { return mReferrer; }
   mozilla::net::ReferrerPolicy GetReferrerPolicy() { return mReferrerPolicy; }
 
 private:
--- a/layout/svg/nsSVGFilterInstance.cpp
+++ b/layout/svg/nsSVGFilterInstance.cpp
@@ -142,18 +142,18 @@ nsSVGFilterInstance::GetFilterFrame(nsIF
     MOZ_ASSERT_UNREACHABLE("an nsStyleFilter of type URL should have a non-null URL");
     return nullptr;
   }
 
   // Look up the filter element by URL.
   IDTracker filterElement;
   bool watch = false;
   filterElement.Reset(mTargetContent, url,
-                      mFilter.GetURL()->mExtraData->GetReferrer(),
-                      mFilter.GetURL()->mExtraData->GetReferrerPolicy(),
+                      mFilter.GetURL()->ExtraData()->GetReferrer(),
+                      mFilter.GetURL()->ExtraData()->GetReferrerPolicy(),
                       watch);
   Element* element = filterElement.get();
   if (!element) {
     // The URL points to no element.
     return nullptr;
   }
 
   // Get the frame of the filter element.
--- a/servo/components/style/gecko/url.rs
+++ b/servo/components/style/gecko/url.rs
@@ -113,17 +113,16 @@ impl SpecifiedUrl {
     pub fn parse_from_string(url: String, context: &ParserContext) -> Self {
         Self::from_css_url(CssUrl::parse_from_string(url, context))
     }
 
     fn from_css_url_with_cors(url: CssUrl, cors: CORSMode) -> Self {
         let url_value = unsafe {
             let ptr = bindings::Gecko_URLValue_Create(
                 url.0.clone().into_strong(),
-                url.0.extra_data.0.get(),
                 cors,
             );
             // We do not expect Gecko_URLValue_Create returns null.
             debug_assert!(!ptr.is_null());
             RefPtr::from_addrefed(ptr)
         };
         Self { url, url_value }
     }
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -5469,16 +5469,23 @@ pub unsafe extern "C" fn Servo_CssUrlDat
 ) {
     let url_data = CssUrlData::as_arc(&url);
     let string = url_data.as_str();
     *utf8_len = string.len() as u32;
     *utf8_chars = string.as_ptr();
 }
 
 #[no_mangle]
+pub extern "C" fn Servo_CssUrlData_GetExtraData(
+    url: RawServoCssUrlDataBorrowed,
+) -> *mut URLExtraData {
+    CssUrlData::as_arc(&url).extra_data.0.get()
+}
+
+#[no_mangle]
 pub extern "C" fn Servo_ProcessInvalidations(
     set: RawServoStyleSetBorrowed,
     element: RawGeckoElementBorrowed,
     snapshots: *const ServoElementSnapshotTable,
 ) {
     debug_assert!(!snapshots.is_null());
 
     let element = GeckoElement(element);
--- a/servo/ports/geckolib/stylesheet_loader.rs
+++ b/servo/ports/geckolib/stylesheet_loader.rs
@@ -51,17 +51,16 @@ impl StyleStylesheetLoader for Styleshee
         // so this raw pointer will still be valid.
 
         let child_sheet = unsafe {
             Gecko_LoadStyleSheet(self.0,
                                  self.1,
                                  self.2,
                                  self.3,
                                  url.0.clone().into_strong(),
-                                 url.0.extra_data.0.get(),
                                  media.into_strong())
         };
 
         debug_assert!(!child_sheet.is_null(),
                       "Import rules should always have a strong sheet");
         let sheet = unsafe { GeckoStyleSheet::from_addrefed(child_sheet) };
         let stylesheet = ImportSheet::new(sheet);
         Arc::new(lock.wrap(ImportRule { url, source_location, stylesheet }))
@@ -142,25 +141,23 @@ impl StyleStylesheetLoader for AsyncStyl
     fn request_stylesheet(
         &self,
         url: CssUrl,
         source_location: SourceLocation,
         _context: &ParserContext,
         lock: &SharedRwLock,
         media: Arc<Locked<MediaList>>,
     ) -> Arc<Locked<ImportRule>> {
-        let extra_data = url.0.extra_data.0.get();
         let stylesheet = ImportSheet::new_pending(self.origin, self.quirks_mode);
         let rule = Arc::new(lock.wrap(ImportRule { url: url.clone(), source_location, stylesheet }));
 
         unsafe {
             bindings::Gecko_LoadStyleSheetAsync(
                 self.load_data.get(),
                 url.0.into_strong(),
-                extra_data,
                 media.into_strong(),
                 rule.clone().into_strong()
             );
         }
 
         rule
     }
 }