From f2631c2010f543cf493383575e9ce43b34372788 Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Wed, 14 Jun 2017 11:00:58 -0400 Subject: [PATCH 1/3] Terminate current load blocker before reassignment Fixes #17319. --- components/script/dom/htmlimageelement.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 0eaab8e58a4..6a4b67a6a92 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -493,6 +493,7 @@ impl HTMLImageElement { request.image = None; request.metadata = None; let document = document_from_node(self); + LoadBlocker::terminate(&mut request.blocker); request.blocker = Some(LoadBlocker::new(&*document, LoadType::Image(url.clone()))); } From 3ec15aa3dfa656968bc808fb85bc57ad3ee73e22 Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Thu, 15 Jun 2017 17:05:34 -0400 Subject: [PATCH 2/3] test that setting img src async before window.onload doesn't panic. --- tests/wpt/mozilla/meta/MANIFEST.json | 10 ++++++++++ .../img_async_src_set_before_window_load.html | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index e0694fdb2c0..a23da034e96 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -13193,6 +13193,12 @@ {} ] ], + "mozilla/img_async_src_set_before_window_load.html": [ + [ + "/_mozilla/mozilla/img_async_src_set_before_window_load.html", + {} + ] + ], "mozilla/img_find_non_sibling_map.html": [ [ "/_mozilla/mozilla/img_find_non_sibling_map.html", @@ -25862,6 +25868,10 @@ "3c4f36abed83367c851d943b1f25b8394de6fe75", "testharness" ], + "mozilla/img_async_src_set_before_window_load.html": [ + "ef8a1a0623d6f6743bd27e47df4dd77535da0d3e", + "testharness" + ], "mozilla/img_find_non_sibling_map.html": [ "d34100c4cc22adcaa1014095ba4b7b929b8e079d", "testharness" diff --git a/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html b/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html new file mode 100644 index 00000000000..17f060f3d87 --- /dev/null +++ b/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html @@ -0,0 +1,15 @@ + + + + + + + From 53da1e3915c9a6e0e2f0a626a8e08c71881e87cb Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Thu, 15 Jun 2017 17:13:30 -0400 Subject: [PATCH 3/3] add title to test; update manifest. --- tests/wpt/mozilla/meta/MANIFEST.json | 2 +- .../tests/mozilla/img_async_src_set_before_window_load.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index a23da034e96..37f08769d33 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -25869,7 +25869,7 @@ "testharness" ], "mozilla/img_async_src_set_before_window_load.html": [ - "ef8a1a0623d6f6743bd27e47df4dd77535da0d3e", + "c7895fe3b7b7f11a4853760e386e12a08bb51b96", "testharness" ], "mozilla/img_find_non_sibling_map.html": [ diff --git a/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html b/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html index 17f060f3d87..370d4ef9b8d 100644 --- a/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html +++ b/tests/wpt/mozilla/tests/mozilla/img_async_src_set_before_window_load.html @@ -1,6 +1,6 @@ - +Shouldn't panic when setting src attribute on img asynchronously before window.onload.