Bug 1454140: Invalid URLs with ref also exist. r=heycam

MozReview-Commit-ID: HsH3ERcTeLm

--HG--
extra : rebase_source : 0cac89785ba837bbbe1a56e5d7b217e98f0996bb
This commit is contained in:
Emilio Cobos Álvarez 2018-04-14 17:24:45 +02:00
parent 39e46efded
commit cbdd3db954
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,4 @@
<!-- A -->
<table background="
#"><base href=Y:
<!-- A -->

View File

@ -272,3 +272,4 @@ load 1409183.html
pref(dom.webcomponents.shadowdom.enabled,true) load 1445682.html
load 1450691.html
pref(dom.webcomponents.shadowdom.enabled,true) load 1453206.html
load 1454140.html

View File

@ -2175,8 +2175,12 @@ nsStyleImageRequest::Resolve(
if (GetImageValue()->HasRef()) {
bool isEqualExceptRef = false;
RefPtr<nsIURI> imageURI = GetImageURI();
imageURI->EqualsExceptRef(docURI, &isEqualExceptRef);
if (isEqualExceptRef) {
if (!imageURI) {
return false;
}
if (NS_SUCCEEDED(imageURI->EqualsExceptRef(docURI, &isEqualExceptRef)) &&
isEqualExceptRef) {
// Prevent loading an internal resource.
return true;
}