WebCore:

        Reviewed by Oliver.

        Fix for <rdar://problem/5631356> Toggling display property on video causes controls to get lost

        * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::attach): Call updateFromElement.
        * html/HTMLMediaElement.h:

LayoutTests:

        Reviewed by Oliver.

        Fix <rdar://problem/5631356> Toggling display property on video causes controls to get lost

        * media/video-display-toggle.html: Added.
        * platform/mac/media/video-display-toggle-expected.checksum: Added.
        * platform/mac/media/video-display-toggle-expected.png: Added.
        * platform/mac/media/video-display-toggle-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/media/video-display-toggle.html b/LayoutTests/media/video-display-toggle.html
new file mode 100644
index 0000000..9b708b7
--- /dev/null
+++ b/LayoutTests/media/video-display-toggle.html
@@ -0,0 +1,34 @@
+<html>
+    <head>
+        <script>            
+            function toggleDisplay()
+            {
+                var video = document.getElementById('vid');
+                if (video.style.display == "none")
+                    video.style.display = "inline-block";
+                else
+                    video.style.display = "none";
+                
+            }
+            function test()
+            {
+                if (window.layoutTestController)
+                    layoutTestController.waitUntilDone();
+                document.getElementById('vid').addEventListener("load", test2);    
+            }
+            function test2()
+            {
+                toggleDisplay();
+                toggleDisplay();
+
+                if (window.layoutTestController)
+                    layoutTestController.notifyDone(); 
+            }
+        </script>
+    </head>
+    <body onload="test()">
+        This tests that toggling the display property won't make the controls disappear.<br>
+        <video id="vid" controls src="content/test.mp4"></video>
+    </body>
+</html>
+