Bug 1139560 - <img>.currentSrc should be not be nullable. r=jst
authorJohn Schoenick <john@pointysoftware.net>
Wed, 04 Mar 2015 23:12:00 -0500
changeset 257317 61445e93cd38c22bf60b4d1f3e03c20f1ccd357b
parent 257316 6452590ddb776ead8a722a07712cd7256171fb6d
child 257318 b8c0cfa633b413e9ac92f0f4b53395b20a285117
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1139560
milestone40.0a1
Bug 1139560 - <img>.currentSrc should be not be nullable. r=jst
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).