WebCore:
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jun 2008 21:46:17 +0000 (21:46 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jun 2008 21:46:17 +0000 (21:46 +0000)
2008-06-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by David Hyatt and Mitz.

        <rdar://problem/5704119>
        repro crash in WebCore::RenderPart::setWidget (plugin-related?)

        Test: platform/mac/plugins/update-widget-from-style-recalc.html

        Make sure to update the document's rendering before calling updateWidget.

        * html/HTMLEmbedElement.cpp:
        (WebCore::HTMLEmbedElement::updateWidget):
        * html/HTMLObjectElement.cpp:
        (WebCore::HTMLObjectElement::updateWidget):

WebKitTools:

2008-06-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by David Hyatt and Mitz.

        <rdar://problem/5704119>
        repro crash in WebCore::RenderPart::setWidget (plugin-related?)

        Call -[WebView display] in the "plug-in" failed delegate method, simulating
        the sheet that Safari puts up.

        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
        (-[ResourceLoadDelegate webView:plugInFailedWithError:dataSource:]):

LayoutTests:

2008-06-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by David Hyatt and Mitz.

        <rdar://problem/5704119>
        repro crash in WebCore::RenderPart::setWidget (plugin-related?)

        * platform/mac/plugins/update-widget-from-style-recalc-expected.txt: Added.
        * platform/mac/plugins/update-widget-from-style-recalc.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/plugins/update-widget-from-style-recalc-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/plugins/update-widget-from-style-recalc.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLEmbedElement.cpp
WebCore/html/HTMLObjectElement.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm

index cf043af..8330fe9 100644 (file)
@@ -1,3 +1,13 @@
+2008-06-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt and Mitz.
+
+        <rdar://problem/5704119>
+        repro crash in WebCore::RenderPart::setWidget (plugin-related?)
+        
+        * platform/mac/plugins/update-widget-from-style-recalc-expected.txt: Added.
+        * platform/mac/plugins/update-widget-from-style-recalc.html: Added.
+
 2008-06-02  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/platform/mac/plugins/update-widget-from-style-recalc-expected.txt b/LayoutTests/platform/mac/plugins/update-widget-from-style-recalc-expected.txt
new file mode 100644 (file)
index 0000000..be91589
--- /dev/null
@@ -0,0 +1,3 @@
+This tests that we don’t crash when forcing a style recalc when inside RenderPartObject::updateWidget.
+
+SUCCESS - Did not crash!
diff --git a/LayoutTests/platform/mac/plugins/update-widget-from-style-recalc.html b/LayoutTests/platform/mac/plugins/update-widget-from-style-recalc.html
new file mode 100644 (file)
index 0000000..b46641b
--- /dev/null
@@ -0,0 +1,22 @@
+<div id="target1"></div>
+<div id="target2"></div>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+    
+    var target1 = document.getElementById("target1");
+    target1.offsetTop;
+    target1.style.display = "none";
+    var embed = document.createElement("embed");
+    embed.setAttribute("type", "x-webkit/x-webkit-unknown");
+    target1.appendChild(embed);    
+
+    var target2 = document.getElementById("target2");
+    target2.offsetTop;
+    target2.style.display = "none";
+    var object = document.createElement("object");
+    object.setAttribute("type", "x-webkit/x-webkit-unknown");
+    target2.appendChild(embed);        
+</script>
+<p>This tests that we don&rsquo;t crash when forcing a style recalc when inside RenderPartObject::updateWidget.</p >
+<p>SUCCESS - Did not crash!</p>
index c082cc3..af0e106 100644 (file)
@@ -1,3 +1,19 @@
+2008-06-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt and Mitz.
+
+        <rdar://problem/5704119> 
+        repro crash in WebCore::RenderPart::setWidget (plugin-related?)
+        
+        Test: platform/mac/plugins/update-widget-from-style-recalc.html
+
+        Make sure to update the document's rendering before calling updateWidget.
+        
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::updateWidget):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::updateWidget):
+
 2008-06-02  Kevin McCullough  <kmccullough@apple.com>
 
         Reviewed by Adam.
index b22f462..84a3a2c 100644 (file)
@@ -167,6 +167,7 @@ void HTMLEmbedElement::detach()
 
 void HTMLEmbedElement::updateWidget()
 {
+    document()->updateRendering();
     if (m_needWidgetUpdate && renderer())
         static_cast<RenderPartObject*>(renderer())->updateWidget(true);
 }
index 70a7520..225126d 100644 (file)
@@ -186,6 +186,7 @@ void HTMLObjectElement::attach()
 
 void HTMLObjectElement::updateWidget()
 {
+    document()->updateRendering();
     if (m_needWidgetUpdate && renderer() && !m_useFallbackContent && !isImageType())
         static_cast<RenderPartObject*>(renderer())->updateWidget(true);
 }
index eaa8d17..b65738f 100644 (file)
@@ -1,3 +1,16 @@
+2008-06-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by David Hyatt and Mitz.
+
+        <rdar://problem/5704119> 
+        repro crash in WebCore::RenderPart::setWidget (plugin-related?)
+        
+        Call -[WebView display] in the "plug-in" failed delegate method, simulating
+        the sheet that Safari puts up.
+        
+        * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+        (-[ResourceLoadDelegate webView:plugInFailedWithError:dataSource:]):
+
 2008-05-30  Timothy Hatcher  <timothy@apple.com>
 
         Made the starting line number of scripts be 1-based throughout the engine.
index d15a9bd..89b8a61 100644 (file)
 
 - (void)webView: (WebView *)wv plugInFailedWithError:(NSError *)error dataSource:(WebDataSource *)dataSource
 {
+    // The call to -display here simulates the "Plug-in not found" sheet that Safari shows.
+    // It is used for platform/mac/plugins/update-widget-from-style-recalc.html
+    [wv display];
 }
 
 -(NSCachedURLResponse *) webView: (WebView *)wv resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource