Backed out changeset 17c54acc6645 (bug 1061469)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 02 Oct 2014 14:00:11 +0200
changeset 231599 28d109731c7cb6b877051002a34046b11b37c4e7
parent 231598 d1dfdafb5d7caa218a6d76106c4ad9eda9573394
child 231600 8faadc76fca8737bd96a6b86fa98a988de953f1a
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1061469
milestone35.0a1
backs out17c54acc6645fadfb5ce226ed366910d813eda40
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
Backed out changeset 17c54acc6645 (bug 1061469)
content/base/src/ImportManager.cpp
--- a/content/base/src/ImportManager.cpp
+++ b/content/base/src/ImportManager.cpp
@@ -737,40 +737,32 @@ ImportManager::AddLoaderWithNewURI(Impor
 }
 
 nsRefPtr<ImportLoader> ImportManager::GetNearestPredecessor(nsINode* aNode)
 {
   // Return the previous link if there is any in the same document.
   nsIDocument* doc = aNode->OwnerDoc();
   int32_t idx = doc->IndexOfSubImportLink(aNode);
   MOZ_ASSERT(idx != -1, "aNode must be a sub import link of its owner document");
-
-  for (; idx > 0; idx--) {
-    HTMLLinkElement* link =
-      static_cast<HTMLLinkElement*>(doc->GetSubImportLink(idx - 1));
-    nsCOMPtr<nsIURI> uri = link->GetHrefURI();
-    nsRefPtr<ImportLoader> ret;
-    mImports.Get(uri, getter_AddRefs(ret));
-    // Only main referrer links are interesting.
-    if (ret->GetMainReferrer() == link) {
-      return ret;
-    }
-  }
-
   if (idx == 0) {
     if (doc->IsMasterDocument()) {
       // If there is no previous one, and it was the master document, then
       // there is no predecessor.
       return nullptr;
     }
     // Else we find the main referrer of the import parent of the link's document.
     // And do a recursion.
     ImportLoader* owner = Find(doc);
     MOZ_ASSERT(owner);
     nsCOMPtr<nsINode> mainReferrer = owner->GetMainReferrer();
     return GetNearestPredecessor(mainReferrer);
   }
-
-  return nullptr;
+  MOZ_ASSERT(idx > 0);
+  HTMLLinkElement* link =
+    static_cast<HTMLLinkElement*>(doc->GetSubImportLink(idx - 1));
+  nsCOMPtr<nsIURI> uri = link->GetHrefURI();
+  nsRefPtr<ImportLoader> ret;
+  mImports.Get(uri, getter_AddRefs(ret));
+  return ret;
 }
 
 } // namespace dom
 } // namespace mozilla