[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 139499] [test case] XMLHttpRequest.abort() does not change
From: Germain Garand <germain () ebooksfrance ! com>
Date: 2007-01-31 7:45:24
Message-ID: 20070131074524.350.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=139499
germain ebooksfrance com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From germain ebooksfrance com 2007-01-31 08:45 -------
SVN commit 628747 by ggarand:
XMLHttpRequest. Some compliance fixes
BUG: 139499
M +15 -19 xmlhttprequest.cpp
M +5 -5 xmlhttprequest.h
--- trunk/KDE/kdelibs/khtml/ecma/xmlhttprequest.cpp #628746:628747
@ -144,7 +144,7 @
case ResponseText:
return ::getStringOrNull(DOM::DOMString(response));
case ResponseXML:
- if (state != Completed) {
+ if (state != XHRS_Loaded) {
return Undefined();
}
if (!createdDocument) {
@ -159,6 +159,7 @
responseXML = doc->implementation()->createDocument();
responseXML->open();
+ responseXML->setURL(url.url());
responseXML->write(response);
responseXML->finishParsing();
responseXML->close();
@ -171,7 +172,7 @
}
if (!typeIsXML) {
- return Undefined();
+ return Null();
}
return getDOMNode(exec,responseXML.get());
@ -226,10 +227,11 @
async(true),
contentType(QString()),
job(0),
- state(Uninitialized),
+ state(XHRS_Uninitialized),
onReadyStateChangeListener(0),
onLoadListener(0),
decoder(0),
+ response(QString::fromLatin1("")),
createdDocument(false),
aborted(false)
{
@ -260,7 +262,7 @
onReadyStateChangeListener->handleEvent(ev);
}
- if (state == Completed && onLoadListener != 0 && doc->view() && doc->view()->part()) {
+ if (state == XHRS_Loaded && onLoadListener != 0 && doc->view() && doc->view()->part()) {
DOM::Event ev = doc->view()->part()->document().createEvent("HTMLEvents");
ev.initEvent("load", true, true);
onLoadListener->handleEvent(ev);
@ -299,26 +301,19 @
// clear stuff from possible previous load
requestHeaders.clear();
responseHeaders.clear();
- response.clear();
+ response = QString::fromLatin1("");
createdDocument = false;
responseXML = 0;
- changeState(Uninitialized);
-
- if (aborted) {
- return;
- }
-
if (!urlMatchesDocumentDomain(_url)) {
return;
}
-
method = _method.toLower();
url = _url;
async = _async;
- changeState(Loading);
+ changeState(XHRS_Open);
}
void XMLHttpRequest::send(const QString& _body)
@ -423,6 +418,7 @
delete decoder;
decoder = 0;
aborted = true;
+ changeState(XHRS_Uninitialized);
}
void XMLHttpRequest::setRequestHeader(const QString& _name, const QString &value)
@ -557,7 +553,7 @
}
responseHeaders = headers;
- changeState(Loaded);
+ changeState(XHRS_Sent);
if (aborted) {
return;
}
@ -587,7 +583,7 @
// make sure to forget about the job before emitting completed,
// since changeState triggers JS code, which might e.g. call abort.
job = 0;
- changeState(Completed);
+ changeState(XHRS_Loaded);
delete decoder;
decoder = 0;
@ -606,7 +602,7 @
void XMLHttpRequest::slotData(KIO::Job*, const QByteArray &_data)
#endif
{
- if (state < Loaded ) {
+ if (state < XHRS_Sent ) {
responseHeaders = job->queryMetaData("HTTP-Headers");
// NOTE: Replace a 304 response with a 200! Both IE and Mozilla do this.
@ -618,7 +614,7 @
responseHeaders.replace(codeStart, (codeEnd-codeStart), "200 OK");
}
- changeState(Loaded);
+ changeState(XHRS_Sent);
}
#ifndef APPLE_CHANGES
@ -656,7 +652,7 @
response += decoded;
if (!aborted) {
- changeState(Interactive);
+ changeState(XHRS_Receiving);
}
}
@ -718,7 +714,7 @
return Undefined();
}
- if (request->state != Loading) {
+ if (request->state != XHRS_Open) {
return Undefined();
}
--- trunk/KDE/kdelibs/khtml/ecma/xmlhttprequest.h #628746:628747
@ -34,11 +34,11 @
// these exact numeric values are important because JS expects them
enum XMLHttpRequestState {
- Uninitialized = 0,
- Loading = 1,
- Loaded = 2,
- Interactive = 3,
- Completed = 4
+ XHRS_Uninitialized = 0,
+ XHRS_Open = 1,
+ XHRS_Sent = 2,
+ XHRS_Receiving = 3,
+ XHRS_Loaded = 4
};
class XMLHttpRequestConstructorImp : public ObjectImp {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic