Title: [141798] branches/chromium/1364

Diff

Copied: branches/chromium/1364/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly-expected.txt (from rev 141127, trunk/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly-expected.txt) (0 => 141798)


--- branches/chromium/1364/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly-expected.txt	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly-expected.txt	2013-02-04 21:15:51 UTC (rev 141798)
@@ -0,0 +1,16 @@
+Tests that the cue display tree has been removed properly and no crash happens.
+
+** Set the mode of the text track to showing **
+
+** Initialize the video element **
+EVENT(canplaythrough)
+
+** Empty the contents of the video element when it is ready to play **
+
+** Text track should not be rendered anymore **
+No text track cue with display id '-webkit-media-text-track-display' is currently visible
+
+No crash. PASS.
+
+END OF TEST
+

Copied: branches/chromium/1364/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html (from rev 141127, trunk/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html) (0 => 141798)


--- branches/chromium/1364/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html	                        (rev 0)
+++ branches/chromium/1364/LayoutTests/media/track/track-cue-rendering-tree-is-removed-properly.html	2013-02-04 21:15:51 UTC (rev 141798)
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+        <script src=""
+        <script src=""
+        <script src=""
+
+        <script>
+        function emptyVideoTextContent()
+        {
+                consoleWrite("");
+                consoleWrite("** Empty the contents of the video element when it is ready to play **");
+                video.textContent = "";
+
+                consoleWrite("");
+                consoleWrite("** Text track should not be rendered anymore **");
+                try {
+                    var textTrackCueBox = textTrackDisplayElement(video, 'display');
+                } catch (e) {
+                    consoleWrite(e);
+                }
+
+                consoleWrite("");
+                consoleWrite("No crash. PASS.");
+                consoleWrite("");
+
+                endTest();
+        }
+
+        function initElements()
+        {
+            consoleWrite("** Set the mode of the text track to showing **");
+            testTrack = document.querySelector('track');
+            testTrack.track.mode = "showing";
+
+            consoleWrite("");
+            consoleWrite("** Initialize the video element **");
+            findMediaElement();
+            video.src = "" '../content/test');
+
+            video.play();
+            waitForEvent('canplaythrough', emptyVideoTextContent);
+        }
+
+        </script>
+    </head>
+    <body _onload_="initElements()">
+        <p>Tests that the cue display tree has been removed properly and no crash happens.</p>
+        <video controls>
+            <track src="" kind="captions">
+        </video>
+    </body>
+</html>

Modified: branches/chromium/1364/Source/WebCore/html/HTMLMediaElement.cpp (141797 => 141798)


--- branches/chromium/1364/Source/WebCore/html/HTMLMediaElement.cpp	2013-02-04 21:12:35 UTC (rev 141797)
+++ branches/chromium/1364/Source/WebCore/html/HTMLMediaElement.cpp	2013-02-04 21:15:51 UTC (rev 141798)
@@ -1394,6 +1394,7 @@
     if (index != notFound)
         m_currentlyActiveCues.remove(index);
 
+    cue->removeDisplayTree();
     updateActiveTextTrackCues(currentTime());
 }
 

Modified: branches/chromium/1364/Source/WebCore/html/track/TextTrackCue.cpp (141797 => 141798)


--- branches/chromium/1364/Source/WebCore/html/track/TextTrackCue.cpp	2013-02-04 21:12:35 UTC (rev 141797)
+++ branches/chromium/1364/Source/WebCore/html/track/TextTrackCue.cpp	2013-02-04 21:15:51 UTC (rev 141798)
@@ -231,6 +231,7 @@
 
 TextTrackCue::~TextTrackCue()
 {
+    removeDisplayTree();
 }
 
 void TextTrackCue::cueWillChange()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to