Bug 1910951 - Avoid incorrect use of nsParser when meta refresh is added to about:blank. r=sefeng, a=dsmith

Differential Revision: https://phabricator.services.mozilla.com/D218926
This commit is contained in:
Henri Sivonen 2024-08-13 15:15:03 +00:00
parent 2ef5159453
commit 42d7e3bb7e
4 changed files with 16 additions and 1 deletions

View file

@ -338,7 +338,7 @@ nsresult nsHTMLDocument::StartDocumentLoad(
if (loadAsHtml5 && view) {
// mDocumentURI hasn't been set, yet, so get the URI from the channel
nsCOMPtr<nsIURI> uri;
aChannel->GetOriginalURI(getter_AddRefs(uri));
aChannel->GetURI(getter_AddRefs(uri));
if (NS_IsAboutBlankAllowQueryAndFragment(uri)) {
loadAsHtml5 = false;
}

View file

@ -0,0 +1,13 @@
<html class="reftest-wait">
<iframe></iframe>
<script>
onmessage = function() {
document.documentElement.className = "";
}
const iframe = document.querySelector("iframe");
const meta = iframe.contentDocument.createElement('meta');
meta.httpEquiv = 'Refresh';
meta.content = '0; url=file_1910951-1.html';
iframe.contentDocument.head.append(meta);
</script>
</html>

View file

@ -66,3 +66,4 @@ load 1547895-1.html
skip-if(Android||isDebugBuild||AddressSanitizer||ThreadSanitizer) load 1747514.html # Too slow for some configurations, see bug 1780219 for android for example.
HTTP load 1810896-1.html
load 1854907-1.html
load 1910951-1.html

View file

@ -0,0 +1 @@
<script>parent.postMessage("done", "*");</script>