Bug 1445670. Make sure to clear out the pending request when our image gets blocked by the data document policy. r=jdm

This commit is contained in:
Boris Zbarsky 2018-04-04 14:40:01 -04:00
Родитель fe15e92e6b
Коммит c6d492b79e
3 изменённых файлов: 26 добавлений и 0 удалений

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

@ -0,0 +1,20 @@
<html>
<head>
<script>
function go () {
try { o1 = document.getElementById('x') } catch(e) { }
try { o1.src = '=' } catch(e) { }
try { o2 = document.cloneNode(false) } catch(e) { }
try { o3 = new XMLHttpRequest({mozAnon: true}) } catch(e) { }
try { o3.open('GET', 1, false) } catch(e) { }
try { o3.send() } catch(e) { }
try { o2.prepend('', o1, '', o2) } catch(e) { }
}
document.addEventListener('DOMContentLoaded', go)
</script>
</head>
<body>
<picture>
<img id='x' src='data:image/png;base64,R0lGODlhAQABAAD/ACH/C05FVFNDQVBFMi4wAwEAAAAsAAAAAEAAQAAAgA'/>
</body>
</html>

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

@ -238,3 +238,4 @@ pref(dom.webcomponents.shadowdom.enabled,false) load 1422931.html
pref(dom.webcomponents.shadowdom.enabled,true) load 1419799.html pref(dom.webcomponents.shadowdom.enabled,true) load 1419799.html
skip-if(!browserIsRemote) pref(dom.webcomponents.customelements.enabled,true) pref(dom.disable_open_during_load,false) load 1419902.html # skip on non e10s loads, Bug 1419902 skip-if(!browserIsRemote) pref(dom.webcomponents.customelements.enabled,true) pref(dom.disable_open_during_load,false) load 1419902.html # skip on non e10s loads, Bug 1419902
pref(dom.webcomponents.shadowdom.enabled,true) load 1428053.html pref(dom.webcomponents.shadowdom.enabled,true) load 1428053.html
load 1445670.html

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

@ -927,6 +927,11 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
// Data documents, or documents from DOMParser shouldn't perform image loading. // Data documents, or documents from DOMParser shouldn't perform image loading.
if (aDocument->IsLoadedAsData()) { if (aDocument->IsLoadedAsData()) {
// This is the only codepath on which we can reach SetBlockedRequest while
// our pending request exists. Just clear it out here if we do have one.
ClearPendingRequest(NS_BINDING_ABORTED,
Some(OnNonvisible::DISCARD_IMAGES));
SetBlockedRequest(nsIContentPolicy::REJECT_REQUEST); SetBlockedRequest(nsIContentPolicy::REJECT_REQUEST);
FireEvent(NS_LITERAL_STRING("error")); FireEvent(NS_LITERAL_STRING("error"));