Bug 1203610 - Don't load on-demand non-SVG UA sheets during static document clone. r=jwatt, a=sylvestre
authorCameron McCormack <cam@mcc.id.au>
Tue, 20 Oct 2015 08:59:37 +1100
changeset 289600 c480e12985af
parent 289599 50213377c223
child 289601 1fd5bf9d2f18
push id5210
push usercbook@mozilla.com
push date2015-10-21 14:38 +0000
treeherdermozilla-beta@1fd5bf9d2f18 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, sylvestre
bugs1203610
milestone42.0
Bug 1203610 - Don't load on-demand non-SVG UA sheets during static document clone. r=jwatt, a=sylvestre
dom/svg/SVGDocument.cpp
--- a/dom/svg/SVGDocument.cpp
+++ b/dom/svg/SVGDocument.cpp
@@ -97,16 +97,24 @@ SVGDocument::Clone(mozilla::dom::NodeInf
 
 void
 SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded()
 {
   if (mHasLoadedNonSVGUserAgentStyleSheets) {
     return;
   }
 
+  if (IsStaticDocument()) {
+    // If we're a static clone of a document, then
+    // nsIDocument::CreateStaticClone will handle cloning the original
+    // document's sheets, including the on-demand non-SVG UA sheets,
+    // for us.
+    return;
+  }
+
   mHasLoadedNonSVGUserAgentStyleSheets = true;
 
   BeginUpdate(UPDATE_STYLE);
 
   if (IsBeingUsedAsImage()) {
     // nsDocumentViewer::CreateStyleSet skipped loading all user-agent/user
     // style sheets in this case, but we'll need B2G/Fennec's
     // content.css. We could load all the sheets registered with the