Set video src from script, not from the element attribute. This
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2007 20:07:06 +0000 (20:07 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Nov 2007 20:07:06 +0000 (20:07 +0000)
        guarantees load events do not fire before event listeners are registered.
        This change does not affect test results.

        * media/progress-event.html:
        * media/video-autoplay.html:
        * media/video-buffered.html:
        * media/video-currentTime-set.html:
        * media/video-currentTime-set2.html:
        * media/video-currentTime.html:
        * media/video-dom-autoplay.html:
        * media/video-error-abort.html:
        * media/video-error-does-not-exist.html:
        * media/video-load-networkState.html:
        * media/video-load-readyState.html:
        * media/video-no-autoplay.html:
        * media/video-seekable.html:
        * media/video-seeking.html:
        * media/video-size.html:
        * media/video-src.html:
        * media/video-start.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27990 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
LayoutTests/ChangeLog
LayoutTests/media/progress-event.html
LayoutTests/media/video-buffered.html
LayoutTests/media/video-currentTime-set.html
LayoutTests/media/video-currentTime-set2.html
LayoutTests/media/video-currentTime.html
LayoutTests/media/video-dom-autoplay.html
LayoutTests/media/video-error-abort.html
LayoutTests/media/video-error-does-not-exist.html
LayoutTests/media/video-load-networkState.html
LayoutTests/media/video-load-readyState.html
LayoutTests/media/video-no-autoplay.html
LayoutTests/media/video-seekable.html
LayoutTests/media/video-seeking.html
LayoutTests/media/video-size.html
LayoutTests/media/video-src.html
LayoutTests/media/video-start.html

index a42ff81404af65de450d5bcfc6501228d6bd93c1..59cb7026d61233c142c5e8791c03d718825ab5ca 100644 (file)
@@ -1,3 +1,27 @@
+2007-11-23  Antti Koivisto  <antti@apple.com>
+
+        Set video src from script, not from the element attribute. This
+        guarantees load events do not fire before event listeners are registered. 
+        This change does not affect test results.
+
+        * media/progress-event.html:
+        * media/video-autoplay.html:
+        * media/video-buffered.html:
+        * media/video-currentTime-set.html:
+        * media/video-currentTime-set2.html:
+        * media/video-currentTime.html:
+        * media/video-dom-autoplay.html:
+        * media/video-error-abort.html:
+        * media/video-error-does-not-exist.html:
+        * media/video-load-networkState.html:
+        * media/video-load-readyState.html:
+        * media/video-no-autoplay.html:
+        * media/video-seekable.html:
+        * media/video-seeking.html:
+        * media/video-size.html:
+        * media/video-src.html:
+        * media/video-start.html:
+
 2007-11-23  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Maciej.
index a1499d0e66b934b79540be52a52f717e2877649c..67a39b7b51c76c6e8648bd31e375dd7545a5f95e 100644 (file)
@@ -1,6 +1,7 @@
-<video src="content/test.mp4"></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 waitForEventAndTest("begin", "!event.lengthComputable && event.loaded==0 && event.total==0");
 waitForEventTestAndEnd("load", "event.lengthComputable && event.loaded>0 && event.total>0");
+video.src = "content/test.mp4";
 </script>
index 324508a2f946b8636ee998ebf6f2066a39a0c97a..41206d886397626232fbeb4fd1741ed00d73ca25 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.buffered.length == 0");
@@ -19,4 +19,5 @@ waitForEvent('load',
         endTest();
     }
 );
+video.src = "content/test.mp4";
 </script>
index 71048b502e6779444cd93123e7e43a7502148c5d..03ad4450cb6535ef19e60a8d7325d212524df866 100644 (file)
@@ -11,4 +11,5 @@ function () {
     });
     waitForEventAndEnd('ended');
 });
+video.src = "content/test.mp4";
 </script>
index 585d831b84fd3c09a014172d8bdd22c002c696a5..0154aa5947aaacb4157474cace2cc9053d9a8eed 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 waitForEvent('load',  
@@ -10,5 +10,5 @@ function () {
     test("video.currentTime.toFixed(1) == 3.1");
     endTest();
 });
-
+video.src = "content/test.mp4";
 </script>
index 159ecab4cab709693c14d2a7a9096c8af0119b5a..b47f63c2aa3fbe047a341a07103f5f02d937d1e6 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.currentTime == 0")
@@ -10,4 +10,5 @@ function testCurrentTime()
     test("video.currentTime > 0")
     endTest();
 }
+video.src = "content/test.mp4";
 </script>
index a3762f0301fc5d897dfa1ae11e6e0652ed4d5453..ee7ec1884c05662c0630cf31caaa4a8f1344739f 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("!video.autoplay");
@@ -6,4 +6,5 @@ video.autoplay = true;
 test("video.autoplay");
 test("video.getAttribute('autoplay') != null");
 waitForEventTestAndEnd('play', "!video.paused");
+video.src = "content/test.mp4";
 </script>
index 85c07af336a97f1a2b47f90a09facc4c6be28b73..3814a2ca007c6525504740ba045aa7af5e74930f 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("!video.error");
@@ -6,4 +6,5 @@ var didLoad = false;
 waitForEvent("begin", function () { if (didLoad) return; didLoad = true; video.load(); });
 waitForEventAndTest("abort", "video.error.code == MediaError.MEDIA_ERR_ABORTED");
 waitForEventTestAndEnd("load", "!video.error");
+video.src = "content/test.mp4";
 </script>
index 6de7595b7cb873d496d2a716b2c492e2fd1a1926..a3a0d185a5d728ab5f821ab2c61e1723b8cf1fba 100644 (file)
@@ -1,7 +1,8 @@
-<video src=content/does-not-exist.mpeg></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("!video.error");
 waitForEventAndTest("load", "false");
 waitForEventTestAndEnd("emptied", "video.error.code == MediaError.MEDIA_ERR_NETWORK");
+video.src = "content/does-not-exist.mpeg";
 </script>
index 3a1c66785f058c75ca20d26ed38ea8ced8e5993d..20e1cc6034a66f6b3c59ba3a7e2296b5211320ce 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.networkState == HTMLMediaElement.EMPTY");
@@ -6,4 +6,5 @@ waitForEventAndTest("begin", "video.networkState == HTMLMediaElement.LOADING");
 waitForEventAndTest("loadedmetadata", "video.networkState == HTMLMediaElement.LOADED_METADATA");
 waitForEventAndTest("loadedfirstframe", "video.networkState == HTMLMediaElement.LOADED_FIRST_FRAME");
 waitForEventTestAndEnd("load", "video.networkState == HTMLMediaElement.LOADED");
+video.src = "content/test.mp4";
 </script>
index 05e8dd9993b581006bf26ba99ce1441bf6d7cf53..092dee0b9d4745adf8aed2180c2093d9329cf179 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.readyState == HTMLMediaElement.DATA_UNAVAILABLE");
@@ -7,4 +7,5 @@ waitForEventAndTest("loadedmetadata", "video.readyState == HTMLMediaElement.DATA
 waitForEventAndTest("loadedfirstframe", "video.readyState == HTMLMediaElement.CAN_SHOW_CURRENT_FRAME");
 waitForEventAndTest("canshowcurrentframe", "video.readyState == HTMLMediaElement.CAN_SHOW_CURRENT_FRAME");
 waitForEventTestAndEnd("canplaythrough", "video.readyState == HTMLMediaElement.CAN_PLAY_THROUGH");
+video.src = "content/test.mp4";
 </script>
index 31a180e33b1e90448cfbdb3a29cd46fa71bd29ea..36cff2f7b848a483b42e7b88ddf45334523f9e69 100644 (file)
@@ -1,7 +1,8 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.paused");
 waitForEventAndTest("play", "false");
 waitForEvent("load", function () { setTimeout(testAndEnd('video.paused', 500)) });
+video.src = "content/test.mp4";
 </script>
index caef55c56d753f8a13d6b9ff81fbdc929b3b355d..7520c6023c5f24a39b087760e1aa98a90e267aa2 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.seekable.length == 0");
@@ -19,4 +19,5 @@ waitForEvent('load',
         endTest();
     }
 );
+video.src = "content/test.mp4";
 </script>
index e3d5d90fb0d7a63325359e292b2415622e105f2a..1d1c44cf4e679a239eeb29f43eeabaa8ab0095a3 100644 (file)
@@ -1,4 +1,4 @@
-<video src=content/test.mp4></video>
+<video></video>
 <p>Test that seeking attribute is true in timeupdate event after seek and goes back to false when seeking completes </p>
 <script src=video-test.js></script>
 <script>
@@ -16,4 +16,5 @@ waitForEvent('load',
         run("video.currentTime = 2");
     }
 );
+video.src = "content/test.mp4";
 </script>
index 0c4a0e7371d1032660ec79ba236f2139a4ef06f4..67938063d600aa721cd50b3443a1b3c0bd293709 100644 (file)
@@ -1,6 +1,7 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 test("video.videoWidth == 0 && video.videoHeight == 0");
 waitForEventTestAndEnd('loadedmetadata', "video.videoWidth > 0 && video.videoHeight > 0");
+video.src = "content/test.mp4";
 </script>
index 66ee4ff75e0c2ed5eaeaa99d69da81ffe29726d7..12df747eec1845919051ce97674ba94a2940665b 100644 (file)
@@ -1,5 +1,6 @@
-<video src=content/test.mp4></video>
+<video></video>
 <script src=video-test.js></script>
 <script>
 waitForEventTestAndEnd('begin', "relativeURL(video.currentSrc) == 'content/test.mp4'");
+video.src = "content/test.mp4";
 </script>
index b0db44746f3074f7c76cc7669dc0095a0a6ed983..bbbeb31a19168931a2c9771416cd472ceb4bcda6 100644 (file)
@@ -1,6 +1,7 @@
-<video src=content/test.mp4 start=1s></video>
+<video start=1s></video>
 <script src=video-test.js></script>
 <script>
 test("video.start == 1.0");
 waitForEventTestAndEnd('canplaythrough', "video.currentTime == 1.0");
+video.src = "content/test.mp4";
 </script>