Bug 1203610 - Don't load on-demand non-SVG UA sheets during static document clone. r=jwatt
authorCameron McCormack <cam@mcc.id.au>
Tue, 20 Oct 2015 08:59:37 +1100
changeset 303587 d61b658a2a1a9ec5abc425b79fbddcbeb1bbb300
parent 303586 ebad4f2326b0743115142e8105f0878000d0f410
child 303588 6f5bc07956271a643b581fc2bc716e6df8544e17
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1203610
milestone44.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 1203610 - Don't load on-demand non-SVG UA sheets during static document clone. r=jwatt
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