[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
aroben at apple.com
aroben at apple.com
Wed Jan 20 22:24:49 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 821fe4927e59cd915ad1df48ab204dee15b2b7ae
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 14 23:05:38 2010 +0000
2010-01-14 Adam Roben <aroben at apple.com>
Add a test that shows onload still fires if a load of a <script src>
is cancelled by the resource load delegate
Tests for <http://webkit.org/b/33687> window.onload never fires if
page contains a <script src=foo> whose load is cancelled by resource
load delegate returning null from willSendRequest
Reviewed by Dave Hyatt.
* fast/loader/onload-willSendRequest-null-for-script-expected.txt: Added.
* fast/loader/onload-willSendRequest-null-for-script.html: Added.
* platform/qt/Skipped: Added the new test since Qt doesn't have
layoutTestController.setWillSendRequestReturnsNull.
2010-01-14 Adam Roben <aroben at apple.com>
Make Cache::requestResource return 0 if the resource's load fails
immediately
Fixes <http://webkit.org/b/33687> window.onload never fires if page
contains a <script src=foo> whose load is cancelled by resource load
delegate returning null from willSendRequest
Test: fast/loader/onload-willSendRequest-null-for-script.html
Reviewed by Dave Hyatt.
* loader/Cache.cpp:
(WebCore::Cache::requestResource): Moved code to handle immediate load
failure out of the "cache is disabled" block so that it will run even
when the cache is enabled.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9168bd0..2cdfab8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-14 Adam Roben <aroben at apple.com>
+
+ Add a test that shows onload still fires if a load of a <script src>
+ is cancelled by the resource load delegate
+
+ Tests for <http://webkit.org/b/33687> window.onload never fires if
+ page contains a <script src=foo> whose load is cancelled by resource
+ load delegate returning null from willSendRequest
+
+ Reviewed by Dave Hyatt.
+
+ * fast/loader/onload-willSendRequest-null-for-script-expected.txt: Added.
+ * fast/loader/onload-willSendRequest-null-for-script.html: Added.
+
+ * platform/qt/Skipped: Added the new test since Qt doesn't have
+ layoutTestController.setWillSendRequestReturnsNull.
+
2010-01-14 Stephen White <senorblanco at chromium.org>
Reviewed by mitz at webkit.org.
diff --git a/LayoutTests/fast/loader/onload-willSendRequest-null-for-script-expected.txt b/LayoutTests/fast/loader/onload-willSendRequest-null-for-script-expected.txt
new file mode 100644
index 0000000..cfbef37
--- /dev/null
+++ b/LayoutTests/fast/loader/onload-willSendRequest-null-for-script-expected.txt
@@ -0,0 +1,3 @@
+Test for Bug 33687: window.onload never fires if page contains a <script src=foo> whose load is cancelled by resource load delegate returning null from willSendRequest. If the test passes, you should see the word "PASSED" below.
+
+PASSED
diff --git a/LayoutTests/fast/loader/onload-willSendRequest-null-for-script.html b/LayoutTests/fast/loader/onload-willSendRequest-null-for-script.html
new file mode 100644
index 0000000..f30267f
--- /dev/null
+++ b/LayoutTests/fast/loader/onload-willSendRequest-null-for-script.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test for Bug 33687: window.onload never fires if page contains a <script src=foo>
+ whose load is cancelled by resource load delegate returning null from willSendRequest</title>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.setWillSendRequestReturnsNull(true);
+ }
+
+ window.onload = function() {
+ var result = document.getElementById("result");
+ if (!window.layoutTestController) {
+ result.innerText = "This test can only be run in DumpRenderTree.";
+ return;
+ }
+ result.innerText = "PASSED";
+ };
+ </script>
+ <script src="http://www.example.com/"></script>
+</head>
+<body>
+ <p>Test for <a href="http://webkit.org/b/33687">Bug 33687: window.onload never fires if page
+ contains a <script src=foo> whose load is cancelled by resource load delegate returning null
+ from willSendRequest</a>. If the test passes, you should see the word "PASSED" below.</p>
+ <div id=result>FAILED</div>
+</body>
+</html>
+
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index e30a643..29328a6 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -197,6 +197,7 @@ http/tests/security/feed-urls-from-remote.html
# Missing layoutTestController.setWillSendRequestReturnsNull()
fast/loader/onload-willSendRequest-null-for-frame.html
+fast/loader/onload-willSendRequest-null-for-script.html
# Missing layoutTestController.setWillSendRequestReturnsNullOnRedirect()
http/tests/misc/will-send-request-returns-null-on-redirect.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f6d8c06..f951af7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-01-14 Adam Roben <aroben at apple.com>
+
+ Make Cache::requestResource return 0 if the resource's load fails
+ immediately
+
+ Fixes <http://webkit.org/b/33687> window.onload never fires if page
+ contains a <script src=foo> whose load is cancelled by resource load
+ delegate returning null from willSendRequest
+
+ Test: fast/loader/onload-willSendRequest-null-for-script.html
+
+ Reviewed by Dave Hyatt.
+
+ * loader/Cache.cpp:
+ (WebCore::Cache::requestResource): Moved code to handle immediate load
+ failure out of the "cache is disabled" block so that it will run even
+ when the cache is enabled.
+
2010-01-14 Stephen White <senorblanco at chromium.org>
Reviewed by mitz at webkit.org.
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 0b976b8..473bfba 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -124,19 +124,21 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ
resource->load(docLoader);
+ if (resource->errorOccurred()) {
+ // We don't support immediate loads, but we do support immediate failure.
+ // In that case we should to delete the resource now and return 0 because otherwise
+ // it would leak if no ref/deref was ever done on it.
+ resource->setInCache(false);
+ delete resource;
+ return 0;
+ }
+
if (!disabled())
m_resources.set(url.string(), resource); // The size will be added in later once the resource is loaded and calls back to us with the new size.
else {
// Kick the resource out of the cache, because the cache is disabled.
resource->setInCache(false);
resource->setDocLoader(docLoader);
- if (resource->errorOccurred()) {
- // We don't support immediate loads, but we do support immediate failure.
- // In that case we should to delete the resource now and return 0 because otherwise
- // it would leak if no ref/deref was ever done on it.
- delete resource;
- return 0;
- }
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list