WebCore:
authordglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Feb 2009 21:07:00 +0000 (21:07 +0000)
committerdglazkov@chromium.org <dglazkov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Feb 2009 21:07:00 +0000 (21:07 +0000)
2009-02-09  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Dave Hyatt.

        https://bugs.webkit.org/show_bug.cgi?id=23806
        Fix a regression crash where an empty src value and a "text/html" type
        on an EMBED element did not finish ResourceRequest initialization due to
        an early return.

        Test: fast/loader/empty-embed-src-attribute.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::addExtraFieldsToRequest):

LayoutTests:

2009-02-09  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Dave Hyatt.

        https://bugs.webkit.org/show_bug.cgi?id=23806
        New test for the crash with an embed element with an empty src and
        "text/html" type.

        * fast/loader/empty-embed-src-attribute-expected.txt: Added.
        * fast/loader/empty-embed-src-attribute.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/loader/empty-embed-src-attribute-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/empty-embed-src-attribute.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp

index 7a000266fd8a69a27724d16eb5f12a651135ffb4..e53661174e17f85625b767aac749511cd74ddff5 100644 (file)
@@ -1,3 +1,14 @@
+2009-02-09  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23806
+        New test for the crash with an embed element with an empty src and
+        "text/html" type.
+
+        * fast/loader/empty-embed-src-attribute-expected.txt: Added.
+        * fast/loader/empty-embed-src-attribute.html: Added.
+
 2009-02-09  Alexey Proskuryakov  <ap@webkit.org>
 
         Land results for a recently added test (https://bugs.webkit.org/show_bug.cgi?id=23601).
diff --git a/LayoutTests/fast/loader/empty-embed-src-attribute-expected.txt b/LayoutTests/fast/loader/empty-embed-src-attribute-expected.txt
new file mode 100644 (file)
index 0000000..f62d561
--- /dev/null
@@ -0,0 +1,7 @@
+Tests for crash, caused by an EMBED element with an empty src and a text/html type specified
+
+See bug 23806 for details.
+
+If there is no CRASH, the test passed.
+
+
diff --git a/LayoutTests/fast/loader/empty-embed-src-attribute.html b/LayoutTests/fast/loader/empty-embed-src-attribute.html
new file mode 100644 (file)
index 0000000..94e8fca
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+    <head>
+        <script>
+            if (window.layoutTestController)
+                layoutTestController.dumpAsText();
+        </script>
+    </head>
+    <body>
+        <p>Tests for crash, caused by an <kbd>EMBED</kbd> element with an empty src and a <kbd>text/html</kbd> type specified</p>
+        <p>See bug <a href="https://bugs.webkit.org/show_bug.cgi?id=23806">23806</a> for details.</p>
+        <p>If there is no CRASH, the test passed.</p>
+        <embed type="text/html; charset=utf-8">
+    </body>
+</html>
\ No newline at end of file
index e3e2490bcc3f41dc76cf7db715bf3c675edc67a2..937e314311f9bb050e0337d637a3f9055f53513b 100644 (file)
@@ -1,3 +1,17 @@
+2009-02-09  Dimitri Glazkov  <dglazkov@chromium.org>
+
+        Reviewed by Dave Hyatt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=23806
+        Fix a regression crash where an empty src value and a "text/html" type
+        on an EMBED element did not finish ResourceRequest initialization due to
+        an early return.
+
+        Test: fast/loader/empty-embed-src-attribute.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+
 2009-02-09  Rob Buis  <rwlbuis@gmail.com>
 
         Reviewed by Eric Seidel.
index 71238945ec6a0845c5bf05d0d549149e20bf734f..8f85f8d3b55d1f6c7741bcbde5fd9aaa2536810b 100644 (file)
@@ -3564,7 +3564,7 @@ void FrameLoader::addExtraFieldsToMainResourceRequest(ResourceRequest& request)
 void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadType loadType, bool mainResource, bool cookiePolicyURLFromRequest)
 {
     // These modifications are only necessary for HTTP and HTTPS.
-    if (!request.url().protocolInHTTPFamily())
+    if (!request.url().isEmpty() && !request.url().protocolInHTTPFamily())
         return;
 
     applyUserAgent(request);