ASSERT in notifyChildInserted when HTMLMediaElement is removed from tree
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 15:18:48 +0000 (15:18 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 15:18:48 +0000 (15:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83949

Reviewed by Antti Koivisto.

No new tests. I was not able to create a reproducible test case, but I have been unable
to reproduce the ASSERT that occassionally fired in existing tests since I have been
living on these changes.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedIntoDocument): Call configureMediaControls.
(WebCore::HTMLMediaElement::removedFromDocument): Ditto.
(WebCore::HTMLMediaElement::configureMediaControls): Don't show controls when the
    media element is not in a Document.

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

Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp

index e306c04..da19d47 100644 (file)
@@ -1,5 +1,22 @@
 2012-04-16  Eric Carlson  <eric.carlson@apple.com>
 
+        ASSERT in notifyChildInserted when HTMLMediaElement is removed from tree
+        https://bugs.webkit.org/show_bug.cgi?id=83949
+
+        Reviewed by Antti Koivisto.
+
+        No new tests. I was not able to create a reproducible test case, but I have been unable
+        to reproduce the ASSERT that occassionally fired in existing tests since I have been
+        living on these changes.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::insertedIntoDocument): Call configureMediaControls.
+        (WebCore::HTMLMediaElement::removedFromDocument): Ditto.
+        (WebCore::HTMLMediaElement::configureMediaControls): Don't show controls when the
+            media element is not in a Document.
+
+2012-04-16  Eric Carlson  <eric.carlson@apple.com>
+
         Layout Test media/track/track-delete-during-setup.html is hitting an ASSERT_NOT_REACHED
         https://bugs.webkit.org/show_bug.cgi?id=82269
 
index 6292215..182cded 100644 (file)
@@ -497,11 +497,13 @@ void HTMLMediaElement::insertedIntoDocument()
     HTMLElement::insertedIntoDocument();
     if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY)
         scheduleLoad(MediaResource);
+    configureMediaControls();
 }
 
 void HTMLMediaElement::removedFromDocument()
 {
     LOG(Media, "HTMLMediaElement::removedFromDocument");
+    configureMediaControls();
     if (m_networkState > NETWORK_EMPTY)
         pause();
     if (m_isFullscreen)
@@ -4019,7 +4021,7 @@ bool HTMLMediaElement::createMediaControls()
 void HTMLMediaElement::configureMediaControls()
 {
 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    if (!controls()) {
+    if (!controls() || !inDocument()) {
         if (hasMediaControls())
             mediaControls()->hide();
         return;