From 1c55d9468ac1ca2e4b3a062da984832efcf4295f Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Tue, 25 Jul 2017 14:34:14 +0200 Subject: [PATCH] Backed out changeset 7c3ddf34fc42 (bug 1377158) for stylo failures --- docshell/base/nsDocShell.cpp | 16 ++++---- docshell/base/nsIDocumentLoaderFactory.idl | 7 ---- dom/base/nsDocument.cpp | 1 - image/SVGDocumentWrapper.cpp | 1 - layout/build/nsContentDLF.cpp | 39 ++++--------------- layout/build/nsContentDLF.h | 5 +-- .../directory/nsDirectoryViewer.cpp | 17 ++------ 7 files changed, 19 insertions(+), 67 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 2daead70b573..1ff9b071a2f6 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -9367,15 +9367,13 @@ nsDocShell::NewContentViewerObj(const nsACString& aContentType, // 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); diff --git a/docshell/base/nsIDocumentLoaderFactory.idl b/docshell/base/nsIDocumentLoaderFactory.idl index 54a033c4f9a0..7e0df1fd7d9a 100644 --- a/docshell/base/nsIDocumentLoaderFactory.idl +++ b/docshell/base/nsIDocumentLoaderFactory.idl @@ -24,19 +24,12 @@ interface nsIPrincipal; [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, diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 16054a30eaac..9e2ac814e168 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1019,7 +1019,6 @@ nsExternalResourceMap::PendingLoad::SetupViewer(nsIRequest* aRequest, nsCOMPtr 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); diff --git a/image/SVGDocumentWrapper.cpp b/image/SVGDocumentWrapper.cpp index e82eace7286b..c5f9a42fd381 100644 --- a/image/SVGDocumentWrapper.cpp +++ b/image/SVGDocumentWrapper.cpp @@ -345,7 +345,6 @@ SVGDocumentWrapper::SetupViewer(nsIRequest* aRequest, 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); diff --git a/layout/build/nsContentDLF.cpp b/layout/build/nsContentDLF.cpp index e422d0142d31..960f4335d977 100644 --- a/layout/build/nsContentDLF.cpp +++ b/layout/build/nsContentDLF.cpp @@ -22,7 +22,6 @@ #include "nsIScriptSecurityManager.h" #include "nsString.h" #include "nsContentCID.h" -#include "nsLayoutUtils.h" #include "nsNetUtil.h" #include "nsCRT.h" #include "nsIViewSourceChannel.h" @@ -32,7 +31,6 @@ #include "nsMimeTypes.h" #include "DecoderTraits.h" -using mozilla::StyleBackendType; // plugins #include "nsIPluginHost.h" @@ -142,14 +140,9 @@ nsContentDLF::CreateInstance(const char* aCommand, 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); @@ -193,8 +186,7 @@ nsContentDLF::CreateInstance(const char* aCommand, return CreateDocument(aCommand, aChannel, aLoadGroup, aContainer, kHTMLDocumentCID, - aDocListener, aDocViewer, - (StyleBackendType)aStyleBackendType); + aDocListener, aDocViewer); } // Try XML @@ -202,8 +194,7 @@ nsContentDLF::CreateInstance(const char* aCommand, return CreateDocument(aCommand, aChannel, aLoadGroup, aContainer, kXMLDocumentCID, - aDocListener, aDocViewer, - (StyleBackendType)aStyleBackendType); + aDocListener, aDocViewer); } // Try SVG @@ -211,8 +202,7 @@ nsContentDLF::CreateInstance(const char* aCommand, return CreateDocument(aCommand, aChannel, aLoadGroup, aContainer, kSVGDocumentCID, - aDocListener, aDocViewer, - (StyleBackendType)aStyleBackendType); + aDocListener, aDocViewer); } // Try XUL @@ -230,8 +220,7 @@ nsContentDLF::CreateInstance(const char* aCommand, return CreateDocument(aCommand, aChannel, aLoadGroup, aContainer, kVideoDocumentCID, - aDocListener, aDocViewer, - (StyleBackendType)aStyleBackendType); + aDocListener, aDocViewer); } // Try image types @@ -239,8 +228,7 @@ nsContentDLF::CreateInstance(const char* aCommand, return CreateDocument(aCommand, aChannel, aLoadGroup, aContainer, kImageDocumentCID, - aDocListener, aDocViewer, - (StyleBackendType)aStyleBackendType); + aDocListener, aDocViewer); } RefPtr pluginHost = nsPluginHost::GetInst(); @@ -251,8 +239,7 @@ nsContentDLF::CreateInstance(const char* aCommand, 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! @@ -358,8 +345,7 @@ nsContentDLF::CreateDocument(const char* aCommand, nsIDocShell* aContainer, const nsCID& aDocumentCID, nsIStreamListener** aDocListener, - nsIContentViewer** aContentViewer, - StyleBackendType aStyleBackendType /* = StyleBackendType::None */) + nsIContentViewer** aContentViewer) { nsresult rv = NS_ERROR_FAILURE; @@ -380,17 +366,6 @@ nsContentDLF::CreateDocument(const char* aCommand, nsCOMPtr 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 contentViewer = NS_NewContentViewer(); diff --git a/layout/build/nsContentDLF.h b/layout/build/nsContentDLF.h index 3b6f659728cc..28673a694cf9 100644 --- a/layout/build/nsContentDLF.h +++ b/layout/build/nsContentDLF.h @@ -8,7 +8,6 @@ #include "nsIDocumentLoaderFactory.h" #include "nsMimeTypes.h" -#include "mozilla/StyleBackendType.h" class nsIChannel; class nsIContentViewer; @@ -37,8 +36,7 @@ public: nsIDocShell* aContainer, const nsCID& aDocumentCID, nsIStreamListener** aDocListener, - nsIContentViewer** aContentViewer, - mozilla::StyleBackendType aStyleBackendType = mozilla::StyleBackendType::None); + nsIContentViewer** aContentViewer); nsresult CreateXULDocument(const char* aCommand, nsIChannel* aChannel, @@ -92,3 +90,4 @@ NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult); #endif + diff --git a/xpfe/components/directory/nsDirectoryViewer.cpp b/xpfe/components/directory/nsDirectoryViewer.cpp index d1e22694b3a8..3349072c2775 100644 --- a/xpfe/components/directory/nsDirectoryViewer.cpp +++ b/xpfe/components/directory/nsDirectoryViewer.cpp @@ -1261,14 +1261,9 @@ nsDirectoryViewerFactory::CreateInstance(const char *aCommand, 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"), @@ -1312,9 +1307,7 @@ nsDirectoryViewerFactory::CreateInstance(const char *aCommand, nsCOMPtr 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; @@ -1363,16 +1356,12 @@ nsDirectoryViewerFactory::CreateInstance(const char *aCommand, 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); }