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
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<nsIContent> 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) {

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

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