Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 05 Feb 2013 07:54:46 -0500
changeset 130735 468c097a51131e331b66b7e27ac8828db7d3eaa0
parent 130734 1a05832bcaafa22679c1083fd582df87c8541f14 (current diff)
parent 130666 8f4ec9046b03c6cb67b482e92d80591a4aec34bd (diff)
child 130736 b9dcb082bcec1cbe78c2ad9b31f0870f6b1c24b2
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone21.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
Merge m-c to inbound.
--- a/content/base/src/nsStyleLinkElement.cpp
+++ b/content/base/src/nsStyleLinkElement.cpp
@@ -311,22 +311,24 @@ nsStyleLinkElement::DoUpdateStyleSheet(n
     aOldDocument->RemoveStyleSheet(mStyleSheet);
     aOldDocument->EndUpdate(UPDATE_STYLE);
     nsStyleLinkElement::SetStyleSheet(nullptr);
     if (oldScopeElement) {
       UpdateIsElementInStyleScopeFlagOnSubtree(oldScopeElement);
     }
   }
 
-  if (mDontLoadStyle || !mUpdatesEnabled) {
+  NS_ENSURE_TRUE(thisContent, NS_ERROR_FAILURE);
+
+  // When static documents are created, stylesheets are cloned manually.
+  if (mDontLoadStyle || !mUpdatesEnabled ||
+      thisContent->OwnerDoc()->IsStaticDocument()) {
     return NS_OK;
   }
 
-  NS_ENSURE_TRUE(thisContent, NS_ERROR_FAILURE);
-
   nsCOMPtr<nsIDocument> doc = thisContent->GetDocument();
 
   if (!doc || !doc->CSSLoader()->GetEnabled()) {
     return NS_OK;
   }
 
   bool isInline;
   nsCOMPtr<nsIURI> uri = GetStyleSheetURL(&isInline);