Bug 1139560 - <img>.currentSrc should be not be nullable. r=jst, a=lizzard
authorJohn Schoenick <john@pointysoftware.net>
Wed, 04 Mar 2015 23:12:00 -0500
changeset 265524 c7d9cd5c2f8b2ba0ff8ebe819606c8de05253145
parent 265523 3057b13be4989373f104562b743faa8c8b42a148
child 265525 422331ee989537c2d14327ac66e60225c4f7261d
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst, lizzard
bugs1139560
milestone39.0a2
Bug 1139560 - <img>.currentSrc should be not be nullable. r=jst, a=lizzard
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).