mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 1543245 - Use prototype document for all chrome XHTML pages. r=smaug
Let all chrome privileged XHTML take advantage of the cache and faster document creation with the prototype document. Differential Revision: https://phabricator.services.mozilla.com/D26822
This commit is contained in:
parent
eff829f752
commit
67a7d1d576
@ -444,7 +444,7 @@ void nsHTMLDocument::TryFallback(int32_t& aCharsetSource,
|
||||
aEncoding = FallbackEncoding::FromLocale();
|
||||
}
|
||||
|
||||
// Using a prototype document is currently only allowed with browser.xhtml.
|
||||
// Using a prototype document is only allowed with chrome privilege.
|
||||
bool ShouldUsePrototypeDocument(nsIChannel* aChannel, nsIDocShell* aDocShell) {
|
||||
if (!aChannel || !aDocShell ||
|
||||
!StaticPrefs::dom_prototype_document_cache_enabled()) {
|
||||
@ -455,9 +455,7 @@ bool ShouldUsePrototypeDocument(nsIChannel* aChannel, nsIDocShell* aDocShell) {
|
||||
}
|
||||
nsCOMPtr<nsIURI> originalURI;
|
||||
aChannel->GetOriginalURI(getter_AddRefs(originalURI));
|
||||
return IsChromeURI(originalURI) &&
|
||||
originalURI->GetSpecOrDefault().EqualsLiteral(
|
||||
BROWSER_CHROME_URL_QUOTED);
|
||||
return IsChromeURI(originalURI);
|
||||
}
|
||||
|
||||
nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
||||
@ -561,7 +559,7 @@ nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
||||
} else {
|
||||
mParser->MarkAsNotScriptCreated(aCommand);
|
||||
}
|
||||
} else if (ShouldUsePrototypeDocument(aChannel, docShell)) {
|
||||
} else if (xhtml && ShouldUsePrototypeDocument(aChannel, docShell)) {
|
||||
loadWithPrototype = true;
|
||||
nsCOMPtr<nsIURI> originalURI;
|
||||
aChannel->GetOriginalURI(getter_AddRefs(originalURI));
|
||||
|
Loading…
Reference in New Issue
Block a user