Skip to content

Commit

Permalink
correct failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nupurbaghel committed Sep 1, 2018
1 parent d7cb68c commit b1adf8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion components/script/dom/htmlimageelement.rs
Expand Up @@ -1150,7 +1150,13 @@ impl HTMLImageElementMethods for HTMLImageElement {
let ref url = self.current_request.borrow().parsed_url;
match *url {
Some(ref url) => DOMString::from_string(url.clone().into_string()),
None => DOMString::from(""),
None => {
let ref unparsed_url = self.current_request.borrow().source_url;
match *unparsed_url {
Some(ref url) => url.clone(),
None => DOMString::from("")
}
},
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/wpt/metadata/MANIFEST.json
Expand Up @@ -601198,7 +601198,7 @@
"support"
],
"html/semantics/embedded-content/the-img-element/img.complete.html": [
"771b8e1b80e6ad41b5cf703b5a1e99bd23b35416",
"4be8d4db848ad259a508e1a8091feaae7733e784",
"testharness"
],
"html/semantics/embedded-content/the-img-element/invalid-src.html": [
Expand Down
Expand Up @@ -38,8 +38,9 @@
assert_false(loaded);
loaded = true;
assert_true(document.getElementById("imgTestTag3").complete);
var currentSrc = document.getElementById("imgTestTag3").currentSrc
assert_equals(new URL(window.location.origin + "/" + currentSrc).pathname, "/3.jpg");
var currentSrc = document.getElementById("imgTestTag3").currentSrc;
var expectedUrl = new URL("3.jpg", window.location);
assert_equals(new URL(currentSrc).pathname, expectedUrl.pathname);
}, "Only one onload, despite setting the src twice");

document.getElementById("imgTestTag3").src = 'test' + Math.random();
Expand Down

0 comments on commit b1adf8e

Please sign in to comment.