Backed out changeset 7c3ddf34fc42 (bug 1377158) for stylo failures
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 25 Jul 2017 14:34:14 +0200
changeset 421941 1f122ddfeedd498bbf4d3d452a68e0c17f35b789
parent 421940 941e995a4a30f7f4922a7fc2e664f750c210bba6
child 421942 8a193ce80a59d7a2062783efdf215c4c36fd8d6f
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1377158
milestone56.0a1
backs out7c3ddf34fc42d5fb32a9cd2d98ba84f3c606dc7d
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 7c3ddf34fc42 (bug 1377158) for stylo failures
docshell/base/nsDocShell.cpp
docshell/base/nsIDocumentLoaderFactory.idl
dom/base/nsDocument.cpp
image/SVGDocumentWrapper.cpp
layout/build/nsContentDLF.cpp
layout/build/nsContentDLF.h
xpfe/components/directory/nsDirectoryViewer.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9362,25 +9362,23 @@ nsDocShell::NewContentViewerObj(const ns
   nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
     nsContentUtils::FindInternalContentViewer(aContentType);
   if (!docLoaderFactory) {
     return NS_ERROR_FAILURE;
   }
 
   // Now create an instance of the content viewer nsLayoutDLF makes the
   // determination if it should be a "view-source" instead of "view"
-  nsresult rv =
-    docLoaderFactory->CreateInstance("view",
-                                     aOpenedChannel,
-                                     aLoadGroup, aContentType,
-                                     this,
-                                     nullptr,
-                                     nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
-                                     aContentHandler,
-                                     aViewer);
+  nsresult rv = docLoaderFactory->CreateInstance("view",
+                                                 aOpenedChannel,
+                                                 aLoadGroup, aContentType,
+                                                 this,
+                                                 nullptr,
+                                                 aContentHandler,
+                                                 aViewer);
   NS_ENSURE_SUCCESS(rv, rv);
 
   (*aViewer)->SetContainer(this);
   return NS_OK;
 }
 
 nsresult
 nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
--- a/docshell/base/nsIDocumentLoaderFactory.idl
+++ b/docshell/base/nsIDocumentLoaderFactory.idl
@@ -19,29 +19,22 @@ interface nsIPrincipal;
  * for a given mimetype, use nsICategoryManager to find an entry
  * with the mimetype as its name in the category "Gecko-Content-Viewers".
  * The value of the entry is the contractid of the component.
  * The component is a service, so use GetService, not CreateInstance to get it.
  */
 
 [scriptable, uuid(e795239e-9d3c-47c4-b063-9e600fb3b287)]
 interface nsIDocumentLoaderFactory : nsISupports {
-    // StyleBackendType is used to choose the style backend type for the created
-    // document. Use STYLE_BACKEND_TYPE_NONE as the default.
-    const short STYLE_BACKEND_TYPE_NONE  = 0;
-    const short STYLE_BACKEND_TYPE_GECKO = 1;
-    const short STYLE_BACKEND_TYPE_SERVO = 2;
-
     nsIContentViewer createInstance(in string aCommand,
                               in nsIChannel aChannel,
                               in nsILoadGroup aLoadGroup,
                               in ACString aContentType, 
                               in nsIDocShell aContainer,
                               in nsISupports aExtraInfo,
-                              in short aStyleBackendType,
                               out nsIStreamListener aDocListenerResult);
 
     nsIContentViewer createInstanceForDocument(in nsISupports aContainer,
                                          in nsIDocument aDocument,
                                          in string aCommand);
 
     /**
      * Create a blank document using the given loadgroup and given
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1014,17 +1014,16 @@ nsExternalResourceMap::PendingLoad::Setu
   nsCOMPtr<nsIDocumentLoaderFactory> docLoaderFactory =
     do_GetService(contractId);
   NS_ENSURE_TRUE(docLoaderFactory, NS_ERROR_NOT_AVAILABLE);
 
   nsCOMPtr<nsIContentViewer> viewer;
   nsCOMPtr<nsIStreamListener> listener;
   rv = docLoaderFactory->CreateInstance("external-resource", chan, newLoadGroup,
                                         type, nullptr, nullptr,
-                                        nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
                                         getter_AddRefs(listener),
                                         getter_AddRefs(viewer));
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(viewer, NS_ERROR_UNEXPECTED);
 
   nsCOMPtr<nsIParser> parser = do_QueryInterface(listener);
   if (!parser) {
     /// We don't want to deal with the various fake documents yet
--- a/image/SVGDocumentWrapper.cpp
+++ b/image/SVGDocumentWrapper.cpp
@@ -340,17 +340,16 @@ SVGDocumentWrapper::SetupViewer(nsIReque
   NS_ENSURE_TRUE(docLoaderFactory, NS_ERROR_NOT_AVAILABLE);
 
   nsCOMPtr<nsIContentViewer> viewer;
   nsCOMPtr<nsIStreamListener> listener;
   rv = docLoaderFactory->CreateInstance("external-resource", chan,
                                         newLoadGroup,
                                         NS_LITERAL_CSTRING(IMAGE_SVG_XML),
                                         nullptr, nullptr,
-                                        nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
                                         getter_AddRefs(listener),
                                         getter_AddRefs(viewer));
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ENSURE_TRUE(viewer, NS_ERROR_UNEXPECTED);
 
   // Create a navigation time object and pass it to the SVG document through
   // the viewer.
--- a/layout/build/nsContentDLF.cpp
+++ b/layout/build/nsContentDLF.cpp
@@ -17,27 +17,25 @@
 #include "nsICategoryManager.h"
 #include "nsIDocumentLoaderFactory.h"
 #include "nsIDocument.h"
 #include "nsIURL.h"
 #include "nsNodeInfoManager.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsString.h"
 #include "nsContentCID.h"
-#include "nsLayoutUtils.h"
 #include "nsNetUtil.h"
 #include "nsCRT.h"
 #include "nsIViewSourceChannel.h"
 #include "nsContentUtils.h"
 #include "imgLoader.h"
 #include "nsCharsetSource.h"
 #include "nsMimeTypes.h"
 #include "DecoderTraits.h"
 
-using mozilla::StyleBackendType;
 
 // plugins
 #include "nsIPluginHost.h"
 #include "nsPluginHost.h"
 static NS_DEFINE_CID(kPluginDocumentCID, NS_PLUGINDOCUMENT_CID);
 
 // Factory code for creating variations on html documents
 
@@ -137,24 +135,19 @@ MayUseXULXBL(nsIChannel* aChannel)
 
 NS_IMETHODIMP
 nsContentDLF::CreateInstance(const char* aCommand,
                              nsIChannel* aChannel,
                              nsILoadGroup* aLoadGroup,
                              const nsACString& aContentType,
                              nsIDocShell* aContainer,
                              nsISupports* aExtraInfo,
-                             int16_t aStyleBackendType,
                              nsIStreamListener** aDocListener,
                              nsIContentViewer** aDocViewer)
 {
-  MOZ_ASSERT(aStyleBackendType == nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE ||
-             aStyleBackendType == nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_GECKO ||
-             aStyleBackendType == nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_SERVO);
-
   // Make a copy of aContentType, because we're possibly going to change it.
   nsAutoCString contentType(aContentType);
 
   // Are we viewing source?
   nsCOMPtr<nsIViewSourceChannel> viewSourceChannel = do_QueryInterface(aChannel);
   if (viewSourceChannel)
   {
     aCommand = "view-source";
@@ -188,36 +181,33 @@ nsContentDLF::CreateInstance(const char*
   }
 
   // Try html or plaintext; both use the same document CID
   if (IsTypeInList(contentType, gHTMLTypes) ||
       nsContentUtils::IsPlainTextType(contentType)) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kHTMLDocumentCID,
-                          aDocListener, aDocViewer,
-                          (StyleBackendType)aStyleBackendType);
+                          aDocListener, aDocViewer);
   }
 
   // Try XML
   if (IsTypeInList(contentType, gXMLTypes)) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kXMLDocumentCID,
-                          aDocListener, aDocViewer,
-                          (StyleBackendType)aStyleBackendType);
+                          aDocListener, aDocViewer);
   }
 
   // Try SVG
   if (IsTypeInList(contentType, gSVGTypes)) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kSVGDocumentCID,
-                          aDocListener, aDocViewer,
-                          (StyleBackendType)aStyleBackendType);
+                          aDocListener, aDocViewer);
   }
 
   // Try XUL
   if (IsTypeInList(contentType, gXULTypes)) {
     if (!MayUseXULXBL(aChannel)) {
       return NS_ERROR_REMOTE_XUL;
     }
 
@@ -225,39 +215,36 @@ nsContentDLF::CreateInstance(const char*
                              aExtraInfo, aDocListener, aDocViewer);
   }
 
   if (mozilla::DecoderTraits::ShouldHandleMediaType(contentType.get(),
                     /* DecoderDoctorDiagnostics* */ nullptr)) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kVideoDocumentCID,
-                          aDocListener, aDocViewer,
-                          (StyleBackendType)aStyleBackendType);
+                          aDocListener, aDocViewer);
   }
 
   // Try image types
   if (IsImageContentType(contentType.get())) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kImageDocumentCID,
-                          aDocListener, aDocViewer,
-                          (StyleBackendType)aStyleBackendType);
+                          aDocListener, aDocViewer);
   }
 
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
   // Don't exclude disabled plugins, which will still trigger the "this plugin
   // is disabled" placeholder.
   if (pluginHost && pluginHost->HavePluginForType(contentType,
                                                   nsPluginHost::eExcludeNone)) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kPluginDocumentCID,
-                          aDocListener, aDocViewer,
-                          (StyleBackendType)aStyleBackendType);
+                          aDocListener, aDocViewer);
   }
 
   // If we get here, then we weren't able to create anything. Sorry!
   return NS_ERROR_FAILURE;
 }
 
 
 NS_IMETHODIMP
@@ -353,18 +340,17 @@ nsContentDLF::CreateBlankDocument(nsILoa
 
 nsresult
 nsContentDLF::CreateDocument(const char* aCommand,
                              nsIChannel* aChannel,
                              nsILoadGroup* aLoadGroup,
                              nsIDocShell* aContainer,
                              const nsCID& aDocumentCID,
                              nsIStreamListener** aDocListener,
-                             nsIContentViewer** aContentViewer,
-                             StyleBackendType aStyleBackendType /* = StyleBackendType::None */)
+                             nsIContentViewer** aContentViewer)
 {
   nsresult rv = NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIURI> aURL;
   rv = aChannel->GetURI(getter_AddRefs(aURL));
   if (NS_FAILED(rv)) return rv;
 
 #ifdef NOISY_CREATE_DOC
@@ -375,27 +361,16 @@ nsContentDLF::CreateDocument(const char*
     printf(": creating document\n");
   }
 #endif
 
   // Create the document
   nsCOMPtr<nsIDocument> doc = do_CreateInstance(aDocumentCID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // Set style backend type before document loading. Can't set None as the
-  // backend type, it would hit an assertion.
-  if (aStyleBackendType != StyleBackendType::None) {
-    // To dynamically switch the backend type, check stylo is enabled or not
-    // before setting the backend type. If stylo is not enabled, we always set
-    // backend type to gecko.
-    doc->SetStyleBackendType(
-        nsLayoutUtils::StyloEnabled() ? aStyleBackendType
-                                      : StyleBackendType::Gecko);
-  }
-
   // Create the content viewer  XXX: could reuse content viewer here!
   nsCOMPtr<nsIContentViewer> contentViewer = NS_NewContentViewer();
 
   doc->SetContainer(static_cast<nsDocShell*>(aContainer));
 
   // Initialize the document to begin loading the data.  An
   // nsIStreamListener connected to the parser is returned in
   // aDocListener.
--- a/layout/build/nsContentDLF.h
+++ b/layout/build/nsContentDLF.h
@@ -3,17 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsContentDLF_h__
 #define nsContentDLF_h__
 
 #include "nsIDocumentLoaderFactory.h"
 #include "nsMimeTypes.h"
-#include "mozilla/StyleBackendType.h"
 
 class nsIChannel;
 class nsIContentViewer;
 class nsILoadGroup;
 class nsIStreamListener;
 
 #define CONTENT_DLF_CONTRACTID "@mozilla.org/content/document-loader-factory;1"
 #define PLUGIN_DLF_CONTRACTID "@mozilla.org/content/plugin/document-loader-factory;1"
@@ -32,18 +31,17 @@ public:
   nsresult InitUAStyleSheet();
 
   nsresult CreateDocument(const char* aCommand,
                           nsIChannel* aChannel,
                           nsILoadGroup* aLoadGroup,
                           nsIDocShell* aContainer,
                           const nsCID& aDocumentCID,
                           nsIStreamListener** aDocListener,
-                          nsIContentViewer** aContentViewer,
-                          mozilla::StyleBackendType aStyleBackendType = mozilla::StyleBackendType::None);
+                          nsIContentViewer** aContentViewer);
 
   nsresult CreateXULDocument(const char* aCommand,
                              nsIChannel* aChannel,
                              nsILoadGroup* aLoadGroup,
                              nsIDocShell* aContainer,
                              nsISupports* aExtraInfo,
                              nsIStreamListener** aDocListener,
                              nsIContentViewer** aContentViewer);
@@ -87,8 +85,9 @@ NS_NewContentDocumentLoaderFactory(nsIDo
     { "Gecko-Content-Viewers", IMAGE_SVG_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", TEXT_VTT, "@mozilla.org/content/document-loader-factory;1" }, \
     { "Gecko-Content-Viewers", APPLICATION_WAPXHTML_XML, "@mozilla.org/content/document-loader-factory;1" }, \
     CONTENTDLF_WEBM_CATEGORIES
 
 
 #endif
+
--- a/xpfe/components/directory/nsDirectoryViewer.cpp
+++ b/xpfe/components/directory/nsDirectoryViewer.cpp
@@ -1256,24 +1256,19 @@ NS_IMPL_ISUPPORTS(nsDirectoryViewerFacto
 
 NS_IMETHODIMP
 nsDirectoryViewerFactory::CreateInstance(const char *aCommand,
                                          nsIChannel* aChannel,
                                          nsILoadGroup* aLoadGroup,
                                          const nsACString& aContentType,
                                          nsIDocShell* aContainer,
                                          nsISupports* aExtraInfo,
-                                         int16_t aStyleBackendType,
                                          nsIStreamListener** aDocListenerResult,
                                          nsIContentViewer** aDocViewerResult)
 {
-  MOZ_ASSERT(aStyleBackendType == nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE ||
-             aStyleBackendType == nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_GECKO ||
-             aStyleBackendType == nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_SERVO);
-
   nsresult rv;
 
   bool viewSource = FindInReadable(NS_LITERAL_CSTRING("view-source"),
                                    aContentType);
 
   if (!viewSource &&
       Preferences::GetInt("network.dir.format", FORMAT_XUL) == FORMAT_XUL) {
     // ... and setup the original channel's content type
@@ -1307,19 +1302,17 @@ nsDirectoryViewerFactory::CreateInstance
                        nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                        nsIContentPolicy::TYPE_OTHER,
                        aLoadGroup);
     if (NS_FAILED(rv)) return rv;
 
     nsCOMPtr<nsIStreamListener> listener;
     rv = factory->CreateInstance(aCommand, channel, aLoadGroup,
                                  NS_LITERAL_CSTRING("application/vnd.mozilla.xul+xml"),
-                                 aContainer, aExtraInfo,
-                                 nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
-                                 getter_AddRefs(listener),
+                                 aContainer, aExtraInfo, getter_AddRefs(listener),
                                  aDocViewerResult);
     if (NS_FAILED(rv)) return rv;
 
     rv = channel->AsyncOpen2(listener);
     if (NS_FAILED(rv)) return rv;
 
     // Create an HTTPIndex object so that we can stuff it into the script context
     nsCOMPtr<nsIURI> baseuri;
@@ -1358,26 +1351,22 @@ nsDirectoryViewerFactory::CreateInstance
   nsCOMPtr<nsIDocumentLoaderFactory> factory(do_GetService(contractID, &rv));
   if (NS_FAILED(rv)) return rv;
 
   nsCOMPtr<nsIStreamListener> listener;
 
   if (viewSource) {
     rv = factory->CreateInstance("view-source", aChannel, aLoadGroup,
                                  NS_LITERAL_CSTRING("text/html; x-view-type=view-source"),
-                                 aContainer, aExtraInfo,
-                                 nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
-                                 getter_AddRefs(listener),
+                                 aContainer, aExtraInfo, getter_AddRefs(listener),
                                  aDocViewerResult);
   } else {
     rv = factory->CreateInstance("view", aChannel, aLoadGroup,
                                  NS_LITERAL_CSTRING("text/html"),
-                                 aContainer, aExtraInfo,
-                                 nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
-                                 getter_AddRefs(listener),
+                                 aContainer, aExtraInfo, getter_AddRefs(listener),
                                  aDocViewerResult);
   }
 
   if (NS_FAILED(rv)) return rv;
 
   nsCOMPtr<nsIStreamConverterService> scs = do_GetService("@mozilla.org/streamConverters;1", &rv);
   if (NS_FAILED(rv)) return rv;