Bug 1139560 - <img>.currentSrc should be not be nullable. r=jst, a=sledru
authorJohn Schoenick <john@pointysoftware.net>
Wed, 04 Mar 2015 23:12:00 -0500
changeset 258438 7285a02cd883
parent 258437 07666fc071be
child 258439 cd5b5709b2e4
push id4668
push userryanvm@gmail.com
push date2015-04-13 16:23 +0000
treeherdermozilla-beta@002faed66e96 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst, sledru
bugs1139560
milestone38.0
Bug 1139560 - <img>.currentSrc should be not be nullable. r=jst, a=sledru
dom/tests/mochitest/general/test_img_mutations.html
dom/tests/mochitest/general/test_picture_mutations.html
dom/webidl/HTMLImageElement.webidl
--- a/dom/tests/mochitest/general/test_img_mutations.html
+++ b/dom/tests/mochitest/general/test_img_mutations.html
@@ -64,17 +64,17 @@
       info("test 1");
       img.src = testPNG50;
       is(img.currentSrc, testPNG50, "Should have synchronously selected source");
 
       img.src = "non_existent_image.404";
       ok(img.currentSrc.endsWith("non_existent_image.404"), "Should have synchronously selected source");
 
       img.removeAttribute("src");
-      is(img.currentSrc, null, "Should have dropped currentSrc");
+      is(img.currentSrc, '', "Should have dropped currentSrc");
 
       // Load another image while previous load is still pending
       img.src = testPNG200;
       is(img.currentSrc, testPNG200, "Should have synchronously selected source");
 
       // No events should have fired synchronously, now we should get just one load (and no 404 error)
       expectEvents(1, 0, nextTest);
     });
--- a/dom/tests/mochitest/general/test_picture_mutations.html
+++ b/dom/tests/mochitest/general/test_picture_mutations.html
@@ -60,17 +60,17 @@
       }
     }
 
     // Setup image outside the tree dom, make sure it loads
     tests.push(function() {
       info("test 1");
       img.srcset = testPNG100;
       img.src = testPNG50;
-      is(img.currentSrc, null, "Should not have synchronously selected source");
+      is(img.currentSrc, '', "Should not have synchronously selected source");
 
       // No events should have fired synchronously, now we should get just one load (and no 404 error)
       expectEvents(1, 0, nextTest);
     });
 
     // Binding to an empty picture should trigger an event, even if source doesn't change
     tests.push(function() {
       info("test 2");
--- a/dom/webidl/HTMLImageElement.webidl
+++ b/dom/webidl/HTMLImageElement.webidl
@@ -57,17 +57,17 @@ partial interface HTMLImageElement {
 };
 
 // [Update me: not in whatwg spec yet]
 // http://picture.responsiveimages.org/#the-img-element
 partial interface HTMLImageElement {
            [SetterThrows, Pref="dom.image.picture.enabled"]
            attribute DOMString sizes;
            [Pref="dom.image.srcset.enabled"]
-  readonly attribute DOMString? currentSrc;
+  readonly attribute DOMString currentSrc;
 };
 
 // Mozilla extensions.
 partial interface HTMLImageElement {
            attribute DOMString lowsrc;
 
   // These attributes are offsets from the closest view (to mimic
   // NS4's "offset-from-layer" behavior).