mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 11:38:16 +00:00
Bug 599975 - Fire error event for images with empty string src value; r=smaug a=jst
--HG-- extra : rebase_source : 7a28c7b1524de3d059e62fd253b8a6daf614d904
This commit is contained in:
parent
4a882b87b9
commit
a1428ec198
@ -641,7 +641,6 @@ nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
||||
doc->GetDocumentURI() &&
|
||||
NS_SUCCEEDED(doc->GetDocumentURI()->Equals(imageURI, &equal)) &&
|
||||
equal) {
|
||||
|
||||
// Loading an embedded img from the same URI as the document URI will not work
|
||||
// as a resource cannot recursively embed itself. Attempting to do so generally
|
||||
// results in having to pre-emptively close down an in-flight HTTP transaction
|
||||
@ -650,6 +649,7 @@ nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
||||
// In light of that, just skip loading it..
|
||||
// Do make sure to drop our existing image, if any
|
||||
CancelImageRequests(aNotify);
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -236,6 +236,7 @@ _TEST_FILES = \
|
||||
test_bug607145.html \
|
||||
test_bug601061.html \
|
||||
test_bug596511.html \
|
||||
test_bug599975.html \
|
||||
reflect.js \
|
||||
test_bug611189.html \
|
||||
test_bug613113.html \
|
||||
|
35
content/html/content/test/test_bug599975.html
Normal file
35
content/html/content/test/test_bug599975.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=599975
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 599975</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=599975">Mozilla Bug 599975</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
<img id=image>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
/** Test for Bug 599975 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var img = document.getElementById("image");
|
||||
img.onerror = function() {
|
||||
ok(true, "onerror fired");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
img.onload = function() {
|
||||
ok(false, "onload fired");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
img.src = "";
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user