From af174f1dc87b424a00dcded6212abe2414bcc46d Mon Sep 17 00:00:00 2001 From: "johnath%mozilla.com" Date: Fri, 4 Apr 2008 11:09:20 +0000 Subject: [PATCH] Backing out 295994 as likely cause of reftest failure. --- content/xul/document/src/nsXULDocument.cpp | 41 ++++------------------ content/xul/document/src/nsXULDocument.h | 4 --- 2 files changed, 6 insertions(+), 39 deletions(-) diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 034989a4ce6..cb30756630f 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -1274,33 +1274,14 @@ nsXULDocument::Persist(const nsAString& aID, } -PRBool -nsXULDocument::IsCapabilityEnabled(const char* aCapabilityLabel) -{ - nsresult rv; - - // NodePrincipal is guarantied to be non-null - PRBool enabled = PR_FALSE; - rv = NodePrincipal()->IsCapabilityEnabled(aCapabilityLabel, nsnull, &enabled); - if (NS_FAILED(rv)) - return PR_FALSE; - - return enabled; -} - - nsresult nsXULDocument::Persist(nsIContent* aElement, PRInt32 aNameSpaceID, nsIAtom* aAttribute) { - // For non-chrome documents, persistance is simply broken - if (!IsCapabilityEnabled("UniversalBrowserWrite")) - return NS_ERROR_NOT_AVAILABLE; - // First make sure we _have_ a local store to stuff the persisted // information into. (We might not have one if profile information // hasn't been loaded yet...) - if (!mLocalStore) + if (! mLocalStore) return NS_OK; nsresult rv; @@ -2085,26 +2066,13 @@ nsXULDocument::PrepareToLoadPrototype(nsIURI* aURI, const char* aCommand, nsresult nsXULDocument::ApplyPersistentAttributes() { - // For non-chrome documents, persistance is simply broken - if (!IsCapabilityEnabled("UniversalBrowserRead")) - return NS_ERROR_NOT_AVAILABLE; - // Add all of the 'persisted' attributes into the content // model. - if (!mLocalStore) + if (! mLocalStore) return NS_OK; mApplyingPersistedAttrs = PR_TRUE; - ApplyPersistentAttributesInternal(); - mApplyingPersistedAttrs = PR_FALSE; - return NS_OK; -} - - -nsresult -nsXULDocument::ApplyPersistentAttributesInternal() -{ nsCOMArray elements; nsCAutoString docurl; @@ -2151,6 +2119,8 @@ nsXULDocument::ApplyPersistentAttributesInternal() ApplyPersistentAttributesToElements(resource, elements); } + mApplyingPersistedAttrs = PR_FALSE; + return NS_OK; } @@ -3057,7 +3027,8 @@ nsXULDocument::ResumeWalk() rv = ResolveForwardReferences(); if (NS_FAILED(rv)) return rv; - ApplyPersistentAttributes(); + rv = ApplyPersistentAttributes(); + if (NS_FAILED(rv)) return rv; mStillWalking = PR_FALSE; if (mPendingSheets == 0) { diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h index f002884b895..e972e3227e6 100644 --- a/content/xul/document/src/nsXULDocument.h +++ b/content/xul/document/src/nsXULDocument.h @@ -201,7 +201,6 @@ protected: PRBool* aFailureFromContent); nsresult ApplyPersistentAttributes(); - nsresult ApplyPersistentAttributesInternal(); nsresult ApplyPersistentAttributesToElements(nsIRDFResource* aResource, nsCOMArray& aElements); @@ -238,9 +237,6 @@ protected: static PRLogModuleInfo* gXULLog; - PRBool - IsCapabilityEnabled(const char* aCapabilityLabel); - nsresult Persist(nsIContent* aElement, PRInt32 aNameSpaceID, nsIAtom* aAttribute);