2006-05-30 Eric Seidel <eric@eseidel.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2006 08:30:38 +0000 (08:30 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2006 08:30:38 +0000 (08:30 +0000)
        Reviewed by andersca.

        Small ammount of bindings-related code cleanup.
        No test case possible.

        * bindings/js/JSHTMLFormElementCustom.cpp:
        (WebCore::JSHTMLFormElement::nameGetter):
        * bindings/js/JSXMLSerializer.cpp:
        (WebCore::JSXMLSerializerConstructorImp::JSXMLSerializerConstructorImp):
        (WebCore::JSXMLSerializerConstructorImp::implementsConstruct):
        (WebCore::JSXMLSerializerConstructorImp::construct):
        (WebCore::):
        (WebCore::JSXMLSerializer::JSXMLSerializer):
        (WebCore::JSXMLSerializerProtoFunc::callAsFunction):
        * bindings/js/JSXMLSerializer.h:
        (WebCore::JSXMLSerializer::toBoolean):
        (WebCore::JSXMLSerializer::classInfo):
        (WebCore::JSXMLSerializer::):
        * bindings/js/kjs_window.cpp:
        (KJS::Window::getValueProperty):

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

WebCore/ChangeLog
WebCore/bindings/js/JSHTMLFormElementCustom.cpp
WebCore/bindings/js/JSXMLSerializer.cpp
WebCore/bindings/js/JSXMLSerializer.h
WebCore/bindings/js/kjs_window.cpp

index d0b77b60c5ac64c82c281f11d6530f81bd503da0..334226f1a8015545847db8c288182d5c35e62600 100644 (file)
@@ -1,3 +1,26 @@
+2006-05-30  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by andersca.
+
+        Small ammount of bindings-related code cleanup.
+        No test case possible.
+
+        * bindings/js/JSHTMLFormElementCustom.cpp:
+        (WebCore::JSHTMLFormElement::nameGetter):
+        * bindings/js/JSXMLSerializer.cpp:
+        (WebCore::JSXMLSerializerConstructorImp::JSXMLSerializerConstructorImp):
+        (WebCore::JSXMLSerializerConstructorImp::implementsConstruct):
+        (WebCore::JSXMLSerializerConstructorImp::construct):
+        (WebCore::):
+        (WebCore::JSXMLSerializer::JSXMLSerializer):
+        (WebCore::JSXMLSerializerProtoFunc::callAsFunction):
+        * bindings/js/JSXMLSerializer.h:
+        (WebCore::JSXMLSerializer::toBoolean):
+        (WebCore::JSXMLSerializer::classInfo):
+        (WebCore::JSXMLSerializer::):
+        * bindings/js/kjs_window.cpp:
+        (KJS::Window::getValueProperty):
+
 2006-05-27  Anders Carlsson  <acarlsson@apple.com>
 
         * bindings/js/JSHTMLElementWrapperFactory.cpp:
index 6d72b693837722a16e7dbf5a3e9c87b6fd38c44c..51df9456070ea24da6dc583beb5f29df0bb19745 100644 (file)
@@ -40,7 +40,7 @@ bool JSHTMLFormElement::canGetItemsForName(ExecState* exec, HTMLFormElement* for
     return !namedItems->isUndefined();
 }
 
-JSValue* JSHTMLFormElement::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
+JSValue* JSHTMLFormElement::nameGetter(ExecState* exec, JSObject*, const Identifier& propertyName, const PropertySlot& slot)
 {
     JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
     HTMLFormElement* form = static_cast<HTMLFormElement*>(thisObj->impl());
index 7fa62473c0fa8756749f2755f237756240041e02..e56aaff9ae5b183016e9db615ba5062b8920f488 100644 (file)
 #include "kjs_dom.h"
 #include "markup.h"
 
-using namespace WebCore;
+using namespace KJS;
 
-namespace KJS {
+namespace WebCore {
 
-////////////////////// XMLSerializer Object ////////////////////////
-
-/* Source for XMLSerializerProtoTable.
-@begin XMLSerializerProtoTable 1
-  serializeToString XMLSerializer::SerializeToString DontDelete|Function 1
+/* Source for JSXMLSerializerProtoTable.
+@begin JSXMLSerializerProtoTable 1
+  serializeToString WebCore::JSXMLSerializer::SerializeToString DontDelete|Function 1
 @end
 */
-KJS_DEFINE_PROTOTYPE(XMLSerializerProto)
-KJS_IMPLEMENT_PROTOFUNC(XMLSerializerProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE("XMLSerializer",XMLSerializerProto,XMLSerializerProtoFunc)
 
-XMLSerializerConstructorImp::XMLSerializerConstructorImp(ExecState *exec)
+KJS_DEFINE_PROTOTYPE(JSXMLSerializerProto)
+KJS_IMPLEMENT_PROTOFUNC(JSXMLSerializerProtoFunc)
+KJS_IMPLEMENT_PROTOTYPE("XMLSerializer", JSXMLSerializerProto, JSXMLSerializerProtoFunc)
+
+JSXMLSerializerConstructorImp::JSXMLSerializerConstructorImp(ExecState* exec)
 {
     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
-    putDirect(prototypePropertyName, XMLSerializerProto::self(exec), None);
+    putDirect(prototypePropertyName, JSXMLSerializerProto::self(exec), None);
 }
 
-bool XMLSerializerConstructorImp::implementsConstruct() const
+bool JSXMLSerializerConstructorImp::implementsConstruct() const
 {
-  return true;
+    return true;
 }
 
-JSObject *XMLSerializerConstructorImp::construct(ExecState *exec, const List &)
+JSObject* JSXMLSerializerConstructorImp::construct(ExecState* exec, const List&)
 {
-  return new XMLSerializer(exec);
+    return new JSXMLSerializer(exec);
 }
 
-const ClassInfo XMLSerializer::info = { "XMLSerializer", 0, &XMLSerializerTable, 0 };
+const ClassInfo JSXMLSerializer::info = { "XMLSerializer", 0, &JSXMLSerializerTable, 0 };
 
-/* Source for XMLSerializerTable.
-@begin XMLSerializerTable 0
+/* Source for JSXMLSerializerTable.
+@begin JSXMLSerializerTable 0
 @end
 */
 
-XMLSerializer::XMLSerializer(ExecState *exec)
+JSXMLSerializer::JSXMLSerializer(ExecState* exec)
 {
-  setPrototype(XMLSerializerProto::self(exec));
+    setPrototype(JSXMLSerializerProto::self(exec));
 }
 
-JSValue *XMLSerializerProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
+JSValue* JSXMLSerializerProtoFunc::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
 {
-  if (!thisObj->inherits(&XMLSerializer::info))
-    return throwError(exec, TypeError);
-
-  switch (id) {
-  case XMLSerializer::SerializeToString:
-    {
-      if (args.size() != 1) {
-        return jsUndefined();
-      }
-
-      if (!args[0]->toObject(exec)->inherits(&DOMNode::info)) {
-        return jsUndefined();
-      }
-
-      WebCore::Node* node = static_cast<WebCore::Node*>(static_cast<DOMNode*>(args[0]->toObject(exec))->impl());
-      return jsStringOrNull(WebCore::createMarkup(node));
+    if (!thisObj->inherits(&JSXMLSerializer::info))
+        return throwError(exec, TypeError);
+
+    if (id == JSXMLSerializer::SerializeToString) {
+        if (args.size() != 1)
+            return jsUndefined();
+
+        if (!args[0]->toObject(exec)->inherits(&DOMNode::info))
+            return jsUndefined();
+
+        Node* node = static_cast<Node*>(static_cast<DOMNode*>(args[0]->toObject(exec))->impl());
+        return jsStringOrNull(createMarkup(node));
     }
-  }
 
-  return jsUndefined();
+    return jsUndefined();
 }
 
 } // end namespace
index 57bd4bc7e450d462ceb7c13438d5b8edd067c01f..8c3f0805368a2ca456e8955f91bb2b6deda85855 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef _XMLSERIALIZER_H_
-#define _XMLSERIALIZER_H_
+#ifndef JSXMLSerializer_H
+#define JSXMLSerializer_H
 
 #include "kjs_binding.h"
 
 namespace KJS {
+    class JSEventListener;
+}
 
-  class JSEventListener;
+namespace WebCore {
 
-  class XMLSerializerConstructorImp : public DOMObject {
+  class JSXMLSerializerConstructorImp : public KJS::DOMObject {
   public:
-    XMLSerializerConstructorImp(ExecState *);
+    JSXMLSerializerConstructorImp(KJS::ExecState*);
     virtual bool implementsConstruct() const;
-    virtual JSObject *construct(ExecState *exec, const List &args);
+    virtual KJS::JSObject* construct(KJS::ExecState*, const KJS::List& args);
   };
 
-  class XMLSerializer : public DOMObject {
+  class JSXMLSerializer : public KJS::DOMObject {
   public:
-    XMLSerializer(ExecState *);
-    virtual bool toBoolean(ExecState *) const { return true; }
-    virtual const ClassInfo* classInfo() const { return &info; }
-    static const ClassInfo info;
+    JSXMLSerializer(KJS::ExecState*);
+    virtual bool toBoolean(KJS::ExecState*) const { return true; }
+    virtual const KJS::ClassInfo* classInfo() const { return &info; }
+    static const KJS::ClassInfo info;
     enum { SerializeToString };
-
-  private:
-    friend class XMLSerializerProtoFunc;
   };
 
 } // namespace
index c3de43b2c598dd41505a818b458e87cedf056ec4..3a5a20b3f4cbef34aa231c8fef1e9ea6edfee582 100644 (file)
@@ -776,7 +776,7 @@ JSValue *Window::getValueProperty(ExecState *exec, int token) const
     case XMLHttpRequest:
       return new JSXMLHttpRequestConstructorImp(exec, m_frame->document());
     case XMLSerializer:
-      return new XMLSerializerConstructorImp(exec);
+      return new JSXMLSerializerConstructorImp(exec);
     case DOMParser_:
       return new DOMParserConstructorImp(exec, m_frame->document());
 #ifdef KHTML_XSLT