+2007-06-07 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders.
+
+ Update test for http://bugs.webkit.org/show_bug.cgi?id=14028
+ Finish autogenerating the JS bindings for Node
+
+ * fast/dom/prototype-chain-expected.txt: DOMNodePrototype is no longer in the prototype chain.
+
2007-06-06 Sam Weinig <sam@webkit.org>
Reviewed by Hyatt.
NOTE: This test will start failing if you change the layout of a related prototype chain in WebCore. That does not necessarily mean that you have done something wrong; you may just need to check in new results.
------ [object HTMLDocument] (6 prototypes) -----
+----- [object HTMLDocument] (5 prototypes) -----
[object Object]
-[object DOMNodePrototype]
-
[object NodePrototype]
[object EventTargetNodePrototype]
[object HTMLDocumentPrototype]
------ [object HTMLDivElement] (7 prototypes) -----
+----- [object HTMLDivElement] (6 prototypes) -----
[object Object]
-[object DOMNodePrototype]
-
[object NodePrototype]
[object EventTargetNodePrototype]
[object HTMLDivElementPrototype]
------ [object HTMLFormElement] (7 prototypes) -----
+----- [object HTMLFormElement] (6 prototypes) -----
[object Object]
-[object DOMNodePrototype]
-
[object NodePrototype]
[object EventTargetNodePrototype]
+2007-06-07 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders.
+
+ Patch for http://bugs.webkit.org/show_bug.cgi?id=14028
+ Finish autogenerating the JS bindings for Node
+
+ * DerivedSources.make:
+ * WebCore.pro:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSHTMLElementWrapperFactory.cpp:
+ (WebCore::createJSHTMLWrapper):
+ * bindings/js/JSHTMLElementWrapperFactory.h:
+ * bindings/js/JSHTMLOptionElementConstructor.cpp:
+ * bindings/js/JSNamedNodeMapCustom.cpp:
+ * bindings/js/JSNodeCustom.cpp:
+ (WebCore::JSNode::insertBefore):
+ (WebCore::JSNode::replaceChild):
+ (WebCore::JSNode::removeChild):
+ (WebCore::JSNode::appendChild):
+ (WebCore::JSNode::mark):
+ (WebCore::toJS):
+ * bindings/js/JSSVGElementWrapperFactory.cpp:
+ (WebCore::createJSSVGWrapper):
+ * bindings/js/JSSVGElementWrapperFactory.h:
+ * bindings/js/JSXSLTProcessor.cpp:
+ (KJS::XSLTProcessorPrototypeFunction::callAsFunction):
+ * bindings/js/kjs_binding.cpp:
+ (KJS::ScriptInterpreter::getDOMNodeForDocument):
+ (KJS::ScriptInterpreter::putDOMNodeForDocument):
+ (KJS::ScriptInterpreter::markDOMNodesForDocument):
+ (KJS::ScriptInterpreter::updateDOMNodeDocument):
+ * bindings/js/kjs_binding.h:
+ * bindings/js/kjs_dom.cpp:
+ (WebCore::toAttr):
+ * bindings/js/kjs_dom.h:
+ * bindings/js/kjs_domnode.h: Removed.
+ * bindings/objc/DOMUtility.mm:
+ (KJS::createDOMWrapper):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * dom/Node.h:
+ (WebCore::Node::parentElement):
+ * dom/Node.idl:
+
2007-06-07 Sam Weinig <sam@webkit.org>
Another Gdk and Qt build fix.
XMLNames.cpp \
XPathGrammar.cpp \
kjs_css.lut.h \
- kjs_dom.lut.h \
kjs_events.lut.h \
kjs_html.lut.h \
kjs_navigator.lut.h \
bindings/js/JSXMLHttpRequest.cpp \
bindings/js/JSXSLTProcessor.cpp \
bindings/js/kjs_css.cpp \
- bindings/js/kjs_dom.cpp \
bindings/js/kjs_events.cpp \
bindings/js/kjs_html.cpp \
bindings/js/kjs_navigator.cpp \
14CF78A609F58CD800EB3665 /* JSCSSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CF78A509F58CD800EB3665 /* JSCSSValue.h */; };
14CF7B3309F6ECD700EB3665 /* JSCSSRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14CF7B3109F6ECD700EB3665 /* JSCSSRule.cpp */; };
14CF7B3409F6ECD700EB3665 /* JSCSSRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 14CF7B3209F6ECD700EB3665 /* JSCSSRule.h */; };
- 14D0C82509FF0EF5006B36D9 /* kjs_domnode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D0C82409FF0EF5006B36D9 /* kjs_domnode.h */; };
14D823520AF92A790004F057 /* Chrome.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D823500AF92A790004F057 /* Chrome.h */; settings = {ATTRIBUTES = (Private, ); }; };
14D8238B0AF92DF60004F057 /* Chrome.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14D8238A0AF92DF60004F057 /* Chrome.cpp */; };
14D824080AF93AEB0004F057 /* ChromeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D824060AF93AEB0004F057 /* ChromeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
656581EE09D1508D000E61D7 /* JSXMLHttpRequest.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */; };
656581F009D1508D000E61D7 /* JSXSLTProcessor.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */; };
656581F109D1508D000E61D7 /* kjs_css.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DA09D1508D000E61D7 /* kjs_css.lut.h */; };
- 656581F209D1508D000E61D7 /* kjs_dom.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DB09D1508D000E61D7 /* kjs_dom.lut.h */; };
656581F309D1508D000E61D7 /* kjs_events.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DC09D1508D000E61D7 /* kjs_events.lut.h */; };
656581F409D1508D000E61D7 /* kjs_html.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DD09D1508D000E61D7 /* kjs_html.lut.h */; };
656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */; };
14CF7B3109F6ECD700EB3665 /* JSCSSRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSRule.cpp; sourceTree = "<group>"; };
14CF7B3209F6ECD700EB3665 /* JSCSSRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSRule.h; sourceTree = "<group>"; };
14CF7C2009F7110600EB3665 /* KeyboardEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = KeyboardEvent.idl; sourceTree = "<group>"; };
- 14D0C82409FF0EF5006B36D9 /* kjs_domnode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_domnode.h; sourceTree = "<group>"; };
14D823500AF92A790004F057 /* Chrome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Chrome.h; sourceTree = "<group>"; };
14D8238A0AF92DF60004F057 /* Chrome.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Chrome.cpp; sourceTree = "<group>"; };
14D824060AF93AEB0004F057 /* ChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChromeClient.h; sourceTree = "<group>"; };
656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXMLHttpRequest.lut.h; sourceTree = "<group>"; };
656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSXSLTProcessor.lut.h; sourceTree = "<group>"; };
656581DA09D1508D000E61D7 /* kjs_css.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_css.lut.h; sourceTree = "<group>"; };
- 656581DB09D1508D000E61D7 /* kjs_dom.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_dom.lut.h; sourceTree = "<group>"; };
656581DC09D1508D000E61D7 /* kjs_events.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_events.lut.h; sourceTree = "<group>"; };
656581DD09D1508D000E61D7 /* kjs_html.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_html.lut.h; sourceTree = "<group>"; };
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_navigator.lut.h; sourceTree = "<group>"; };
BCD9C2C40C17B6EC005C90A2 /* JSDOMExceptionConstructor.lut.h */,
BCD9C2C50C17B6EC005C90A2 /* JSEventTargetNode.lut.h */,
656581DA09D1508D000E61D7 /* kjs_css.lut.h */,
- 656581DB09D1508D000E61D7 /* kjs_dom.lut.h */,
656581DC09D1508D000E61D7 /* kjs_events.lut.h */,
656581DD09D1508D000E61D7 /* kjs_html.lut.h */,
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */,
93B70D4A09EB0C7C009D8468 /* kjs_css.h */,
93B70D4B09EB0C7C009D8468 /* kjs_dom.cpp */,
93B70D4C09EB0C7C009D8468 /* kjs_dom.h */,
- 14D0C82409FF0EF5006B36D9 /* kjs_domnode.h */,
93B70D4D09EB0C7C009D8468 /* kjs_events.cpp */,
93B70D4E09EB0C7C009D8468 /* kjs_events.h */,
93B70D4F09EB0C7C009D8468 /* kjs_html.cpp */,
656581EE09D1508D000E61D7 /* JSXMLHttpRequest.lut.h in Headers */,
656581F009D1508D000E61D7 /* JSXSLTProcessor.lut.h in Headers */,
656581F109D1508D000E61D7 /* kjs_css.lut.h in Headers */,
- 656581F209D1508D000E61D7 /* kjs_dom.lut.h in Headers */,
656581F309D1508D000E61D7 /* kjs_events.lut.h in Headers */,
656581F409D1508D000E61D7 /* kjs_html.lut.h in Headers */,
656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */,
93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
BC066F6F09FEB2FA00C589A7 /* WebCoreTextRenderer.h in Headers */,
14DC0D3809FED073007B0235 /* JSNode.h in Headers */,
- 14D0C82509FF0EF5006B36D9 /* kjs_domnode.h in Headers */,
142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */,
BCC71A130A0FF94D0014EE6E /* GlyphBuffer.h in Headers */,
1A7629D60A07425100989F5B /* XPathGrammar.h in Headers */,
using namespace HTMLNames;
-typedef DOMNode* (*CreateHTMLElementWrapperFunction)(ExecState*, PassRefPtr<HTMLElement>);
+typedef JSNode* (*CreateHTMLElementWrapperFunction)(ExecState*, PassRefPtr<HTMLElement>);
#define FOR_EACH_TAG(macro) \
macro(a, Anchor) \
// end of macro
#define CREATE_WRAPPER_FUNCTION(tag, name) \
-static DOMNode* create##name##Wrapper(ExecState* exec, PassRefPtr<HTMLElement> element) \
+static JSNode* create##name##Wrapper(ExecState* exec, PassRefPtr<HTMLElement> element) \
{ \
return new JSHTML##name##Element(exec, static_cast<HTML##name##Element*>(element.get())); \
}
FOR_EACH_TAG(CREATE_WRAPPER_FUNCTION)
#undef CREATE_WRAPPER_FUNCTION
-DOMNode* createJSHTMLWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+JSNode* createJSHTMLWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
{
static HashMap<AtomicStringImpl*, CreateHTMLElementWrapperFunction> map;
if (map.isEmpty()) {
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2007 Apple Inc. All ri
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <wtf/Forward.h>
namespace KJS {
- class DOMNode;
class ExecState;
}
namespace WebCore {
+ class JSNode;
class HTMLElement;
- KJS::DOMNode* createJSHTMLWrapper(KJS::ExecState*, PassRefPtr<HTMLElement>);
+
+ JSNode* createJSHTMLWrapper(KJS::ExecState*, PassRefPtr<HTMLElement>);
}
#include "HTMLOptionElement.h"
#include "JSHTMLOptionElement.h"
#include "Text.h"
-#include "kjs_dom.h"
namespace WebCore {
#include "JSNamedNodeMap.h"
#include "NamedNodeMap.h"
-#include "kjs_dom.h"
+#include "PlatformString.h"
#include "kjs_binding.h"
+#include "kjs_dom.h"
namespace WebCore {
namespace WebCore {
+typedef int ExpectionCode;
+
+KJS::JSValue* JSNode::insertBefore(KJS::ExecState* exec, const KJS::List& args)
+{
+ ExceptionCode ec = 0;
+ bool ok = impl()->insertBefore(toNode(args[0]), toNode(args[1]), ec);
+ KJS::setDOMException(exec, ec);
+ if (ok)
+ return args[0];
+ return KJS::jsNull();
+}
+
+KJS::JSValue* JSNode::replaceChild(KJS::ExecState* exec, const KJS::List& args)
+{
+ ExceptionCode ec = 0;
+ bool ok = impl()->replaceChild(toNode(args[0]), toNode(args[1]), ec);
+ KJS::setDOMException(exec, ec);
+ if (ok)
+ return args[1];
+ return KJS::jsNull();
+}
+
+KJS::JSValue* JSNode::removeChild(KJS::ExecState* exec, const KJS::List& args)
+{
+ ExceptionCode ec = 0;
+ bool ok = impl()->removeChild(toNode(args[0]), ec);
+ KJS::setDOMException(exec, ec);
+ if (ok)
+ return args[0];
+ return KJS::jsNull();
+}
+
+KJS::JSValue* JSNode::appendChild(KJS::ExecState* exec, const KJS::List& args)
+{
+ ExceptionCode ec = 0;
+ bool ok = impl()->appendChild(toNode(args[0]), ec);
+ KJS::setDOMException(exec, ec);
+ if (ok)
+ return args[0];
+ return KJS::jsNull();
+}
+
+void JSNode::mark()
+{
+ ASSERT(!marked());
+
+ Node* node = m_impl.get();
+
+ // Nodes in the document are kept alive by ScriptInterpreter::mark,
+ // so we have no special responsibilities and can just call the base class here.
+ if (node->inDocument()) {
+ DOMObject::mark();
+ return;
+ }
+
+ // This is a node outside the document, so find the root of the tree it is in,
+ // and start marking from there.
+ Node* root = node;
+ for (Node* current = m_impl.get(); current; current = current->parentNode())
+ root = current;
+
+ // If we're already marking this tree, then we can simply mark this wrapper
+ // by calling the base class; our caller is iterating the tree.
+ if (root->m_inSubtreeMark) {
+ DOMObject::mark();
+ return;
+ }
+
+ // Mark the whole tree; use the global set of roots to avoid reentering.
+ root->m_inSubtreeMark = true;
+ for (Node* nodeToMark = root; nodeToMark; nodeToMark = nodeToMark->traverseNextNode()) {
+ JSNode* wrapper = KJS::ScriptInterpreter::getDOMNodeForDocument(m_impl->document(), nodeToMark);
+ if (wrapper) {
+ if (!wrapper->marked())
+ wrapper->mark();
+ } else if (nodeToMark == node) {
+ // This is the case where the map from the document to wrappers has
+ // been cleared out, but a wrapper is being marked. For now, we'll
+ // let the rest of the tree of wrappers get collected, because we have
+ // no good way of finding them. Later we should test behavior of other
+ // browsers and see if we need to preserve other wrappers in this case.
+ if (!marked())
+ mark();
+ }
+ }
+ root->m_inSubtreeMark = false;
+
+ // Double check that we actually ended up marked. This assert caught problems in the past.
+ ASSERT(marked());
+}
+
KJS::JSValue* toJS(KJS::ExecState* exec, PassRefPtr<Node> n)
{
Node* node = n.get();
KJS::ScriptInterpreter* interp = static_cast<KJS::ScriptInterpreter*>(exec->dynamicInterpreter());
Document* doc = node->document();
- KJS::DOMNode* ret = interp->getDOMNodeForDocument(doc, node);
+ JSNode* ret = interp->getDOMNodeForDocument(doc, node);
if (ret)
return ret;
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
using namespace SVGNames;
-typedef DOMNode* (*CreateSVGElementWrapperFunction)(ExecState*, PassRefPtr<SVGElement>);
+typedef JSNode* (*CreateSVGElementWrapperFunction)(ExecState*, PassRefPtr<SVGElement>);
#if ENABLE(SVG_EXPERIMENTAL_FEATURES)
#define FOR_EACH_TAG(macro) \
#endif
#define CREATE_WRAPPER_FUNCTION(tag, name) \
-static DOMNode* create##name##Wrapper(ExecState* exec, PassRefPtr<SVGElement> element) \
+static JSNode* create##name##Wrapper(ExecState* exec, PassRefPtr<SVGElement> element) \
{ \
return new JSSVG##name##Element(exec, static_cast<SVG##name##Element*>(element.get())); \
}
FOR_EACH_TAG(CREATE_WRAPPER_FUNCTION)
#undef CREATE_WRAPPER_FUNCTION
-DOMNode* createJSSVGWrapper(ExecState* exec, PassRefPtr<SVGElement> element)
+JSNode* createJSSVGWrapper(ExecState* exec, PassRefPtr<SVGElement> element)
{
static HashMap<WebCore::AtomicStringImpl*, CreateSVGElementWrapperFunction> map;
if (map.isEmpty()) {
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include <wtf/Forward.h>
namespace KJS {
- class DOMNode;
class ExecState;
}
namespace WebCore {
+
+ class JSNode;
class SVGElement;
- KJS::DOMNode* createJSSVGWrapper(KJS::ExecState*, PassRefPtr<SVGElement>);
+
+ JSNode* createJSSVGWrapper(KJS::ExecState*, PassRefPtr<SVGElement>);
+
}
#endif // ENABLE(SVG)
-#endif
+#endif // JSSVGElementWrapperFactory_h
case JSXSLTProcessor::ImportStylesheet:
{
JSValue *nodeVal = args[0];
- if (nodeVal->isObject(&DOMNode::info)) {
- DOMNode *node = static_cast<DOMNode *>(nodeVal);
+ if (nodeVal->isObject(&JSNode::info)) {
+ JSNode* node = static_cast<JSNode*>(nodeVal);
processor.importStylesheet(node->impl());
return jsUndefined();
}
{
JSValue *nodeVal = args[0];
JSValue *docVal = args[1];
- if (nodeVal->isObject(&DOMNode::info) && docVal->isObject(&JSDocument::info)) {
- Node* node = static_cast<DOMNode *>(nodeVal)->impl();
+ if (nodeVal->isObject(&JSNode::info) && docVal->isObject(&JSDocument::info)) {
+ Node* node = static_cast<JSNode*>(nodeVal)->impl();
Document* doc = static_cast<Document*>(static_cast<JSDocument *>(docVal)->impl());
return toJS(exec, processor.transformToFragment(node, doc).get());
}
case JSXSLTProcessor::TransformToDocument:
{
JSValue *nodeVal = args[0];
- if (nodeVal->isObject(&DOMNode::info)) {
- DOMNode *node = static_cast<DOMNode *>(nodeVal);
+ if (nodeVal->isObject(&JSNode::info)) {
+ JSNode* node = static_cast<JSNode*>(nodeVal);
RefPtr<Document> resultDocument = processor.transformToDocument(node->impl());
if (resultDocument)
return toJS(exec, resultDocument.get());
/*
* This file is part of the KDE libraries
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
+ * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
*
* This library is free software; you can redistribute it and/or
#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
+#include "JSNode.h"
#include "Page.h"
#include "PlatformString.h"
#include "Range.h"
#include "RangeException.h"
-#include "xmlhttprequest.h"
#include "kjs_dom.h"
#include "kjs_window.h"
+#include "xmlhttprequest.h"
#include <kjs/collector.h>
#include <wtf/HashMap.h>
namespace KJS {
typedef HashMap<void*, DOMObject*> DOMObjectMap;
-typedef HashMap<Node*, DOMNode*> NodeMap;
+typedef HashMap<Node*, JSNode*> NodeMap;
typedef HashMap<Document*, NodeMap*> NodePerDocMap;
// For debugging, keep a set of wrappers currently registered, and check that
domObjects().remove(objectHandle);
}
-DOMNode* ScriptInterpreter::getDOMNodeForDocument(Document* document, Node* node)
+JSNode* ScriptInterpreter::getDOMNodeForDocument(Document* document, Node* node)
{
if (!document)
- return static_cast<DOMNode*>(domObjects().get(node));
+ return static_cast<JSNode*>(domObjects().get(node));
NodeMap* documentDict = domNodesPerDocument().get(document);
if (documentDict)
return documentDict->get(node);
documentDict->remove(node);
}
-void ScriptInterpreter::putDOMNodeForDocument(Document* document, Node* node, DOMNode* wrapper)
+void ScriptInterpreter::putDOMNodeForDocument(Document* document, Node* node, JSNode* wrapper)
{
ADD_WRAPPER(wrapper);
if (!document) {
NodeMap* nodeDict = dictIt->second;
NodeMap::iterator nodeEnd = nodeDict->end();
for (NodeMap::iterator nodeIt = nodeDict->begin(); nodeIt != nodeEnd; ++nodeIt) {
- DOMNode* node = nodeIt->second;
+ JSNode* node = nodeIt->second;
// don't mark wrappers for nodes that are no longer in the
// document - they should not be saved if the node is not
// otherwise reachable from JS.
void ScriptInterpreter::updateDOMNodeDocument(Node* node, Document* oldDoc, Document* newDoc)
{
ASSERT(oldDoc != newDoc);
- DOMNode* wrapper = getDOMNodeForDocument(oldDoc, node);
+ JSNode* wrapper = getDOMNodeForDocument(oldDoc, node);
if (wrapper) {
REMOVE_WRAPPER(wrapper);
putDOMNodeForDocument(newDoc, node, wrapper);
class Frame;
class Node;
class String;
+ class JSNode;
typedef int ExceptionCode;
}
#endif
};
- class DOMNode;
-
/**
* We inherit from Interpreter, to save a pointer to the HTML part
* that the interpreter runs for.
static void putDOMObject(void* objectHandle, DOMObject*);
static void forgetDOMObject(void* objectHandle);
- static DOMNode *getDOMNodeForDocument(WebCore::Document*, WebCore::Node*);
- static void putDOMNodeForDocument(WebCore::Document*, WebCore::Node*, DOMNode *nodeWrapper);
+ static WebCore::JSNode* getDOMNodeForDocument(WebCore::Document*, WebCore::Node*);
+ static void putDOMNodeForDocument(WebCore::Document*, WebCore::Node*, WebCore::JSNode* nodeWrapper);
static void forgetDOMNodeForDocument(WebCore::Document*, WebCore::Node*);
static void forgetAllDOMNodesForDocument(WebCore::Document*);
static void updateDOMNodeDocument(WebCore::Node*, WebCore::Document* oldDoc, WebCore::Document* newDoc);
WebCore::String valueToStringWithUndefinedOrNullCheck(ExecState*, JSValue*); // null String if the value is null or undefined
template <typename T> inline JSValue* toJS(ExecState* exec, PassRefPtr<T> ptr) { return toJS(exec, ptr.get()); }
-
+
} // namespace
#endif
#include "config.h"
#include "kjs_dom.h"
-#include "CDATASection.h"
-#include "Comment.h"
-#include "DOMImplementation.h"
-#include "DocumentFragment.h"
-#include "DocumentType.h"
-#include "Element.h"
-#include "Entity.h"
-#include "EntityReference.h"
-#include "Event.h"
-#include "EventNames.h"
+#include "Document.h"
#include "EventTarget.h"
-#include "ExceptionCode.h"
#include "Frame.h"
-#include "HTMLDocument.h"
#include "HTMLNames.h"
#include "HTMLPlugInElement.h"
#include "JSAttr.h"
-#include "JSCDATASection.h"
-#include "JSComment.h"
-#include "JSDOMImplementation.h"
-#include "JSDocumentFragment.h"
-#include "JSDocumentType.h"
-#include "JSElement.h"
-#include "JSEntity.h"
-#include "JSEntityReference.h"
-#include "JSHTMLDocument.h"
-#include "JSHTMLElementWrapperFactory.h"
-#include "JSNamedNodeMap.h"
#include "JSNode.h"
-#include "JSNodeList.h"
-#include "JSNotation.h"
-#include "JSProcessingInstruction.h"
-#include "JSRange.h"
-#include "JSText.h"
-#include "NamedNodeMap.h"
-#include "NodeList.h"
-#include "Notation.h"
-#include "ProcessingInstruction.h"
-#include "Range.h"
-#include "RenderView.h"
-#include "kjs_css.h"
#include "kjs_events.h"
#include "kjs_window.h"
#include "xmlhttprequest.h"
#if ENABLE(SVG)
-#include "JSSVGDocument.h"
#include "JSSVGElementInstance.h"
-#include "JSSVGElementWrapperFactory.h"
-#include "SVGDocument.h"
-#include "SVGElement.h"
#endif
#if USE(JAVASCRIPTCORE_BINDINGS)
#include <JavaScriptCore/runtime_object.h>
#endif
-using namespace WebCore;
-using namespace HTMLNames;
-using namespace EventNames;
-
-#include "kjs_dom.lut.h"
-
-namespace KJS {
-
-// -------------------------------------------------------------------------
-/* Source for DOMNodePrototypeTable. Use "make hashtables" to regenerate.
-@begin DOMNodePrototypeTable 25
- insertBefore DOMNode::InsertBefore DontDelete|Function 2
- replaceChild DOMNode::ReplaceChild DontDelete|Function 2
- removeChild DOMNode::RemoveChild DontDelete|Function 1
- appendChild DOMNode::AppendChild DontDelete|Function 1
- hasAttributes DOMNode::HasAttributes DontDelete|Function 0
- hasChildNodes DOMNode::HasChildNodes DontDelete|Function 0
- cloneNode DOMNode::CloneNode DontDelete|Function 1
-# DOM2
- normalize DOMNode::Normalize DontDelete|Function 0
- isSupported DOMNode::IsSupported DontDelete|Function 2
-# DOM3
- isSameNode DOMNode::IsSameNode DontDelete|Function 1
- isEqualNode DOMNode::IsEqualNode DontDelete|Function 1
- isDefaultNamespace DOMNode::IsDefaultNamespace DontDelete|Function 1
- lookupNamespaceURI DOMNode::LookupNamespaceURI DontDelete|Function 1
- lookupPrefix DOMNode::LookupPrefix DontDelete|Function 1
-@end
-*/
-KJS_IMPLEMENT_PROTOTYPE_FUNCTION(DOMNodePrototypeFunction)
-KJS_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodePrototype, DOMNodePrototypeFunction)
-
-const ClassInfo DOMNode::info = { "Node", 0, &DOMNodeTable, 0 };
-
-DOMNode::DOMNode(ExecState* exec, Node* n)
- : m_impl(n)
-{
- setPrototype(DOMNodePrototype::self(exec));
-}
-
-DOMNode::~DOMNode()
-{
- ScriptInterpreter::forgetDOMNodeForDocument(m_impl->document(), m_impl.get());
-}
-
-void DOMNode::mark()
-{
- ASSERT(!marked());
-
- Node* node = m_impl.get();
-
- // Nodes in the document are kept alive by ScriptInterpreter::mark,
- // so we have no special responsibilities and can just call the base class here.
- if (node->inDocument()) {
- DOMObject::mark();
- return;
- }
+namespace WebCore {
- // This is a node outside the document, so find the root of the tree it is in,
- // and start marking from there.
- Node* root = node;
- for (Node* current = m_impl.get(); current; current = current->parentNode()) {
- root = current;
- }
-
- // If we're already marking this tree, then we can simply mark this wrapper
- // by calling the base class; our caller is iterating the tree.
- if (root->m_inSubtreeMark) {
- DOMObject::mark();
- return;
- }
-
- // Mark the whole tree; use the global set of roots to avoid reentering.
- root->m_inSubtreeMark = true;
- for (Node* nodeToMark = root; nodeToMark; nodeToMark = nodeToMark->traverseNextNode()) {
- DOMNode *wrapper = ScriptInterpreter::getDOMNodeForDocument(m_impl->document(), nodeToMark);
- if (wrapper) {
- if (!wrapper->marked())
- wrapper->mark();
- } else if (nodeToMark == node) {
- // This is the case where the map from the document to wrappers has
- // been cleared out, but a wrapper is being marked. For now, we'll
- // let the rest of the tree of wrappers get collected, because we have
- // no good way of finding them. Later we should test behavior of other
- // browsers and see if we need to preserve other wrappers in this case.
- if (!marked())
- mark();
- }
- }
- root->m_inSubtreeMark = false;
-
- // Double check that we actually ended up marked. This assert caught problems in the past.
- ASSERT(marked());
-}
-
-/* Source for DOMNodeTable. Use "make hashtables" to regenerate.
-@begin DOMNodeTable 25
- nodeName DOMNode::NodeName DontDelete|ReadOnly
- nodeValue DOMNode::NodeValue DontDelete
- nodeType DOMNode::NodeType DontDelete|ReadOnly
- parentNode DOMNode::ParentNode DontDelete|ReadOnly
- parentElement DOMNode::ParentElement DontDelete|ReadOnly
- childNodes DOMNode::ChildNodes DontDelete|ReadOnly
- firstChild DOMNode::FirstChild DontDelete|ReadOnly
- lastChild DOMNode::LastChild DontDelete|ReadOnly
- previousSibling DOMNode::PreviousSibling DontDelete|ReadOnly
- nextSibling DOMNode::NextSibling DontDelete|ReadOnly
- attributes DOMNode::Attributes DontDelete|ReadOnly
- baseURI DOMNode::BaseURI DontDelete|ReadOnly
- namespaceURI DOMNode::NamespaceURI DontDelete|ReadOnly
-# DOM2
- prefix DOMNode::Prefix DontDelete
- localName DOMNode::LocalName DontDelete|ReadOnly
- ownerDocument DOMNode::OwnerDocument DontDelete|ReadOnly
-# DOM3
- textContent DOMNode::TextContent DontDelete
-@end
-*/
-bool DOMNode::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<DOMNode, DOMObject>(exec, &DOMNodeTable, this, propertyName, slot);
-}
-
-JSValue* DOMNode::getValueProperty(ExecState* exec, int token) const
-{
- Node& node = *m_impl;
- switch (token) {
- case NodeName:
- return jsStringOrNull(node.nodeName());
- case NodeValue:
- return jsStringOrNull(node.nodeValue());
- case NodeType:
- return jsNumber(node.nodeType());
- case ParentNode:
- case ParentElement: // IE only apparently
- return toJS(exec,node.parentNode());
- case ChildNodes:
- return toJS(exec,node.childNodes().get());
- case FirstChild:
- return toJS(exec,node.firstChild());
- case LastChild:
- return toJS(exec,node.lastChild());
- case PreviousSibling:
- return toJS(exec,node.previousSibling());
- case NextSibling:
- return toJS(exec,node.nextSibling());
- case Attributes:
- return toJS(exec,node.attributes());
- case BaseURI:
- return jsStringOrNull(node.baseURI());
- case NamespaceURI:
- return jsStringOrNull(node.namespaceURI());
- case Prefix:
- return jsStringOrNull(node.prefix());
- case LocalName:
- return jsStringOrNull(node.localName());
- case OwnerDocument:
- return toJS(exec,node.ownerDocument());
- case TextContent:
- return jsStringOrNull(node.textContent());
- }
-
- return jsUndefined();
-}
-
-void DOMNode::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr)
-{
- lookupPut<DOMNode,DOMObject>(exec, propertyName, value, attr, &DOMNodeTable, this);
-}
-
-void DOMNode::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/)
-{
- DOMExceptionTranslator exception(exec);
- Node& node = *m_impl;
- switch (token) {
- case NodeValue:
- node.setNodeValue(valueToStringWithNullCheck(exec, value), exception);
- break;
- case Prefix:
- node.setPrefix(valueToStringWithNullCheck(exec, value), exception);
- break;
- case TextContent:
- node.setTextContent(valueToStringWithNullCheck(exec, value), exception);
- break;
- }
-}
-
-JSValue* DOMNodePrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List &args)
-{
- if (!thisObj->inherits(&DOMNode::info))
- return throwError(exec, TypeError);
- DOMExceptionTranslator exception(exec);
- Node& node = *static_cast<DOMNode*>(thisObj)->impl();
- switch (id) {
- case DOMNode::HasAttributes:
- return jsBoolean(node.hasAttributes());
- case DOMNode::HasChildNodes:
- return jsBoolean(node.hasChildNodes());
- case DOMNode::CloneNode:
- return toJS(exec,node.cloneNode(args[0]->toBoolean(exec)));
- case DOMNode::Normalize:
- node.normalize();
- return jsUndefined();
- case DOMNode::IsSupported:
- return jsBoolean(node.isSupported(args[0]->toString(exec),
- valueToStringWithNullCheck(exec, args[1])));
- case DOMNode::IsSameNode:
- return jsBoolean(node.isSameNode(toNode(args[0])));
- case DOMNode::IsEqualNode:
- return jsBoolean(node.isEqualNode(toNode(args[0])));
- case DOMNode::IsDefaultNamespace:
- return jsBoolean(node.isDefaultNamespace(valueToStringWithNullCheck(exec, args[0])));
- case DOMNode::LookupNamespaceURI:
- return jsStringOrNull(node.lookupNamespaceURI(valueToStringWithNullCheck(exec, args[0])));
- case DOMNode::LookupPrefix:
- return jsStringOrNull(node.lookupPrefix(valueToStringWithNullCheck(exec, args[0])));
- case DOMNode::AppendChild:
- if (node.appendChild(toNode(args[0]), exception))
- return args[0];
- return jsNull();
- case DOMNode::RemoveChild:
- if (node.removeChild(toNode(args[0]), exception))
- return args[0];
- return jsNull();
- case DOMNode::InsertBefore:
- if (node.insertBefore(toNode(args[0]), toNode(args[1]), exception))
- return args[0];
- return jsNull();
- case DOMNode::ReplaceChild:
- if (node.replaceChild(toNode(args[0]), toNode(args[1]), exception))
- return args[1];
- return jsNull();
- }
-
- return jsUndefined();
-}
+using namespace KJS;
+using namespace HTMLNames;
Attr* toAttr(JSValue* val, bool& ok)
{
}
ok = true;
- return static_cast<Attr*>(static_cast<DOMNode*>(val)->impl());
+ return static_cast<Attr*>(static_cast<JSNode*>(val)->impl());
}
-// -------------------------------------------------------------------------
-
bool checkNodeSecurity(ExecState* exec, Node* n)
{
if (!n)
return 0;
}
-} // namespace KJS
+} // namespace WebCore
#include "JSNode.h"
#include "Node.h"
#include "kjs_binding.h"
-#include <wtf/Vector.h>
namespace WebCore {
+
class Attr;
class EventTarget;
-}
-
-namespace KJS {
- WebCore::Attr* toAttr(JSValue*, bool& ok);
+ Attr* toAttr(KJS::JSValue*, bool& ok);
- bool checkNodeSecurity(ExecState*, WebCore::Node*);
- JSValue* getRuntimeObject(ExecState*, WebCore::Node*);
- JSValue* toJS(ExecState*, WebCore::EventTarget*);
- JSObject* getNodeConstructor(ExecState*);
+ bool checkNodeSecurity(KJS::ExecState*, Node*);
+ KJS::JSValue* getRuntimeObject(KJS::ExecState*, Node*);
+ KJS::JSValue* toJS(KJS::ExecState*, EventTarget*);
+ KJS::JSObject* getNodeConstructor(KJS::ExecState*);
-} // namespace
+} // namespace WebCore
-#endif
+#endif // kjs_dom_h
+++ /dev/null
-/*
- * This file is part of the KDE libraries
- * Copyright (C) 2000 Harri Porten (porten@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006 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 kjs_domnode_h
-#define kjs_domnode_h
-
-#include <kjs_binding.h>
-#include <kjs/lookup.h>
-
-namespace WebCore {
- class JSNode;
-}
-
-namespace KJS {
-
-KJS_DEFINE_PROTOTYPE(DOMNodePrototype)
-
-class DOMNode : public DOMObject {
-public:
- virtual ~DOMNode();
-
- virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState*, int token) const;
- virtual void mark();
- virtual void put(ExecState*, const Identifier &propertyName, JSValue*, int attr = None);
- void putValueProperty(ExecState*, int token, JSValue*, int attr);
- WebCore::Node *impl() const { return m_impl.get(); }
- virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
-
- enum { NodeName, NodeValue, NodeType, ParentNode, ParentElement,
- ChildNodes, FirstChild, LastChild, PreviousSibling, NextSibling, BaseURI,
- Attributes, NamespaceURI, Prefix, LocalName, OwnerDocument, InsertBefore,
- ReplaceChild, RemoveChild, AppendChild, HasAttributes, HasChildNodes,
- CloneNode, Normalize, IsSupported, Contains, IsSameNode, IsEqualNode, TextContent,
- IsDefaultNamespace, LookupNamespaceURI, LookupPrefix
- };
-
-protected:
- RefPtr<WebCore::Node> m_impl;
-
-private:
- // Don't use this class directly -- use JSNode instead
- friend class WebCore::JSNode;
- DOMNode(ExecState*, WebCore::Node *n);
-};
-
-} // namespace KJS
-
-#endif
#import "JSHTMLOptionsCollection.h"
#import "JSMediaList.h"
#import "JSNamedNodeMap.h"
+#import "JSNode.h"
#import "JSNodeIterator.h"
#import "JSNodeList.h"
#import "JSRange.h"
#import "Node.h"
#import "WebScriptObjectPrivate.h"
#import "kjs_css.h"
-#import "kjs_dom.h"
#import "kjs_html.h"
#import "kjs_window.h"
#import <objc/objc-runtime.h>
WRAP(HTMLOptionsCollection)
WRAP(MediaList)
WRAP(NamedNodeMap)
+ WRAP(Node)
WRAP(NodeList)
WRAP(Range)
WRAP(StyleSheet)
return [objc_getClass("DOM" #className) _wrap##className:static_cast<DOM##className*>(object)->impl()];
WRAP(Event)
- WRAP(Node)
WRAP(RGBColor)
WRAP(Rect)
WRAP(StyleSheetList)
return "#include \"JSHTMLInputElementBase.h\"\n\n" if $legacyParent eq "JSHTMLInputElementBase";
return "#include \"kjs_window.h\"\n\n" if $legacyParent eq "KJS::Window";
- return "#include \"kjs_domnode.h\"\n\n" if $legacyParent eq "KJS::DOMNode";
return "#include \"kjs_events.h\"\n\n" if $module eq "events";
- return "#include \"kjs_dom.h\"\n\n" if $module eq "core";
return "#include \"kjs_css.h\"\n\n" if $module eq "css";
return "#include \"kjs_html.h\"\n\n" if $module eq "html";
push(@implContent, "${className}::~$className()\n");
my $contextInterfaceName = CreateSVGContextInterfaceName($interfaceName);
+ push(@implContent, "{\n");
if ($contextInterfaceName ne "") {
- push(@implContent, "{\n SVGDocumentExtensions::forgetGenericContext<$contextInterfaceName>(m_impl.get());\n");
- push(@implContent, " ScriptInterpreter::forgetDOMObject(m_impl.get());\n}\n\n");
+ push(@implContent, " SVGDocumentExtensions::forgetGenericContext<$contextInterfaceName>(m_impl.get());\n");
+ push(@implContent, " ScriptInterpreter::forgetDOMObject(m_impl.get());\n");
+ } elsif ($interfaceName eq "Node") {
+ push(@implContent, " ScriptInterpreter::forgetDOMNodeForDocument(m_impl->document(), m_impl.get());\n");
} else {
- push(@implContent, "{\n ScriptInterpreter::forgetDOMObject(m_impl.get());\n}\n\n");
+ push(@implContent, " ScriptInterpreter::forgetDOMObject(m_impl.get());\n");
}
+ push(@implContent, "}\n\n");
}
# Document needs a special destructor because it's a special case for caching. It needs
# its own special handling rather than relying on the caching that Node normally does.
if ($interfaceName eq "Document") {
push(@implContent, "${className}::~$className()\n");
- push(@implContent, "{\n ScriptInterpreter::forgetDOMObject(static_cast<${implClassName}*>(m_impl.get()));\n}\n\n");
+ push(@implContent, "{\n ScriptInterpreter::forgetDOMObject(static_cast<${implClassName}*>(impl()));\n}\n\n");
}
# Attributes
$implIncludes{"CSSMutableStyleDeclaration.h"} = 1;
}
+ if ($type eq "NamedNodeMap") {
+ $implIncludes{"NamedAttrMap.h"} = 1;
+ }
+
if ($type eq "EventTarget") {
$implIncludes{"EventTargetNode.h"} = 1;
$implIncludes{"JSEventTargetNode.h"} = 1;
virtual void setNodeValue(const String&, ExceptionCode&);
virtual NodeType nodeType() const = 0;
Node* parentNode() const { return parent(); }
+ Node* parentElement() const { return parent(); } // IE extension
Node* previousSibling() const { return m_previous; }
Node* nextSibling() const { return m_next; }
virtual PassRefPtr<NodeList> childNodes();
module core {
- interface [LegacyParent=KJS::DOMNode, GenerateConstructor, GenerateNativeConverter, GenerateToJS, ObjCCustomInternalImpl] Node {
+ interface [CustomMarkFunction, GenerateConstructor, GenerateNativeConverter, GenerateToJS, ObjCCustomInternalImpl] Node {
// NodeType
const unsigned short ELEMENT_NODE = 1;
const unsigned short ATTRIBUTE_NODE = 2;
const unsigned short DOCUMENT_FRAGMENT_NODE = 11;
const unsigned short NOTATION_NODE = 12;
-#if !defined(LANGUAGE_JAVASCRIPT)
- readonly attribute DOMString nodeName;
+ readonly attribute [ConvertNullStringTo=Null] DOMString nodeName;
// FIXME: the spec says this can also raise on retrieval.
- attribute [ConvertNullToNullString] DOMString nodeValue
+ attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString nodeValue
setter raises(DOMException);
readonly attribute unsigned short nodeType;
readonly attribute NamedNodeMap attributes;
readonly attribute Document ownerDocument;
- [OldStyleObjC] Node insertBefore(in [Return] Node newChild,
- in Node refChild)
+ [OldStyleObjC, Custom] Node insertBefore(in [Return] Node newChild,
+ in Node refChild)
raises(DOMException);
- [OldStyleObjC] Node replaceChild(in Node newChild,
- in [Return] Node oldChild)
+ [OldStyleObjC, Custom] Node replaceChild(in Node newChild,
+ in [Return] Node oldChild)
raises(DOMException);
- Node removeChild(in [Return] Node oldChild)
+ [Custom] Node removeChild(in [Return] Node oldChild)
raises(DOMException);
- Node appendChild(in [Return] Node newChild)
+ [Custom] Node appendChild(in [Return] Node newChild)
raises(DOMException);
+
boolean hasChildNodes();
Node cloneNode(in boolean deep);
void normalize();
// Introduced in DOM Level 2:
[OldStyleObjC] boolean isSupported(in DOMString feature,
- in DOMString version);
- readonly attribute DOMString namespaceURI;
- attribute [ConvertNullToNullString] DOMString prefix
+ in [ConvertNullToNullString] DOMString version);
+
+ readonly attribute [ConvertNullStringTo=Null] DOMString namespaceURI;
+ attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString prefix
setter raises(DOMException);
- readonly attribute DOMString localName;
+ readonly attribute [ConvertNullStringTo=Null] DOMString localName;
+
boolean hasAttributes();
// Introduced in DOM Level 3:
- readonly attribute DOMString baseURI;
+ readonly attribute [ConvertNullStringTo=Null] DOMString baseURI;
// FIXME: the spec says this can also raise on retrieval.
- attribute [ConvertNullToNullString] DOMString textContent
+ attribute [ConvertNullStringTo=Null, ConvertNullToNullString] DOMString textContent
setter raises(DOMException);
boolean isSameNode(in Node other);
boolean isEqualNode(in Node other);
- DOMString lookupPrefix(in DOMString namespaceURI);
- boolean isDefaultNamespace(in DOMString namespaceURI);
- DOMString lookupNamespaceURI(in DOMString prefix);
+ [ConvertNullStringTo=Null] DOMString lookupPrefix(in [ConvertNullToNullString] DOMString namespaceURI);
+ boolean isDefaultNamespace(in [ConvertNullToNullString] DOMString namespaceURI);
+ [ConvertNullStringTo=Null] DOMString lookupNamespaceURI(in [ConvertNullToNullString] DOMString prefix);
-#if !defined(LANGUAGE_OBJECTIVE_C)
+#if 0
// DocumentPosition
const unsigned short DOCUMENT_POSITION_DISCONNECTED = 0x01;
const unsigned short DOCUMENT_POSITION_PRECEDING = 0x02;
in DOMUserData data,
in UserDataHandler handler);
DOMUserData getUserData(in DOMString key);
-#endif /* !defined(LANGUAGE_OBJECTIVE_C) */
-#endif /* !defined(LANGUAGE_JAVASCRIPT) */
+#endif /* 0 */
+
+ // IE extentions
+ readonly attribute Node parentElement;
#if defined(LANGUAGE_OBJECTIVE_C)
// Objective-C extensions
- readonly attribute boolean isContentEditable;
+ readonly attribute boolean isContentEditable;
#endif /* defined(LANGUAGE_OBJECTIVE_C) */
};