From 681259ee9f73d21cc54c312dfceb76c184608020 Mon Sep 17 00:00:00 2001 From: Jonas Sicking Date: Thu, 19 Aug 2010 18:41:58 -0700 Subject: [PATCH] Back out bug 546857 Part 6 due to talos failures. a=backout --- .../base/public/nsContentCreatorFunctions.h | 3 -- content/base/public/nsContentUtils.h | 5 --- content/base/public/nsIDocument.h | 27 +------------ content/base/src/nsContentUtils.cpp | 15 ------- content/base/src/nsDOMParser.cpp | 4 -- content/base/src/nsDocument.cpp | 24 ------------ content/base/src/nsDocument.h | 1 - content/base/test/chrome/title_window.xul | 4 +- content/xbl/src/nsXBLService.cpp | 39 ++++++------------- content/xul/content/src/nsXULElement.cpp | 23 ++++------- content/xul/content/src/nsXULElement.h | 2 - content/xul/document/src/nsXULDocument.cpp | 2 - layout/build/nsContentDLF.cpp | 30 +------------- layout/generic/nsGfxScrollFrame.cpp | 18 +++++++-- layout/generic/nsVideoFrame.cpp | 6 ++- 15 files changed, 44 insertions(+), 159 deletions(-) diff --git a/content/base/public/nsContentCreatorFunctions.h b/content/base/public/nsContentCreatorFunctions.h index 8b02d0be756a..71039e3ded48 100644 --- a/content/base/public/nsContentCreatorFunctions.h +++ b/content/base/public/nsContentCreatorFunctions.h @@ -126,9 +126,6 @@ NS_NewMathMLElement(nsIContent** aResult, #ifdef MOZ_XUL nsresult NS_NewXULElement(nsIContent** aResult, already_AddRefed aNodeInfo); - -void -NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed aNodeInfo); #endif #ifdef MOZ_SVG diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index a45ae16027dc..d0a0768e9d83 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -610,11 +610,6 @@ public: return sPrefBranch; } - // Get a permission-manager setting for the given uri and type. - // If the pref doesn't exist or if it isn't ALLOW_ACTION, PR_FALSE is - // returned, otherwise PR_TRUE is returned. - static PRBool IsSitePermAllow(nsIURI* aURI, const char* aType); - static nsILineBreaker* LineBreaker() { return sLineBreaker; diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 3d32a4cb57b9..a291ea4ed679 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -119,8 +119,8 @@ class Element; #define NS_IDOCUMENT_IID \ -{ 0xbd862a79, 0xc31b, 0x419b, \ - { 0x92, 0x90, 0xa0, 0x77, 0x08, 0x62, 0xd4, 0xc4 } } +{ 0x0218352e, 0x9ddf, 0x43b0, \ + { 0xb6, 0x1d, 0xd3, 0x1a, 0x47, 0x7a, 0xfd, 0x89 } } // Flag for AddStyleSheet(). #define NS_STYLESHEET_FROM_CATALOG (1 << 0) @@ -1291,20 +1291,6 @@ public: PRBool IsDNSPrefetchAllowed() const { return mAllowDNSPrefetch; } - /** - * Returns PR_TRUE if this document is allowed to contain XUL element and - * use non-builtin XBL bindings. - */ - PRBool AllowXULXBL() { - return mAllowXULXBL == eTriTrue ? PR_TRUE : - mAllowXULXBL == eTriFalse ? PR_FALSE : - InternalAllowXULXBL(); - } - - void ForceEnableXULXBL() { - mAllowXULXBL = eTriTrue; - } - /** * PR_TRUE when this document is a static clone of a normal document. * For example print preview and printing use static documents. @@ -1484,9 +1470,6 @@ protected: // Never ever call this. Only call GetScriptHandlingObject! virtual nsIScriptGlobalObject* GetScriptHandlingObjectInternal() const = 0; - // Never ever call this. Only call AllowXULXBL! - virtual PRBool InternalAllowXULXBL() = 0; - /** * These methods should be called before and after dispatching * a mutation event. @@ -1570,12 +1553,6 @@ protected: PRPackedBool mIsRegularHTML; PRPackedBool mIsXUL; - enum { - eTriUnset = 0, - eTriFalse, - eTriTrue - } mAllowXULXBL; - // True if we're loaded as data and therefor has any dangerous stuff, such // as scripts and plugins, disabled. PRPackedBool mLoadedAsData; diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index dcaad8b7e11f..a4be2b3bc106 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -153,7 +153,6 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID); #include "nsIPrivateDOMEvent.h" #include "nsXULPopupManager.h" #include "nsIPermissionManager.h" -#include "nsIContentPrefService.h" #include "nsIScriptObjectPrincipal.h" #include "nsIRunnable.h" #include "nsDOMJSUtils.h" @@ -2807,20 +2806,6 @@ nsContentUtils::AddIntPrefVarCache(const char *aPref, RegisterPrefCallback(aPref, IntVarChanged, data); } -PRBool -nsContentUtils::IsSitePermAllow(nsIURI* aURI, const char* aType) -{ - nsCOMPtr permMgr = - do_GetService("@mozilla.org/permissionmanager;1"); - NS_ENSURE_TRUE(permMgr, PR_FALSE); - - PRUint32 perm; - nsresult rv = permMgr->TestPermission(aURI, aType, &perm); - NS_ENSURE_SUCCESS(rv, PR_FALSE); - - return perm == nsIPermissionManager::ALLOW_ACTION; -} - static const char *gEventNames[] = {"event"}; static const char *gSVGEventNames[] = {"evt"}; // for b/w compat, the first name to onerror is still 'event', even though it diff --git a/content/base/src/nsDOMParser.cpp b/content/base/src/nsDOMParser.cpp index 98b1fac1f4f1..ec639198a821 100644 --- a/content/base/src/nsDOMParser.cpp +++ b/content/base/src/nsDOMParser.cpp @@ -272,10 +272,6 @@ nsDOMParser::ParseFromStream(nsIInputStream *stream, nsCOMPtr document(do_QueryInterface(domDocument)); if (!document) return NS_ERROR_FAILURE; - if (nsContentUtils::IsSystemPrincipal(mOriginalPrincipal)) { - document->ForceEnableXULXBL(); - } - rv = document->StartDocumentLoad(kLoadAsData, parserChannel, nsnull, nsnull, getter_AddRefs(listener), diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 4476998932f6..25d32d97b272 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -3801,30 +3801,6 @@ nsDocument::ScriptLoader() return mScriptLoader; } -PRBool -nsDocument::InternalAllowXULXBL() -{ - if (nsContentUtils::IsSystemPrincipal(NodePrincipal())) { - mAllowXULXBL = eTriTrue; - return PR_TRUE; - } - - nsCOMPtr princURI; - NodePrincipal()->GetURI(getter_AddRefs(princURI)); - if (!princURI) { - mAllowXULXBL = eTriFalse; - return PR_FALSE; - } - - if (nsContentUtils::IsSitePermAllow(princURI, "allowXULXBL")) { - mAllowXULXBL = eTriTrue; - return PR_TRUE; - } - - mAllowXULXBL = eTriFalse; - return PR_FALSE; -} - // Note: We don't hold a reference to the document observer; we assume // that it has a live reference to the document. void diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index eca869c6c1de..4d073f52e1b5 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -1049,7 +1049,6 @@ protected: virtual nsPIDOMWindow *GetWindowInternal(); virtual nsPIDOMWindow *GetInnerWindowInternal(); virtual nsIScriptGlobalObject* GetScriptHandlingObjectInternal() const; - virtual PRBool InternalAllowXULXBL(); #define NS_DOCUMENT_NOTIFY_OBSERVERS(func_, params_) \ NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(mObservers, nsIDocumentObserver, \ diff --git a/content/base/test/chrome/title_window.xul b/content/base/test/chrome/title_window.xul index 9134d65c184e..69be094a9022 100644 --- a/content/base/test/chrome/title_window.xul +++ b/content/base/test/chrome/title_window.xul @@ -13,8 +13,8 @@