WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jul 2006 09:04:43 +0000 (09:04 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jul 2006 09:04:43 +0000 (09:04 +0000)
2006-07-15  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Darin.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
        <rdar://problem/4631561>
        REGRESSION: Repro crash from mangleme using iframe, only from server.

        * html/HTMLIFrameElement.cpp:
        (WebCore::HTMLIFrameElement::attach):
        Add null check for contentFrame() since content frames won't be created for invalid URLs.

LayoutTests:

2006-07-15  Anders Carlsson  <acarlsson@apple.com>

        Reviewed by Darin.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
        <rdar://problem/4631561>
        REGRESSION: Repro crash from mangleme using iframe, only from server.

        * http/tests/misc/iframe-invalid-source-crash-expected.txt: Added.
        * http/tests/misc/iframe-invalid-source-crash.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/http/tests/misc/iframe-invalid-source-crash-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/iframe-invalid-source-crash.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLIFrameElement.cpp

index 68c57cdb9f26408086a38c6066d03361524fcd11..a97348efc9e1f97763e94105918808416eb5326f 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-15  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Darin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
+        <rdar://problem/4631561>
+        REGRESSION: Repro crash from mangleme using iframe, only from server.
+
+        * http/tests/misc/iframe-invalid-source-crash-expected.txt: Added.
+        * http/tests/misc/iframe-invalid-source-crash.html: Added.
+
 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Darin.
diff --git a/LayoutTests/http/tests/misc/iframe-invalid-source-crash-expected.txt b/LayoutTests/http/tests/misc/iframe-invalid-source-crash-expected.txt
new file mode 100644 (file)
index 0000000..41a9fa0
--- /dev/null
@@ -0,0 +1,3 @@
+ This tests that we don't crash if an iframe has an invalid source.
+SUCCESS - didn't crash
+
diff --git a/LayoutTests/http/tests/misc/iframe-invalid-source-crash.html b/LayoutTests/http/tests/misc/iframe-invalid-source-crash.html
new file mode 100644 (file)
index 0000000..c81bddf
--- /dev/null
@@ -0,0 +1,13 @@
+<html>
+<head>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+    </script>
+</head>
+    <body>
+        <iframe src="file:"></iframe>
+        This tests that we don't crash if an iframe has an invalid source. 
+        <div>SUCCESS - didn't crash</div>
+    </body>
+</html>
index 33a5a412d5a80097ef1dabca58178d5dd9ab6e34..358b3c1153b4bae186ec2a98e98df978937847c7 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-15  Anders Carlsson  <acarlsson@apple.com>
+
+        Reviewed by Darin.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
+        <rdar://problem/4631561>
+        REGRESSION: Repro crash from mangleme using iframe, only from server.
+        
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::HTMLIFrameElement::attach):
+        Add null check for contentFrame() since content frames won't be created for invalid URLs.        
+
 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Darin.
index 31006359718ab89054e9b8b1348630ca859a490d..8c57c6d654d89f3fcf5b3cb82f844cb4b35a0556 100644 (file)
@@ -150,10 +150,12 @@ void HTMLIFrameElement::attach()
     if (renderPart) {        
         if (!contentFrame())
             openURL();
-        
-        renderPart->setWidget(contentFrame()->view());
-        renderPart->updateWidget();
-        needWidgetUpdate = false;
+
+        if (contentFrame()) {
+            renderPart->setWidget(contentFrame()->view());
+            renderPart->updateWidget();
+            needWidgetUpdate = false;
+        }
     }
 }