forked from mirrors/gecko-dev
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:
parent
2ef5159453
commit
42d7e3bb7e
4 changed files with 16 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
13
parser/htmlparser/tests/crashtests/1910951-1.html
Normal file
13
parser/htmlparser/tests/crashtests/1910951-1.html
Normal 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>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
1
parser/htmlparser/tests/crashtests/file_1910951-1.html
Normal file
1
parser/htmlparser/tests/crashtests/file_1910951-1.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<script>parent.postMessage("done", "*");</script>
|
||||
Loading…
Reference in a new issue