Bug 1307185 - Ensure image loads don't short-circuit if the element changed trees since the last load. r=echen

This commit is contained in:
Josh Matthews 2016-10-04 13:50:33 -04:00
parent b3014cc00b
commit 85e4080b27
4 changed files with 12 additions and 0 deletions

View File

@ -649,6 +649,8 @@ HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
}
}
mLastSelectedSource = nullptr;
nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}

View File

@ -0,0 +1 @@
<div><img src=pass.png></div>

View File

@ -0,0 +1,8 @@
<html>
<div></div>
<script>
var d = (new DOMParser()).parseFromString("<img src=pass.png>", "text/html");
var n = d.adoptNode(d.querySelector('img'));
document.querySelector('div').appendChild(n);
</script>
</html>

View File

@ -35,6 +35,7 @@ skip-if(Android||B2G) == 649134-2.html 649134-2-ref.html
== bug502168-1_malformed.html bug502168-1_well-formed.html
== responsive-image-load-shortcircuit.html responsive-image-load-shortcircuit-ref.html
== image-load-shortcircuit.html image-load-shortcircuit-ref.html
# Test that image documents taken into account CSS properties like
# image-orientation when determining the size of the image.