[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric at webkit.org
eric at webkit.org
Thu Oct 29 20:46:21 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit cbc6c3cf5df6facbb6d7fe7b864be7ef0782be91
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Oct 16 22:03:40 2009 +0000
2009-10-16 Andrew Scherkus <scherkus at chromium.org>
Reviewed by Eric Carlson.
Updated media resource selection algorithm to reflect latest HTML 5 specification.
https://bugs.webkit.org/show_bug.cgi?id=30407
* media/video-play-pause-exception-expected.txt:
* media/video-play-pause-exception.html:
* media/video-src-empty-expected.txt: Added.
* media/video-src-empty.html: Added.
* media/video-src-none-expected.txt: Added.
* media/video-src-none.html: Added.
2009-10-16 Andrew Scherkus <scherkus at chromium.org>
Reviewed by Eric Carlson.
Updated media resource selection algorithm to reflect latest HTML 5 specification.
Noticable changes:
- Elements with no source should have their network state set to NETWORK_EMPTY as opposed to NETWORK_NO_SOURCE
- Empty string ("") is now considered a valid URL resolving to the current page and will be loaded
Tests: media/video-src-empty.html
media/video-src-none.html
https://bugs.webkit.org/show_bug.cgi?id=30407
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectMediaResource): Updated code and comments to match spec.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b2b1875..0728cb2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-16 Andrew Scherkus <scherkus at chromium.org>
+
+ Reviewed by Eric Carlson.
+
+ Updated media resource selection algorithm to reflect latest HTML 5 specification.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30407
+
+ * media/video-play-pause-exception-expected.txt:
+ * media/video-play-pause-exception.html:
+ * media/video-src-empty-expected.txt: Added.
+ * media/video-src-empty.html: Added.
+ * media/video-src-none-expected.txt: Added.
+ * media/video-src-none.html: Added.
+
2009-10-16 Daniel Bates <dbates at webkit.org>
Reviewed by Darin Adler.
diff --git a/LayoutTests/media/video-play-pause-exception-expected.txt b/LayoutTests/media/video-play-pause-exception-expected.txt
index d8969e3..d7273d6 100644
--- a/LayoutTests/media/video-play-pause-exception-expected.txt
+++ b/LayoutTests/media/video-play-pause-exception-expected.txt
@@ -5,6 +5,6 @@ RUN(video.pause())
EVENT(waiting)
EVENT(timeupdate)
EVENT(pause)
-EXPECTED (video.networkState == '4') OK
+EXPECTED (video.networkState == '0') OK
END OF TEST
diff --git a/LayoutTests/media/video-play-pause-exception.html b/LayoutTests/media/video-play-pause-exception.html
index 9fbd1ef..f2c77ab 100644
--- a/LayoutTests/media/video-play-pause-exception.html
+++ b/LayoutTests/media/video-play-pause-exception.html
@@ -17,7 +17,7 @@
function someTimeLater()
{
- testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
+ testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
endTest();
consoleWrite("");
}
diff --git a/LayoutTests/media/video-src-empty-expected.txt b/LayoutTests/media/video-src-empty-expected.txt
new file mode 100644
index 0000000..51ee983
--- /dev/null
+++ b/LayoutTests/media/video-src-empty-expected.txt
@@ -0,0 +1,6 @@
+Empty src attribute defined. Invalid URL and video should error.
+
+EXPECTED (video.error.code == '4') OK
+EXPECTED (video.networkState == '4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-src-empty.html b/LayoutTests/media/video-src-empty.html
new file mode 100644
index 0000000..519ed0c
--- /dev/null
+++ b/LayoutTests/media/video-src-empty.html
@@ -0,0 +1,16 @@
+<html>
+ <body>
+ <p>Empty src attribute defined. Invalid URL and video should error.</p>
+ <video src="" onerror="errorEvent()" controls></video>
+
+ <script src=video-test.js></script>
+ <script>
+ function errorEvent()
+ {
+ testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
+ testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
+ endTest();
+ }
+ </script>
+ </body>
+</html>
diff --git a/LayoutTests/media/video-src-none-expected.txt b/LayoutTests/media/video-src-none-expected.txt
new file mode 100644
index 0000000..cfd2c3d
--- /dev/null
+++ b/LayoutTests/media/video-src-none-expected.txt
@@ -0,0 +1,6 @@
+No src attribute defined. Video should remain in NETWORK_EMPTY.
+
+EXPECTED (video.error == 'null') OK
+EXPECTED (video.networkState == '0') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-src-none.html b/LayoutTests/media/video-src-none.html
new file mode 100644
index 0000000..8e723b4
--- /dev/null
+++ b/LayoutTests/media/video-src-none.html
@@ -0,0 +1,16 @@
+<html>
+ <body onload="setTimeout(test, 250)">
+ <p>No src attribute defined. Video should remain in NETWORK_EMPTY.</p>
+ <video controls></video>
+
+ <script src=video-test.js></script>
+ <script>
+ function test()
+ {
+ testExpected("video.error", null);
+ testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
+ endTest();
+ }
+ </script>
+ </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a17988a..1b81502 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-16 Andrew Scherkus <scherkus at chromium.org>
+
+ Reviewed by Eric Carlson.
+
+ Updated media resource selection algorithm to reflect latest HTML 5 specification.
+
+ Noticable changes:
+ - Elements with no source should have their network state set to NETWORK_EMPTY as opposed to NETWORK_NO_SOURCE
+ - Empty string ("") is now considered a valid URL resolving to the current page and will be loaded
+
+ Tests: media/video-src-empty.html
+ media/video-src-none.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=30407
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::selectMediaResource): Updated code and comments to match spec.
+
2009-10-16 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index bbeaba0..4d6aa0d 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -510,33 +510,32 @@ void HTMLMediaElement::loadInternal()
void HTMLMediaElement::selectMediaResource()
{
- // 1 - If the media element has neither a src attribute nor any source element children, run these substeps
+ // 1 - Set the networkState to NETWORK_NO_SOURCE
+ m_networkState = NETWORK_NO_SOURCE;
+
+ // 2 - Asynchronously await a stable state.
+
+ // 3 - If the media element has neither a src attribute nor any source element children, run these substeps
String mediaSrc = getAttribute(srcAttr);
if (!mediaSrc && !havePotentialSourceChild()) {
m_loadState = WaitingForSource;
- // 1 - Set the networkState to NETWORK_NO_SOURCE
- m_networkState = NETWORK_NO_SOURCE;
-
- // 2 - While the media element has neither a src attribute nor any source element children,
- // wait. (This steps might wait forever.)
-
- m_delayingTheLoadEvent = false;
+ // 1 - Set the networkState to NETWORK_EMPTY and abort these steps
+ m_networkState = NETWORK_EMPTY;
+ ASSERT(!m_delayingTheLoadEvent);
return;
}
- // 2
+ // 4
m_delayingTheLoadEvent = true;
-
- // 3
m_networkState = NETWORK_LOADING;
- // 4
+ // 5
scheduleProgressEvent(eventNames().loadstartEvent);
- // 5 - If the media element has a src attribute, then run these substeps
+ // 6 - If the media element has a src attribute, then run these substeps
ContentType contentType("");
- if (!mediaSrc.isEmpty()) {
+ if (!mediaSrc.isNull()) {
KURL mediaURL = document()->completeURL(mediaSrc);
if (isSafeToLoadURL(mediaURL, Complain) && dispatchBeforeLoadEvent(mediaURL.string())) {
m_loadState = LoadingFromSrcAttr;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list