[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
weinig at apple.com
weinig at apple.com
Thu Oct 29 20:32:15 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 4704ab46eb14cf3ff35e71cca1a9b0b2370a1d47
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 22 23:49:13 2009 +0000
WebCore: Fix for XMLHttpRequest.abort() should destroy the response text.
https://bugs.webkit.org/show_bug.cgi?id=29658
<rdar://problem/5301430>
Reviewed by Alexey Proskuryakov.
Clearing the response text after calling XMLHttpRequest.abort() is necessary
per spec and matches Firefox. It is also a potential memory win.
Test: http/tests/xmlhttprequest/abort-should-destroy-responseText.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::abort): Clear the response text making sure to
keep the actual ResourceReponse around so that the response status and response
status text are kept around.
LayoutTests: Test for XMLHttpRequest.abort() should destroy the response text.
https://bugs.webkit.org/show_bug.cgi?id=29658
<rdar://problem/5301430>
Reviewed by Alexey Proskuryakov.
* http/tests/xmlhttprequest/abort-should-destroy-responseText-expected.txt: Added.
* http/tests/xmlhttprequest/abort-should-destroy-responseText.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3c91844..b98e1ce 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-09-22 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Test for XMLHttpRequest.abort() should destroy the response text.
+ https://bugs.webkit.org/show_bug.cgi?id=29658
+ <rdar://problem/5301430>
+
+ * http/tests/xmlhttprequest/abort-should-destroy-responseText-expected.txt: Added.
+ * http/tests/xmlhttprequest/abort-should-destroy-responseText.html: Added.
+
2009-09-22 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Eric Seidel.
diff --git a/LayoutTests/http/tests/xmlhttprequest/abort-should-destroy-responseText-expected.txt b/LayoutTests/http/tests/xmlhttprequest/abort-should-destroy-responseText-expected.txt
new file mode 100644
index 0000000..1eab7d7
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/abort-should-destroy-responseText-expected.txt
@@ -0,0 +1,4 @@
+This tests that calling XMLHttpRequest.abort() removes the responseText for the XMLHttpRequest.
+
+PASS: abort() cleared the response text.
+
diff --git a/LayoutTests/http/tests/xmlhttprequest/abort-should-destroy-responseText.html b/LayoutTests/http/tests/xmlhttprequest/abort-should-destroy-responseText.html
new file mode 100644
index 0000000..feb44a0
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/abort-should-destroy-responseText.html
@@ -0,0 +1,20 @@
+<p>This tests that calling XMLHttpRequest.abort() removes the responseText for the XMLHttpRequest.</p>
+<pre id="console"></pre>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function log(msg)
+ {
+ document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
+ }
+
+ req = new XMLHttpRequest();
+ req.open("GET", "get.txt", false);
+ req.send();
+ req.abort();
+ if (!req.responseText.length)
+ log("PASS: abort() cleared the response text.");
+ else
+ log("FAIL: abort() did not clear the response text.");
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5194e59..dc405c1 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2009-09-22 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix for XMLHttpRequest.abort() should destroy the response text.
+ https://bugs.webkit.org/show_bug.cgi?id=29658
+ <rdar://problem/5301430>
+
+ Clearing the response text after calling XMLHttpRequest.abort() is necessary
+ per spec and matches Firefox. It is also a potential memory win.
+
+ Test: http/tests/xmlhttprequest/abort-should-destroy-responseText.html
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::abort): Clear the response text making sure to
+ keep the actual ResourceReponse around so that the response status and response
+ status text are kept around.
+
2009-09-22 Dimitri Glazkov <dglazkov at chromium.org>
No review, rolling out r48639.
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index e8df36d..ddff331 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -556,6 +556,10 @@ void XMLHttpRequest::abort()
internalAbort();
+ m_responseText = "";
+ m_createdDocument = false;
+ m_responseXML = 0;
+
// Clear headers as required by the spec
m_requestHeaders.clear();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list