Bug 651441 - Make sure the HTML5 application cache selection algorithm runs properly when there is no manifest attribute. r=honzab.moz.

This commit is contained in:
Henri Sivonen 2011-05-13 11:31:12 +03:00
Родитель b103254a86
Коммит 692afa4076
2 изменённых файлов: 8 добавлений и 2 удалений

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

@ -254,6 +254,8 @@ public:
// of the above defined methods to select the document's application
// cache, let it be associated with the document and eventually
// schedule the cache update process.
// This method MUST be called with the empty string as the argument
// when there is no manifest attribute!
void ProcessOfflineManifest(const nsAString& aManifestSpec);
// Extracts the manifest attribute from the element if it is the root

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

@ -148,6 +148,8 @@ nsHtml5TreeBuilder::createElement(PRInt32 aNamespace, nsIAtom* aName, nsHtml5Htm
nsString* url = aAttributes->getValue(nsHtml5AttributeName::ATTR_MANIFEST);
if (url) {
mSpeculativeLoadQueue.AppendElement()->InitManifest(*url);
} else {
mSpeculativeLoadQueue.AppendElement()->InitManifest(EmptyString());
}
} else if (nsHtml5Atoms::base == aName) {
nsString* url =
@ -205,10 +207,12 @@ nsHtml5TreeBuilder::createElement(PRInt32 aNamespace, nsIAtom* aName, nsHtml5Htm
}
} else if (aNamespace == kNameSpaceID_XHTML && nsHtml5Atoms::html == aName) {
nsString* url = aAttributes->getValue(nsHtml5AttributeName::ATTR_MANIFEST);
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
if (url) {
nsHtml5TreeOperation* treeOp = mOpQueue.AppendElement();
NS_ASSERTION(treeOp, "Tree op allocation failed.");
treeOp->Init(eTreeOpProcessOfflineManifest, *url);
} else {
treeOp->Init(eTreeOpProcessOfflineManifest, EmptyString());
}
}
}