LayoutTests:
authortomernic <tomernic@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Apr 2006 00:57:29 +0000 (00:57 +0000)
committertomernic <tomernic@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Apr 2006 00:57:29 +0000 (00:57 +0000)
        Reviewed by Hyatt.

        Test case for <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when
        CSS Display Style is Toggled via Javascript

        * plugins/inner-html-display-none.html: Added.
        * plugins/inner-html-display-none-expected.txt: Added.

WebCore:

        Reviewed by Hyatt.

        <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
        Style is Toggled via Javascript

        * html/html_objectimpl.cpp:
        (WebCore::HTMLObjectElement::setComplete):
        Set needWidgetUpdate when finished parsing, even if the object element is not in
        a document.  That way, when the element attaches to a document, it will update its
        widget (creating the plug-in view if necessary).  This is important when the object
        is being inserted via setInnerHTML, since the parsed nodes are not added to the
        document until the whole HTML string is parsed.

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

LayoutTests/ChangeLog
LayoutTests/plugins/inner-html-display-none-expected.txt [new file with mode: 0644]
LayoutTests/plugins/inner-html-display-none.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/html_objectimpl.cpp

index 7da0e2c1b24f1b5633da9e12f19be325c2ef5a7d..75ed029ce75a648572ea4aea20fb464adcc6b7ab 100644 (file)
@@ -1,3 +1,13 @@
+2006-04-25  Tim Omernick  <timo@apple.com>
+
+        Reviewed by Hyatt.
+        
+        Test case for <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when
+        CSS Display Style is Toggled via Javascript
+
+        * plugins/inner-html-display-none.html: Added.
+        * plugins/inner-html-display-none-expected.txt: Added.
+
 2006-04-26  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by hyatt
diff --git a/LayoutTests/plugins/inner-html-display-none-expected.txt b/LayoutTests/plugins/inner-html-display-none-expected.txt
new file mode 100644 (file)
index 0000000..ef1c2d3
--- /dev/null
@@ -0,0 +1,6 @@
+ALERT: 
+function testCallback() {
+    [native code]
+}
+
+
diff --git a/LayoutTests/plugins/inner-html-display-none.html b/LayoutTests/plugins/inner-html-display-none.html
new file mode 100644 (file)
index 0000000..908407a
--- /dev/null
@@ -0,0 +1,29 @@
+<html>
+<head>
+<script>
+   if (window.layoutTestController) {
+      layoutTestController.dumpAsText();
+      layoutTestController.waitUntilDone();
+   }
+
+   function printResults()
+   {
+      alert(document.getElementById("plugin").testCallback);
+
+      if (window.layoutTestController)
+          layoutTestController.notifyDone();
+   }
+
+   function setPlugin()
+   {
+      var pluginDiv = document.getElementById("pluginDiv");
+      pluginDiv.style.display = 'inline';
+      pluginDiv.innerHTML = '<object id="plugin" width="300" height="300" type="application/x-webkit-test-netscape"/>';
+      setTimeout("printResults()", 1);
+   }
+</script>
+</head>
+<body onload="setPlugin();">
+   <div id="pluginDiv" style="display: none;"></div>
+</body>
+</html>
index e0d2593bc3890967ea5cbff38c873a7eea3fd317..95a1c5aa0db6dc115958bdffab56448bf42817ab 100644 (file)
@@ -1,3 +1,18 @@
+2006-04-26  Tim Omernick  <timo@apple.com>
+
+        Reviewed by Hyatt.
+
+        <rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
+        Style is Toggled via Javascript
+
+        * html/html_objectimpl.cpp:
+        (WebCore::HTMLObjectElement::setComplete):
+        Set needWidgetUpdate when finished parsing, even if the object element is not in
+        a document.  That way, when the element attaches to a document, it will update its
+        widget (creating the plug-in view if necessary).  This is important when the object
+        is being inserted via setInnerHTML, since the parsed nodes are not added to the
+        document until the whole HTML string is parsed.
+
 2006-04-26  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Hyatt.
index c147fddf4ce50e61510b387cc3b8f5008e8b105c..1881824a89fef1e8aef0ccdc3afc62fb4f153746 100644 (file)
@@ -710,9 +710,10 @@ void HTMLObjectElement::setComplete(bool complete)
 {
     if (complete != m_complete) {
         m_complete = complete;
-        if (complete && inDocument() && !m_useFallbackContent) {
+        if (complete && !m_useFallbackContent) {
             needWidgetUpdate = true;
-            setChanged();
+            if (inDocument())
+                setChanged();
         }
     }
 }