[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
eric.carlson at apple.com
eric.carlson at apple.com
Thu Feb 4 21:23:29 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 97b0fa39d77aa25cf5fcc5a9dd5f3822f87e513c
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 21 17:46:23 2010 +0000
2010-01-21 Eric Carlson <eric.carlson at apple.com>
Reviewed by Darin Adler.
Intermittent crash when media element is adopted by another document
https://bugs.webkit.org/show_bug.cgi?id=33919
rdar://problem/7557527
Test: media/adopt-node-crash.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::willMoveToNewOwnerDocument): Unregister for
document callbacks.
(WebCore::HTMLMediaElement::didMoveToNewOwnerDocument): Register for
document callbacks.
* html/HTMLMediaElement.h:
2010-01-21 Eric Carlson <eric.carlson at apple.com>
Reviewed by Darin Adler.
Intermittent crash when media element is adopted by another document
https://bugs.webkit.org/show_bug.cgi?id=33919
rdar://problem/7557527
This test does not always crash the un-patched version of WebKit because
the crash is so timing-dependant.
* media/adopt-node-crash-expected.txt: Added.
* media/adopt-node-crash.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a9cd4d4..875ba2e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-21 Eric Carlson <eric.carlson at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Intermittent crash when media element is adopted by another document
+ https://bugs.webkit.org/show_bug.cgi?id=33919
+ rdar://problem/7557527
+
+ This test does not always crash the un-patched version of WebKit because
+ the crash is so timing-dependant.
+
+ * media/adopt-node-crash-expected.txt: Added.
+ * media/adopt-node-crash.html: Added.
+
2010-01-21 Simon Hausmann <simon.hausmann at nokia.com>
No review, rolling out 53615 as it causes two
diff --git a/LayoutTests/editing/execCommand/copy-without-selection-expected.txt b/LayoutTests/media/adopt-node-crash-expected.txt
similarity index 100%
copy from LayoutTests/editing/execCommand/copy-without-selection-expected.txt
copy to LayoutTests/media/adopt-node-crash-expected.txt
diff --git a/LayoutTests/media/adopt-node-crash.html b/LayoutTests/media/adopt-node-crash.html
new file mode 100644
index 0000000..993a14d
--- /dev/null
+++ b/LayoutTests/media/adopt-node-crash.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+
+<html>
+ <head>
+ <script src=media-file.js></script>
+
+ <script>
+
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function log(msg)
+ {
+ document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
+ }
+
+ function forceGC()
+ {
+ if (window.GCController)
+ return GCController.collect();
+
+ // Force garbage collection
+ for (var ndx = 0; ndx < 99000; ndx++)
+ var str = new String("1234");
+ }
+
+ function finish()
+ {
+ log("EVENT(loadstart) from iframe");
+
+ forceGC();
+ location.href="data:text/html,SUCCESS<script>if (window.layoutTestController) layoutTestController.notifyDone()<" + "/script>";
+ }
+
+ function loadstart()
+ {
+ log("EVENT(loadstart)");
+
+ var video = document.getElementsByTagName('video')[0];
+ var newVideo = video.cloneNode(true);
+ newVideo.addEventListener("loadstart", finish);
+
+ var iframeDocument = document.getElementById("iframe").contentDocument;
+ iframeDocument.body.appendChild(newVideo);
+ }
+
+ function start()
+ {
+ var video = document.getElementsByTagName('video')[0];
+ video.addEventListener("loadstart", loadstart);
+ video.src = findMediaFile("video", "content/test");
+ }
+ </script>
+ </head>
+ <body>
+ <iframe id="iframe" width=340 height=260 ></iframe>
+ <div id=parent><video id=vid></video></div>
+ <p>Tests that we don't crash when moving a video element to a new document.</p>
+ <script>start()</script>
+ <pre id="console"></pre>
+ </body>
+</html>
+
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d24d415..07b2def 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-21 Eric Carlson <eric.carlson at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Intermittent crash when media element is adopted by another document
+ https://bugs.webkit.org/show_bug.cgi?id=33919
+ rdar://problem/7557527
+
+ Test: media/adopt-node-crash.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::willMoveToNewOwnerDocument): Unregister for
+ document callbacks.
+ (WebCore::HTMLMediaElement::didMoveToNewOwnerDocument): Register for
+ document callbacks.
+ * html/HTMLMediaElement.h:
+
2010-01-21 Adam Roben <aroben at apple.com>
More Windows build fixing
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 01b0fae..360bfb2 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -132,6 +132,21 @@ HTMLMediaElement::~HTMLMediaElement()
document()->unregisterForMediaVolumeCallbacks(this);
}
+void HTMLMediaElement::willMoveToNewOwnerDocument()
+{
+ document()->unregisterForDocumentActivationCallbacks(this);
+ document()->unregisterForMediaVolumeCallbacks(this);
+ HTMLElement::willMoveToNewOwnerDocument();
+}
+
+void HTMLMediaElement::didMoveToNewOwnerDocument()
+{
+ document()->registerForDocumentActivationCallbacks(this);
+ document()->registerForMediaVolumeCallbacks(this);
+ HTMLElement::didMoveToNewOwnerDocument();
+}
+
+
bool HTMLMediaElement::checkDTD(const Node* newChild)
{
return newChild->hasTagName(sourceTag) || HTMLElement::checkDTD(newChild);
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 3e9ae2a..9ee2c25 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -187,7 +187,10 @@ protected:
void setReadyState(MediaPlayer::ReadyState);
void setNetworkState(MediaPlayer::NetworkState);
-
+
+ virtual void willMoveToNewOwnerDocument();
+ virtual void didMoveToNewOwnerDocument();
+
private: // MediaPlayerClient
virtual void mediaPlayerNetworkStateChanged(MediaPlayer*);
virtual void mediaPlayerReadyStateChanged(MediaPlayer*);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list