Backing out 295994 as likely cause of reftest failure.

This commit is contained in:
johnath@mozilla.com 2008-04-04 04:09:20 -07:00
Родитель 7eb491f335
Коммит 11f6f5a37c
2 изменённых файлов: 6 добавлений и 39 удалений

Просмотреть файл

@ -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 nsresult
nsXULDocument::Persist(nsIContent* aElement, PRInt32 aNameSpaceID, nsXULDocument::Persist(nsIContent* aElement, PRInt32 aNameSpaceID,
nsIAtom* aAttribute) 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 // First make sure we _have_ a local store to stuff the persisted
// information into. (We might not have one if profile information // information into. (We might not have one if profile information
// hasn't been loaded yet...) // hasn't been loaded yet...)
if (!mLocalStore) if (! mLocalStore)
return NS_OK; return NS_OK;
nsresult rv; nsresult rv;
@ -2085,26 +2066,13 @@ nsXULDocument::PrepareToLoadPrototype(nsIURI* aURI, const char* aCommand,
nsresult nsresult
nsXULDocument::ApplyPersistentAttributes() 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 // Add all of the 'persisted' attributes into the content
// model. // model.
if (!mLocalStore) if (! mLocalStore)
return NS_OK; return NS_OK;
mApplyingPersistedAttrs = PR_TRUE; mApplyingPersistedAttrs = PR_TRUE;
ApplyPersistentAttributesInternal();
mApplyingPersistedAttrs = PR_FALSE;
return NS_OK;
}
nsresult
nsXULDocument::ApplyPersistentAttributesInternal()
{
nsCOMArray<nsIContent> elements; nsCOMArray<nsIContent> elements;
nsCAutoString docurl; nsCAutoString docurl;
@ -2151,6 +2119,8 @@ nsXULDocument::ApplyPersistentAttributesInternal()
ApplyPersistentAttributesToElements(resource, elements); ApplyPersistentAttributesToElements(resource, elements);
} }
mApplyingPersistedAttrs = PR_FALSE;
return NS_OK; return NS_OK;
} }
@ -3057,7 +3027,8 @@ nsXULDocument::ResumeWalk()
rv = ResolveForwardReferences(); rv = ResolveForwardReferences();
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
ApplyPersistentAttributes(); rv = ApplyPersistentAttributes();
if (NS_FAILED(rv)) return rv;
mStillWalking = PR_FALSE; mStillWalking = PR_FALSE;
if (mPendingSheets == 0) { if (mPendingSheets == 0) {

Просмотреть файл

@ -201,7 +201,6 @@ protected:
PRBool* aFailureFromContent); PRBool* aFailureFromContent);
nsresult ApplyPersistentAttributes(); nsresult ApplyPersistentAttributes();
nsresult ApplyPersistentAttributesInternal();
nsresult ApplyPersistentAttributesToElements(nsIRDFResource* aResource, nsresult ApplyPersistentAttributesToElements(nsIRDFResource* aResource,
nsCOMArray<nsIContent>& aElements); nsCOMArray<nsIContent>& aElements);
@ -238,9 +237,6 @@ protected:
static PRLogModuleInfo* gXULLog; static PRLogModuleInfo* gXULLog;
PRBool
IsCapabilityEnabled(const char* aCapabilityLabel);
nsresult nsresult
Persist(nsIContent* aElement, PRInt32 aNameSpaceID, nsIAtom* aAttribute); Persist(nsIContent* aElement, PRInt32 aNameSpaceID, nsIAtom* aAttribute);