Title: [126665] branches/chromium/1229

Diff

Copied: branches/chromium/1229/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener-expected.txt (from rev 125052, trunk/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener-expected.txt) (0 => 126665)


--- branches/chromium/1229/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener-expected.txt	                        (rev 0)
+++ branches/chromium/1229/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener-expected.txt	2012-08-25 00:40:35 UTC (rev 126665)
@@ -0,0 +1,3 @@
+This page tests that you can correctly remove a video object with a poster in a beforeload listener without causing a crash.
+
+PASS

Copied: branches/chromium/1229/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener.html (from rev 125052, trunk/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener.html) (0 => 126665)


--- branches/chromium/1229/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener.html	                        (rev 0)
+++ branches/chromium/1229/LayoutTests/fast/dom/beforeload/remove-video-poster-in-beforeload-listener.html	2012-08-25 00:40:35 UTC (rev 126665)
@@ -0,0 +1,46 @@
+<html>
+<head>
+    <script src=""
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+        
+        var count = 0;
+        var maxCount = 10;
+        var timeout = 100;
+
+        document.addEventListener("beforeload", function(event) {
+            event.target.parentElement.removeChild(event.target);
+        }, true);
+    </script>
+</head>
+<body>
+    <p>This page tests that you can correctly remove a video object with a poster in a beforeload listener without causing a crash.</p>
+    <div id="console"></div>
+    <script>
+        function checkObjectRemoval()
+        {
+            if (!document.getElementsByTagName("video").length) {
+                print("PASS", "green");
+                if (window.testRunner)
+                    testRunner.notifyDone();
+                return;
+            }
+            
+            if (++count > maxCount) {
+                print("FAIL", "red");
+                if (window.testRunner)
+                    testRunner.notifyDone();
+                return;
+            }
+            
+            setTimeout("checkObjectRemoval()", timeout);
+        }
+        
+        setTimeout("checkObjectRemoval()", timeout);
+    </script>
+    <video poster="../resources/abe.png">>><source>>>
+</body>
+</html>

Modified: branches/chromium/1229/Source/WebCore/html/HTMLVideoElement.cpp (126664 => 126665)


--- branches/chromium/1229/Source/WebCore/html/HTMLVideoElement.cpp	2012-08-25 00:40:11 UTC (rev 126664)
+++ branches/chromium/1229/Source/WebCore/html/HTMLVideoElement.cpp	2012-08-25 00:40:35 UTC (rev 126665)
@@ -87,14 +87,6 @@
 #endif
 }
 
-void HTMLVideoElement::detach()
-{
-    HTMLMediaElement::detach();
-    
-    if (!shouldDisplayPosterImage() && m_imageLoader)
-        m_imageLoader.clear();
-}
-
 void HTMLVideoElement::collectStyleForAttribute(const Attribute& attribute, StylePropertySet* style)
 {
     if (attribute.name() == widthAttr)

Modified: branches/chromium/1229/Source/WebCore/html/HTMLVideoElement.h (126664 => 126665)


--- branches/chromium/1229/Source/WebCore/html/HTMLVideoElement.h	2012-08-25 00:40:11 UTC (rev 126664)
+++ branches/chromium/1229/Source/WebCore/html/HTMLVideoElement.h	2012-08-25 00:40:35 UTC (rev 126665)
@@ -75,7 +75,6 @@
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 #endif
     virtual void attach();
-    virtual void detach();
     virtual void parseAttribute(const Attribute&) OVERRIDE;
     virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
     virtual void collectStyleForAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to