[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:13:29 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 76ef0ac278c793af652fa93e77a59f11c6f07506
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 18 08:52:21 2003 +0000

            Reviewed by Dave.
    
    	- fixed 3486991 - Add XMLHttpRequest object and stub methods
    
            * khtml/ecma/kjs_window.cpp:
            (Window::get): Handle XMLHttpRequest constructor like Option and Image.
            * khtml/ecma/kjs_window.h: Ditto.
            * khtml/ecma/kjs_window.lut.h: Regenerated.
            * khtml/ecma/xmlhttprequest.cpp: Added. Stub implementations of everything.
            (KJS::XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp):
            (KJS::XMLHttpRequestConstructorImp::implementsConstruct):
            (KJS::XMLHttpRequestConstructorImp::construct):
            (KJS::XMLHttpRequest::tryGet):
            (KJS::XMLHttpRequest::getValueProperty):
            (KJS::XMLHttpRequest::tryPut):
            (KJS::XMLHttpRequest::putValue):
            (KJS::XMLHttpRequest::notifyFinished):
            (KJS::XMLHttpRequest::XMLHttpRequest):
            (KJS::XMLHttpRequest::~XMLHttpRequest):
            (KJS::XMLHttpRequestProtoFunc::tryCall):
            * khtml/ecma/xmlhttprequest.h: Added. Stub implementations of everything.
            (KJS::XMLHttpRequest::toBoolean):
            (KJS::XMLHttpRequest::classInfo):
            * khtml/ecma/xmlhttprequest.lut.h: Added.
            * khtml/ecma/Makefile.am: Add new .lut.h file.
    	* WebCore.pbproj/project.pbxproj: Add new files.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 50f7120..b351397 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2003-11-17  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed 3486991 - Add XMLHttpRequest object and stub methods
+
+        * khtml/ecma/kjs_window.cpp:
+        (Window::get): Handle XMLHttpRequest constructor like Option and Image.
+        * khtml/ecma/kjs_window.h: Ditto.
+        * khtml/ecma/kjs_window.lut.h: Regenerated.
+        * khtml/ecma/xmlhttprequest.cpp: Added. Stub implementations of everything.
+        (KJS::XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp):
+        (KJS::XMLHttpRequestConstructorImp::implementsConstruct):
+        (KJS::XMLHttpRequestConstructorImp::construct):
+        (KJS::XMLHttpRequest::tryGet):
+        (KJS::XMLHttpRequest::getValueProperty):
+        (KJS::XMLHttpRequest::tryPut):
+        (KJS::XMLHttpRequest::putValue):
+        (KJS::XMLHttpRequest::notifyFinished):
+        (KJS::XMLHttpRequest::XMLHttpRequest):
+        (KJS::XMLHttpRequest::~XMLHttpRequest):
+        (KJS::XMLHttpRequestProtoFunc::tryCall):
+        * khtml/ecma/xmlhttprequest.h: Added. Stub implementations of everything.
+        (KJS::XMLHttpRequest::toBoolean):
+        (KJS::XMLHttpRequest::classInfo):
+        * khtml/ecma/xmlhttprequest.lut.h: Added.
+        * khtml/ecma/Makefile.am: Add new .lut.h file.
+	* WebCore.pbproj/project.pbxproj: Add new files.
+
 2003-11-17  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3487136, marquees reset when you return to a page in the b/f cache.  This patch makes
@@ -18,7 +47,7 @@
 
 	Merged from khtml:
 	
-	-fixed 3487324 -  CSS url values should be wrapped in "url()" for cssText purposes
+	- fixed 3487324 - CSS url values should be wrapped in "url()" for cssText purposes
 	
     2003-11-07  Dirk Mueller  <mueller at kde.org>
 	 
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index d4d3739..95a46e0 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -516,6 +516,8 @@
 				55998A60052B59CC0017A6C1,
 				65A640F10533BB1F0085E777,
 				BE26F15505517DE000BFA0C3,
+				654E7EE40569FD4600358BD2,
+				654E7EE50569FD4600358BD2,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -778,6 +780,7 @@
 				65F80698054D9F86008BF776,
 				65732B69054EF483007B42F8,
 				BE26F15605517DE000BFA0C3,
+				654E7EE30569FD4600358BD2,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1017,6 +1020,48 @@
 //652
 //653
 //654
+		654E7EE00569FD4600358BD2 = {
+			expectedFileType = sourcecode.cpp.cpp;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = xmlhttprequest.cpp;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		654E7EE10569FD4600358BD2 = {
+			expectedFileType = sourcecode.c.h;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = xmlhttprequest.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		654E7EE20569FD4600358BD2 = {
+			expectedFileType = sourcecode.c.h;
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = xmlhttprequest.lut.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		654E7EE30569FD4600358BD2 = {
+			fileRef = 654E7EE00569FD4600358BD2;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		654E7EE40569FD4600358BD2 = {
+			fileRef = 654E7EE10569FD4600358BD2;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		654E7EE50569FD4600358BD2 = {
+			fileRef = 654E7EE20569FD4600358BD2;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		65732B68054EF483007B42F8 = {
 			expectedFileType = sourcecode.cpp.objcpp;
 			fileEncoding = 30;
@@ -4064,6 +4109,9 @@
 				F523D21002DE4369018635CA,
 				F523D21102DE4369018635CA,
 				F523D21202DE4369018635CA,
+				654E7EE00569FD4600358BD2,
+				654E7EE10569FD4600358BD2,
+				654E7EE20569FD4600358BD2,
 			);
 			isa = PBXGroup;
 			path = ecma;
diff --git a/WebCore/khtml/ecma/Makefile.am b/WebCore/khtml/ecma/Makefile.am
index 41ae11f..6f00baf 100644
--- a/WebCore/khtml/ecma/Makefile.am
+++ b/WebCore/khtml/ecma/Makefile.am
@@ -10,6 +10,7 @@ LUT_FILES = \
 	kjs_traversal.lut.h \
 	kjs_views.lut.h \
 	kjs_window.lut.h \
+	xmlhttprequest.lut.h \
 	$(NULL)
 
 CREATE_HASH_TABLE = $(top_srcdir)/JavaScriptCore/kjs/create_hash_table
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index 983db16..2464ef2 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -48,6 +48,7 @@
 #include "kjs_traversal.h"
 #include "kjs_css.h"
 #include "kjs_events.h"
+#include "xmlhttprequest.h"
 
 #include "khtmlview.h"
 #include "khtml_part.h"
@@ -227,6 +228,7 @@ const ClassInfo Window::info = { "Window", 0, &WindowTable, 0 };
   screen	Window::_Screen		DontDelete|ReadOnly
   Image		Window::Image		DontDelete|ReadOnly
   Option	Window::Option		DontDelete|ReadOnly
+  XMLHttpRequest	Window::XMLHttpRequest	DontDelete|ReadOnly
   alert		Window::Alert		DontDelete|Function 1
   confirm	Window::Confirm		DontDelete|Function 1
   prompt	Window::Prompt		DontDelete|Function 2
@@ -541,6 +543,8 @@ Value Window::get(ExecState *exec, const Identifier &p) const
       return Value(new ImageConstructorImp(exec, m_part->document()));
     case Option:
       return Value(new OptionConstructorImp(exec, m_part->document()));
+    case XMLHttpRequest:
+      return Value(new XMLHttpRequestConstructorImp(exec, m_part->document()));
     case Alert:
     case Confirm:
     case Prompt:
diff --git a/WebCore/khtml/ecma/kjs_window.h b/WebCore/khtml/ecma/kjs_window.h
index 1bf6077..cfa5104 100644
--- a/WebCore/khtml/ecma/kjs_window.h
+++ b/WebCore/khtml/ecma/kjs_window.h
@@ -120,9 +120,9 @@ namespace KJS {
            ScrollTo, ScrollX, ScrollY, MoveBy, MoveTo, ResizeBy, ResizeTo, Self, _Window, Top, _Screen,
            Image, Option, Alert, Confirm, Prompt, Open, Print, SetTimeout, ClearTimeout,
            Focus, GetSelection, Blur, Close, SetInterval, ClearInterval, CaptureEvents, 
-           ReleaseEvents, AddEventListener, RemoveEventListener, Onabort, Onblur,
-           Onchange, Onclick, Ondblclick, Ondragdrop, Onerror, Onfocus,
-           Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove,
+           ReleaseEvents, AddEventListener, RemoveEventListener, XMLHttpRequest,
+	   Onabort, Onblur, Onchange, Onclick, Ondblclick, Ondragdrop, Onerror, 
+	   Onfocus, Onkeydown, Onkeypress, Onkeyup, Onload, Onmousedown, Onmousemove,
            Onmouseout, Onmouseover, Onmouseup, Onmove, Onreset, Onresize,
            Onselect, Onsubmit, Onunload };
   protected:
diff --git a/WebCore/khtml/ecma/kjs_window.lut.h b/WebCore/khtml/ecma/kjs_window.lut.h
index 957e91d..366630f 100644
--- a/WebCore/khtml/ecma/kjs_window.lut.h
+++ b/WebCore/khtml/ecma/kjs_window.lut.h
@@ -74,7 +74,7 @@ const struct HashEntry WindowTableEntries[] = {
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "onselect", Window::Onselect, DontDelete, 0, 0 },
-   { 0, 0, 0, 0, 0 },
+   { "XMLHttpRequest", Window::XMLHttpRequest, DontDelete|ReadOnly, 0, 0 },
    { "document", Window::Document, DontDelete|ReadOnly, 0, 0 },
    { "onunload", Window::Onunload, DontDelete, 0, 0 },
    { "ondblclick", Window::Ondblclick, DontDelete, 0, &WindowTableEntries[109] },
diff --git a/WebCore/khtml/ecma/xmlhttprequest.cpp b/WebCore/khtml/ecma/xmlhttprequest.cpp
new file mode 100644
index 0000000..4e1128e
--- /dev/null
+++ b/WebCore/khtml/ecma/xmlhttprequest.cpp
@@ -0,0 +1,153 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 2003 Apple Computer, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#import "xmlhttprequest.h"
+#import "xmlhttprequest.lut.h"
+
+#include <kdebug.h>
+
+using namespace KJS;
+
+////////////////////// XMLHttpRequest Object ////////////////////////
+
+/* Source for XMLHttpRequestProtoTable. Use "make hashtables" to regenerate.
+ at begin XMLHttpRequestProtoTable 7
+  abort			XMLHttpRequest::Abort			DontDelete|Function 0
+  getAllResponseHeaders	XMLHttpRequest::GetAllResponseHeaders	DontDelete|Function 0
+  getResponseHeader	XMLHttpRequest::GetResponseHeader	DontDelete|Function 1
+  open			XMLHttpRequest::Open			DontDelete|Function 5
+  send			XMLHttpRequest::Send			DontDelete|Function 1
+  setRequestHeader	XMLHttpRequest::SetRequestHeader	DontDelete|Function 2
+ at end
+*/
+DEFINE_PROTOTYPE("XMLHttpRequest",XMLHttpRequestProto)
+IMPLEMENT_PROTOFUNC(XMLHttpRequestProtoFunc)
+IMPLEMENT_PROTOTYPE(XMLHttpRequestProto,XMLHttpRequestProtoFunc)
+
+namespace KJS {
+
+XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp(ExecState *, const DOM::Document &d)
+    : ObjectImp(), doc(d)
+{
+}
+
+bool XMLHttpRequestConstructorImp::implementsConstruct() const
+{
+  return true;
+}
+
+Object XMLHttpRequestConstructorImp::construct(ExecState *exec, const List &)
+{
+  return Object(new XMLHttpRequest(exec, doc));
+}
+
+const ClassInfo XMLHttpRequest::info = { "XMLHttpRequest", 0, &XMLHttpRequestTable, 0 };
+
+/* Source for XMLHttpRequestTable. Use "make hashtables" to regenerate.
+ at begin XMLHttpRequestTable 6
+  readyState		XMLHttpRequest::ReadyState		DontDelete|ReadOnly
+  responseText		XMLHttpRequest::ResponseText		DontDelete|ReadOnly
+  responseXML		XMLHttpRequest::ResponseXML		DontDelete|ReadOnly
+  status		XMLHttpRequest::Status			DontDelete|ReadOnly
+  statusText		XMLHttpRequest::StatusText		DontDelete|ReadOnly
+  onreadystatechange	XMLHttpRequest::Onreadystatechange	DontDelete
+ at end
+*/
+
+Value XMLHttpRequest::tryGet(ExecState *exec, const Identifier &propertyName) const
+{
+  return DOMObjectLookupGetValue<XMLHttpRequest,DOMObject>(exec, propertyName, &XMLHttpRequestTable, this);
+}
+
+Value XMLHttpRequest::getValueProperty(ExecState *, int token) const
+{
+  switch (token) {
+  case ReadyState:
+    return Undefined();
+  case ResponseText:
+    return Undefined();
+  case ResponseXML:
+    return Undefined();
+  case Status:
+    return Undefined();
+  case StatusText:
+    return Undefined();
+  case Onreadystatechange:
+    return Null();
+  default:
+    kdWarning() << "XMLHttpRequest::getValueProperty unhandled token " << token << endl;
+    return Value();
+  }
+}
+
+void XMLHttpRequest::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+{
+  DOMObjectLookupPut<XMLHttpRequest,DOMObject>(exec, propertyName, value, attr, &XMLHttpRequestTable, this );
+}
+
+void XMLHttpRequest::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+{
+  switch(token) {
+  case Onreadystatechange:
+    break;
+  default:
+    kdWarning() << "HTMLDocument::putValue unhandled token " << token << endl;
+  }
+}
+
+void XMLHttpRequest::notifyFinished(khtml::CachedObject *)
+{
+}
+
+XMLHttpRequest::XMLHttpRequest(ExecState *exec, const DOM::Document &d)
+    : DOMObject(XMLHttpRequestProto::self(exec))
+{
+}
+
+XMLHttpRequest::~XMLHttpRequest()
+{
+}
+
+Value XMLHttpRequestProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+{
+  if (!thisObj.inherits(&XMLHttpRequest::info)) {
+    Object err = Error::create(exec,TypeError);
+    exec->setException(err);
+    return err;
+  }
+  switch (id) {
+  case XMLHttpRequest::Abort:
+    return Undefined();
+  case XMLHttpRequest::GetAllResponseHeaders:
+    return Undefined();
+  case XMLHttpRequest::GetResponseHeader:
+    return Undefined();
+  case XMLHttpRequest::Open:
+    return Undefined();
+  case XMLHttpRequest::Send:
+    return Undefined();
+  case XMLHttpRequest::SetRequestHeader:
+    return Undefined();
+  }
+
+  return Undefined();
+}
+
+}; // end namespace
diff --git a/WebCore/khtml/ecma/xmlhttprequest.h b/WebCore/khtml/ecma/xmlhttprequest.h
new file mode 100644
index 0000000..c7b5094
--- /dev/null
+++ b/WebCore/khtml/ecma/xmlhttprequest.h
@@ -0,0 +1,57 @@
+// -*- c-basic-offset: 2 -*-
+/*
+ *  This file is part of the KDE libraries
+ *  Copyright (C) 2003 Apple Computer, Inc.
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _XMLHTTPREQUEST_H_
+#define _XMLHTTPREQUEST_H_
+
+#include "ecma/kjs_binding.h"
+#include "ecma/kjs_dom.h"
+#include "misc/loader.h"
+
+namespace KJS {
+
+  class XMLHttpRequestConstructorImp : public ObjectImp {
+  public:
+    XMLHttpRequestConstructorImp(ExecState *exec, const DOM::Document &d);
+    virtual bool implementsConstruct() const;
+    virtual Object construct(ExecState *exec, const List &args);
+  private:
+    DOM::Document doc;
+  };
+
+  class XMLHttpRequest : public DOMObject, public khtml::CachedObjectClient {
+  public:
+    XMLHttpRequest(ExecState *, const DOM::Document &d);
+    ~XMLHttpRequest();
+    virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+    Value getValueProperty(ExecState *exec, int token) const;
+    virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+    void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+    void notifyFinished(khtml::CachedObject *);
+    virtual bool toBoolean(ExecState *) const { return true; }
+    virtual const ClassInfo* classInfo() const { return &info; }
+    static const ClassInfo info;
+    enum { Onreadystatechange, ReadyState, ResponseText, ResponseXML, Status, StatusText, Abort, GetAllResponseHeaders, GetResponseHeader, Open, Send, SetRequestHeader };
+  private:
+  };
+
+}; // namespace
+
+#endif
diff --git a/WebCore/khtml/ecma/xmlhttprequest.lut.h b/WebCore/khtml/ecma/xmlhttprequest.lut.h
new file mode 100644
index 0000000..33f5cba
--- /dev/null
+++ b/WebCore/khtml/ecma/xmlhttprequest.lut.h
@@ -0,0 +1,36 @@
+/* Automatically generated from xmlhttprequest.cpp using ../../../JavaScriptCore/kjs/create_hash_table. DO NOT EDIT ! */
+
+namespace KJS {
+
+const struct HashEntry XMLHttpRequestProtoTableEntries[] = {
+   { "open", XMLHttpRequest::Open, DontDelete|Function, 5, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "getResponseHeader", XMLHttpRequest::GetResponseHeader, DontDelete|Function, 1, 0 },
+   { "setRequestHeader", XMLHttpRequest::SetRequestHeader, DontDelete|Function, 2, 0 },
+   { "abort", XMLHttpRequest::Abort, DontDelete|Function, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "getAllResponseHeaders", XMLHttpRequest::GetAllResponseHeaders, DontDelete|Function, 0, &XMLHttpRequestProtoTableEntries[7] },
+   { "send", XMLHttpRequest::Send, DontDelete|Function, 1, 0 }
+};
+
+const struct HashTable XMLHttpRequestProtoTable = { 2, 8, XMLHttpRequestProtoTableEntries, 7 };
+
+} // namespace
+
+namespace KJS {
+
+const struct HashEntry XMLHttpRequestTableEntries[] = {
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "readyState", XMLHttpRequest::ReadyState, DontDelete|ReadOnly, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "responseText", XMLHttpRequest::ResponseText, DontDelete|ReadOnly, 0, &XMLHttpRequestTableEntries[6] },
+   { "statusText", XMLHttpRequest::StatusText, DontDelete|ReadOnly, 0, &XMLHttpRequestTableEntries[8] },
+   { "responseXML", XMLHttpRequest::ResponseXML, DontDelete|ReadOnly, 0, &XMLHttpRequestTableEntries[7] },
+   { "status", XMLHttpRequest::Status, DontDelete|ReadOnly, 0, 0 },
+   { "onreadystatechange", XMLHttpRequest::Onreadystatechange, DontDelete, 0, 0 }
+};
+
+const struct HashTable XMLHttpRequestTable = { 2, 9, XMLHttpRequestTableEntries, 6 };
+
+} // namespace

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list