зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1321300 - Back out bug 1264768
and add test; r=hsivonen
MozReview-Commit-ID: KsN18tG0Ptb
This commit is contained in:
Родитель
4c8db026e6
Коммит
bc56617eab
|
@ -766,13 +766,8 @@ nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
|||
// Parse the URI string to get image URI
|
||||
nsCOMPtr<nsIURI> imageURI;
|
||||
nsresult rv = StringToURI(aNewURI, doc, getter_AddRefs(imageURI));
|
||||
if (NS_FAILED(rv)) {
|
||||
// Cancel image requests and then fire error and loadend events per spec
|
||||
CancelImageRequests(aNotify);
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
return NS_OK;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// XXXbiesi fire onerror if that failed?
|
||||
|
||||
NS_TryToSetImmutable(imageURI);
|
||||
|
||||
|
|
|
@ -67,6 +67,9 @@
|
|||
img.src = testPNG50;
|
||||
is(img.currentSrc, testPNG50, "Should have synchronously selected source");
|
||||
|
||||
// Assigning a wrong URL should not trigger error event (bug 1321300).
|
||||
img.src = '//:0'; // Wrong URL
|
||||
|
||||
img.src = "non_existent_image.404";
|
||||
ok(img.currentSrc.endsWith("non_existent_image.404"), "Should have synchronously selected source");
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[invalid-src.html]
|
||||
type: testharness
|
||||
expected: TIMEOUT
|
||||
[src="http://also a broken url"]
|
||||
expected: TIMEOUT
|
||||
|
Загрузка…
Ссылка в новой задаче