[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
hyatt at apple.com
hyatt at apple.com
Thu Oct 29 20:41:52 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit c47109374f55c576ddc6aa4bebe7e851fc4dc654
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 8 17:26:36 2009 +0000
Make beforeload work on <video>/<audio> elements.
Reviewed by Eric Carlson.
Added fast/dom/beforeload/video-before-load.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseMappedAttribute):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::selectNextSourceChild):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt b/LayoutTests/fast/dom/beforeload/video-before-load-expected.txt
similarity index 100%
copy from LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt
copy to LayoutTests/fast/dom/beforeload/video-before-load-expected.txt
diff --git a/LayoutTests/fast/dom/beforeload/video-before-load.html b/LayoutTests/fast/dom/beforeload/video-before-load.html
new file mode 100644
index 0000000..2005fe2
--- /dev/null
+++ b/LayoutTests/fast/dom/beforeload/video-before-load.html
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script>
+function print(message, color)
+{
+ var paragraph = document.createElement("div");
+ paragraph.appendChild(document.createTextNode(message));
+ paragraph.style.fontFamily = "monospace";
+ if (color)
+ paragraph.style.color = color;
+ document.getElementById("console").appendChild(paragraph);
+}
+</script>
+</head>
+<body>
+<div id="console"></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+</script>
+
+<video src="../../../media/content/test.mp4" onbeforeload="print('PASS', 'green'); if (window.layoutTestController) window.layoutTestController.notifyDone(); return false;" onload="print('FAIL', 'red'); if (window.layoutTestController) window.layoutTestController.notifyDone();"></video>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9144ce8..c6473c6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-07 Dave Hyatt <hyatt at apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Make beforeload work on <video>/<audio> elements.
+
+ Added fast/dom/beforeload/video-before-load.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::parseMappedAttribute):
+ (WebCore::HTMLMediaElement::selectMediaResource):
+ (WebCore::HTMLMediaElement::selectNextSourceChild):
+
2009-10-08 Nikolas Zimmermann <nzimmermann at rim.com>
Reviewed by Eric Seidel.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 0136e08..bbeaba0 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -167,6 +167,8 @@ void HTMLMediaElement::parseMappedAttribute(MappedAttribute* attr)
m_player->setAutobuffer(!attr->isNull());
} else if (attrName == onabortAttr)
setAttributeEventListener(eventNames().abortEvent, createAttributeEventListener(this, attr));
+ else if (attrName == onbeforeloadAttr)
+ setAttributeEventListener(eventNames().beforeloadEvent, createAttributeEventListener(this, attr));
else if (attrName == oncanplayAttr)
setAttributeEventListener(eventNames().canplayEvent, createAttributeEventListener(this, attr));
else if (attrName == oncanplaythroughAttr)
@@ -536,7 +538,7 @@ void HTMLMediaElement::selectMediaResource()
ContentType contentType("");
if (!mediaSrc.isEmpty()) {
KURL mediaURL = document()->completeURL(mediaSrc);
- if (isSafeToLoadURL(mediaURL, Complain)) {
+ if (isSafeToLoadURL(mediaURL, Complain) && dispatchBeforeLoadEvent(mediaURL.string())) {
m_loadState = LoadingFromSrcAttr;
loadResource(mediaURL, contentType);
} else
@@ -1384,7 +1386,7 @@ KURL HTMLMediaElement::selectNextSourceChild(ContentType *contentType, InvalidSo
// Is it safe to load this url?
mediaURL = source->src();
- if (!mediaURL.isValid() || !isSafeToLoadURL(mediaURL, actionIfInvalid))
+ if (!mediaURL.isValid() || !isSafeToLoadURL(mediaURL, actionIfInvalid) || !dispatchBeforeLoadEvent(mediaURL.string()))
goto check_again;
// Making it this far means the <source> looks reasonable
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list