Backed out 2 changesets (bug 1543245) for frequently failing devtools at devtools/client/inspector/test/browser_inspector_highlighter-07.js on a CLOSED TREE

Backed out changeset 8e8da015fde1 (bug 1543245)
Backed out changeset a4d256528051 (bug 1543245)
This commit is contained in:
Coroiu Cristina 2019-04-11 05:21:18 +03:00
Родитель d57bd2e86b
Коммит 9943b037bc
2 изменённых файлов: 5 добавлений и 12 удалений

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

@ -443,7 +443,7 @@ void nsHTMLDocument::TryFallback(int32_t& aCharsetSource,
aEncoding = FallbackEncoding::FromLocale();
}
// Using a prototype document is only allowed with chrome privilege.
// Using a prototype document is currently only allowed with browser.xhtml.
bool ShouldUsePrototypeDocument(nsIChannel* aChannel, nsIDocShell* aDocShell) {
if (!aChannel || !aDocShell ||
!StaticPrefs::dom_prototype_document_cache_enabled()) {
@ -454,7 +454,9 @@ bool ShouldUsePrototypeDocument(nsIChannel* aChannel, nsIDocShell* aDocShell) {
}
nsCOMPtr<nsIURI> originalURI;
aChannel->GetOriginalURI(getter_AddRefs(originalURI));
return IsChromeURI(originalURI);
return IsChromeURI(originalURI) &&
originalURI->GetSpecOrDefault().EqualsLiteral(
BROWSER_CHROME_URL_QUOTED);
}
nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
@ -558,7 +560,7 @@ nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
} else {
mParser->MarkAsNotScriptCreated(aCommand);
}
} else if (xhtml && ShouldUsePrototypeDocument(aChannel, docShell)) {
} else if (ShouldUsePrototypeDocument(aChannel, docShell)) {
loadWithPrototype = true;
nsCOMPtr<nsIURI> originalURI;
aChannel->GetOriginalURI(getter_AddRefs(originalURI));

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

@ -1034,15 +1034,6 @@ nsresult PrototypeDocumentContentSink::CreateElementFromPrototype(
rv = AddAttributes(aPrototype, result);
if (NS_FAILED(rv)) return rv;
if (xtfNi->Equals(nsGkAtoms::script, kNameSpaceID_XHTML) ||
xtfNi->Equals(nsGkAtoms::script, kNameSpaceID_SVG)) {
nsCOMPtr<nsIScriptElement> sele = do_QueryInterface(result);
MOZ_ASSERT(sele, "Node didn't QI to script.");
// Script loading is handled by the this content sink, so prevent the
// script from loading when it is bound to the document.
sele->PreventExecution();
}
}
result.forget(aResult);