Element node this attribute is attached to or
+ * null if this attribute is not in use.
+ * @since DOM Level 2
+ */
+ public Element getOwnerElement() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/CDATASectionImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/CDATASectionImpl.java
new file mode 100644
index 00000000000..efe76e90f02
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/CDATASectionImpl.java
@@ -0,0 +1,31 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.CDATASection;
+
+public class CDATASectionImpl extends TextImpl implements CDATASection {
+
+ // instantiated from JNI or Document.createCDATASection()
+ private CDATASectionImpl() {}
+}
+
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/CharacterDataImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/CharacterDataImpl.java
new file mode 100644
index 00000000000..a64e768a2e9
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/CharacterDataImpl.java
@@ -0,0 +1,39 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.CharacterData;
+
+public class CharacterDataImpl extends NodeImpl implements CharacterData {
+
+ // instantiated from JNI only
+ protected CharacterDataImpl() {}
+
+ public native void appendData(String arg);
+ public native void deleteData(int offset, int count);
+ public native String getData();
+ public native int getLength();
+ public native void insertData(int offset, String arg);
+ public native void replaceData(int offset, int count, String arg);
+ public native void setData(String data);
+ public native String substringData(int offset, int count);
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/CommentImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/CommentImpl.java
new file mode 100644
index 00000000000..822b0c84294
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/CommentImpl.java
@@ -0,0 +1,30 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Comment;
+
+public class CommentImpl extends CharacterDataImpl implements Comment {
+
+ // instantiated from JNI or Document.createComment()
+ private CommentImpl() {}
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DOMAccessor.java b/mozilla/java/dom/classes/org/mozilla/dom/DOMAccessor.java
new file mode 100644
index 00000000000..482a9f7d433
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DOMAccessor.java
@@ -0,0 +1,35 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+public interface DOMAccessor {
+ public void addDocumentLoadListener(DocumentLoadListener listener);
+ public void removeDocumentLoadListener(DocumentLoadListener listener);
+
+ /**
+ * The getInstance method is available, it is not declared because
+ * it is a static method and the Java Language Spec does not allow
+ * us to declare a static method in an interface.
+ *
+ * public static synchronized DOMAccessor getInstance();
+ */
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DOMAccessorImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/DOMAccessorImpl.java
new file mode 100644
index 00000000000..786585051ce
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DOMAccessorImpl.java
@@ -0,0 +1,136 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import java.util.Vector;
+import java.util.Enumeration;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class DOMAccessorImpl implements DOMAccessor, DocumentLoadListener {
+
+ private static DOMAccessor instance = null;
+ private Vector documentLoadListeners = new Vector();
+
+ static {
+ System.loadLibrary("javadomjni");
+ }
+
+ private void DOMAccessorImpl() {}
+
+ private static native void register();
+ private static native void unregister();
+ private static native Element getElementByHandle(long p);
+
+ public static synchronized DOMAccessor getInstance() {
+ if (instance == null) {
+ instance = new DOMAccessorImpl();
+ }
+ return instance;
+ }
+
+ public synchronized void
+ addDocumentLoadListener(DocumentLoadListener listener) {
+ if (documentLoadListeners.size() == 0) {
+ register();
+ }
+ documentLoadListeners.addElement(listener);
+ }
+
+ public synchronized void
+ removeDocumentLoadListener(DocumentLoadListener listener) {
+
+ documentLoadListeners.removeElement(listener);
+ if (documentLoadListeners.size() == 0) {
+ unregister();
+ }
+ }
+
+ public synchronized void
+ startURLLoad(String url, String contentType, Document doc) {
+
+ for (Enumeration e = documentLoadListeners.elements();
+ e.hasMoreElements();) {
+ DocumentLoadListener listener =
+ (DocumentLoadListener) e.nextElement();
+ listener.startURLLoad(url, contentType, doc);
+ }
+ }
+
+ public synchronized void
+ endURLLoad(String url, int status, Document doc) {
+
+ for (Enumeration e = documentLoadListeners.elements();
+ e.hasMoreElements();) {
+ DocumentLoadListener listener =
+ (DocumentLoadListener) e.nextElement();
+ listener.endURLLoad(url, status, doc);
+ }
+ }
+
+ public synchronized void
+ progressURLLoad(String url, int progress, int progressMax,
+ Document doc) {
+
+ for (Enumeration e = documentLoadListeners.elements();
+ e.hasMoreElements();) {
+ DocumentLoadListener listener =
+ (DocumentLoadListener) e.nextElement();
+ listener.progressURLLoad(url, progress, progressMax, doc);
+ }
+ }
+
+ public synchronized void
+ statusURLLoad(String url, String message, Document doc) {
+
+ for (Enumeration e = documentLoadListeners.elements();
+ e.hasMoreElements();) {
+ DocumentLoadListener listener =
+ (DocumentLoadListener) e.nextElement();
+ listener.statusURLLoad(url, message, doc);
+ }
+ }
+
+
+ public synchronized void
+ startDocumentLoad(String url) {
+
+ for (Enumeration e = documentLoadListeners.elements();
+ e.hasMoreElements();) {
+ DocumentLoadListener listener =
+ (DocumentLoadListener) e.nextElement();
+ listener.startDocumentLoad(url);
+ }
+ }
+
+ public synchronized void
+ endDocumentLoad(String url, int status, Document doc) {
+
+ for (Enumeration e = documentLoadListeners.elements();
+ e.hasMoreElements();) {
+ DocumentLoadListener listener =
+ (DocumentLoadListener) e.nextElement();
+ listener.endDocumentLoad(url, status, doc);
+ }
+ }
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DOMExceptionImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/DOMExceptionImpl.java
new file mode 100644
index 00000000000..63de9f22902
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DOMExceptionImpl.java
@@ -0,0 +1,32 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.DOMException;
+
+public class DOMExceptionImpl extends DOMException
+{
+ // instantiated from JNI only
+ private DOMExceptionImpl(short code, String message) {
+ super(code, message);
+ }
+}
diff --git a/mozilla/java/dom/nsJavaDOMCID.h b/mozilla/java/dom/classes/org/mozilla/dom/DOMGarbageCollector.java
similarity index 77%
rename from mozilla/java/dom/nsJavaDOMCID.h
rename to mozilla/java/dom/classes/org/mozilla/dom/DOMGarbageCollector.java
index 492378a7903..2c3a0b0349f 100644
--- a/mozilla/java/dom/nsJavaDOMCID.h
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DOMGarbageCollector.java
@@ -19,11 +19,10 @@
Contributor(s):
*/
-#ifndef __nsJavaDOMCID_h__
-#define __nsJavaDOMCID_h__
+package org.mozilla.dom;
-#define NS_JAVADOMFACTORY_CID \
- {0x12c2fa66, 0x0fef, 0x11d3, \
- {0x87, 0x14, 0x00, 0x04, 0xac, 0x56, 0xc4, 0xa5}}
+public class DOMGarbageCollector {
-#endif /* __nsJavaDOMCID_h__ */
+ // private static native void doGC();
+ public static native void doGC();
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DOMImplementationImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/DOMImplementationImpl.java
new file mode 100644
index 00000000000..08e6d0d25a2
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DOMImplementationImpl.java
@@ -0,0 +1,71 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.DOMException;
+
+public class DOMImplementationImpl implements DOMImplementation {
+
+ private long p_nsIDOMDOMImplementation = 0;
+
+ // instantiated from JNI only
+ private DOMImplementationImpl() {}
+
+ public boolean equals(Object o) {
+ if (!(o instanceof NodeListImpl))
+ return false;
+ else
+ return (XPCOM_equals(o));
+ }
+
+ public int hashCode(){
+ return XPCOM_hashCode();
+ }
+
+ public native boolean hasFeature(String feature, String version);
+
+ protected native void finalize();
+
+ private native boolean XPCOM_equals(Object o);
+ private native int XPCOM_hashCode();
+
+ //since DOM2
+ public DocumentType createDocumentType(String qualifiedName, String publicID, String systemID) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Document createDocument(String namespaceURI,
+ String qualifiedName,
+ DocumentType doctype) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public DocumentType createDocumentType(String qualifiedName,
+ String publicId,
+ String systemId,
+ String internalSubset) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DocumentFragmentImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/DocumentFragmentImpl.java
new file mode 100644
index 00000000000..a706924db47
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DocumentFragmentImpl.java
@@ -0,0 +1,29 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.DocumentFragment;
+
+public class DocumentFragmentImpl extends NodeImpl implements DocumentFragment {
+ // instantiated from JNI or Document.createDocumentFragment()
+ private DocumentFragmentImpl() {}
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DocumentImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/DocumentImpl.java
new file mode 100644
index 00000000000..e6e7aa43d09
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DocumentImpl.java
@@ -0,0 +1,89 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.ProcessingInstruction;
+import org.w3c.dom.Text;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.events.DocumentEvent;
+import org.w3c.dom.events.Event;
+import org.w3c.dom.DOMException;
+
+public class DocumentImpl extends NodeImpl implements Document, DocumentEvent {
+
+ // instantiated from JNI only
+ private DocumentImpl() {}
+ public DocumentImpl(long p) {
+ super(p);
+ }
+
+ public native Attr createAttribute(String name);
+ public native CDATASection createCDATASection(String data);
+ public native Comment createComment(String data);
+ public native DocumentFragment createDocumentFragment();
+ public native Element createElement(String tagName);
+ public native EntityReference createEntityReference(String name);
+ public native ProcessingInstruction
+ createProcessingInstruction(String target,
+ String data);
+ public native Text createTextNode(String data);
+
+ public native DocumentType getDoctype();
+ public native Element getDocumentElement();
+ public native NodeList getElementsByTagName(String tagName);
+ public native DOMImplementation getImplementation();
+ public Event createEvent(String type) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node importNode(Node importedNode, boolean deep) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Element createElementNS(String namespaceURI, String qualifiedName)
+ throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr createAttributeNS(String namespaceURI, String qualifiedName)
+ throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Element getElementById(String elementId) {
+ throw new UnsupportedOperationException();
+ };
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DocumentLoadListener.java b/mozilla/java/dom/classes/org/mozilla/dom/DocumentLoadListener.java
new file mode 100644
index 00000000000..f75fd0f7248
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DocumentLoadListener.java
@@ -0,0 +1,36 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Document;
+
+public interface DocumentLoadListener {
+
+ public void startURLLoad(String url, String contentType, Document doc);
+ public void endURLLoad(String url, int status, Document doc);
+ public void progressURLLoad(String url, int progress, int progressMax,
+ Document doc);
+ public void statusURLLoad(String url, String message, Document doc);
+
+ public void startDocumentLoad(String url);
+ public void endDocumentLoad(String url, int status, Document doc);
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/DocumentTypeImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/DocumentTypeImpl.java
new file mode 100644
index 00000000000..c85b8d19791
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/DocumentTypeImpl.java
@@ -0,0 +1,49 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.NamedNodeMap;
+
+public class DocumentTypeImpl extends NodeImpl implements DocumentType {
+
+ // instantiated from JNI only
+ private DocumentTypeImpl() {}
+
+ public native String getName();
+ public native NamedNodeMap getEntities();
+ public native NamedNodeMap getNotations();
+
+ //since DOM level 2
+
+ public String getPublicId() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getSystemId() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getInternalSubset() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/ElementImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/ElementImpl.java
new file mode 100644
index 00000000000..c2a36e292b8
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/ElementImpl.java
@@ -0,0 +1,79 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.DOMException;
+
+public class ElementImpl extends NodeImpl implements Element {
+
+ // instantiated from JNI or Document.createElement()
+ private ElementImpl() {}
+
+ public native String getAttribute(String name);
+ public native Attr getAttributeNode(String name);
+ public native NodeList getElementsByTagName(String name);
+ public native String getTagName();
+ public native void normalize();
+ public native void removeAttribute(String name);
+ public native Attr removeAttributeNode(Attr oldAttr);
+ public native void setAttribute(String name, String value);
+ public native Attr setAttributeNode(Attr newAttr);
+
+ //since DOM2
+ public String getAttributeNS(String namespaceURI, String localName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttributeNS(String namespaceURI, String localName,
+ String value) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void removeAttributeNS(String namespacURI, String localName)
+ throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr getAttributeNodeNS(String namespaceURI, String localName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Attr setAttributeNodeNS(Attr newAttr) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasAttribute(String name) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean hasAttributeNS(String namespaceURI,
+ String localName) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/EntityImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/EntityImpl.java
new file mode 100644
index 00000000000..ab6e6290458
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/EntityImpl.java
@@ -0,0 +1,34 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Entity;
+
+public class EntityImpl extends NodeImpl implements Entity {
+
+ // instantiated from JNI only
+ private EntityImpl() {}
+
+ public native String getPublicId();
+ public native String getSystemId();
+ public native String getNotationName();
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/EntityReferenceImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/EntityReferenceImpl.java
new file mode 100644
index 00000000000..f3081e41577
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/EntityReferenceImpl.java
@@ -0,0 +1,30 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.EntityReference;
+
+public class EntityReferenceImpl extends NodeImpl implements EntityReference {
+
+ // instantiated from JNI or Document.createEntityReference()
+ private EntityReferenceImpl() {}
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/NamedNodeMapImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/NamedNodeMapImpl.java
new file mode 100644
index 00000000000..7f801e2cc13
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/NamedNodeMapImpl.java
@@ -0,0 +1,53 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.DOMException;
+
+public class NamedNodeMapImpl extends NodeImpl implements NamedNodeMap {
+
+ // instantiated from JNI only
+ private NamedNodeMapImpl() {}
+
+ public native int getLength();
+ public native Node getNamedItem(String name);
+ public native Node item(int index);
+ public native Node removeNamedItem(String name);
+ public native Node setNamedItem(Node arg);
+
+
+ public Node getNamedItemNS(String namespaceURI, String localName) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node removeNamedItemNS(String namespaceURI, String name)
+ throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Node setNamedItemNS(Node arg)
+ throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/NodeImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/NodeImpl.java
new file mode 100644
index 00000000000..fa7d1a5b06b
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/NodeImpl.java
@@ -0,0 +1,233 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Document;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.events.Event;
+import org.w3c.dom.events.EventTarget;
+import org.w3c.dom.events.EventListener;
+import java.util.Vector;
+import java.util.Hashtable;
+
+class NodeEventListener {
+ EventListener listener = null;
+ String type = null;
+ boolean useCapture = false;
+ long nativeListener = 0;
+
+ NodeEventListener(String aType, EventListener aListener,
+ boolean aUseCapture, long aNativeListener) {
+ type = aType;
+ listener = aListener;
+ useCapture = aUseCapture;
+ nativeListener = aNativeListener;
+ }
+
+ public boolean equals(Object o) {
+ if (!(o instanceof NodeEventListener))
+ return false;
+ else {
+ NodeEventListener n = (NodeEventListener) o;
+ if ((useCapture != n.useCapture)
+ || (type == null) || !type.equals(n.type)
+ || (listener == null) || !listener.equals(n.listener))
+ return false;
+ else
+ return true;
+ }
+ }
+}
+
+public class NodeImpl implements Node, EventTarget {
+
+ /* The derived classes (Attr, CharacterData, DocumentFragment,
+ Document, Element, EntityReference, NamedNodeMap,
+ ProcessingInstruction) will also use this native pointer, since
+ the nsIDOM coreDom classes follow the same hierarchy */
+
+ private long p_nsIDOMNode = 0;
+
+ // this map stores association of java DOM listeners
+ // with corresponding native Nodes
+ static private Hashtable javaDOMlisteners = new Hashtable();
+
+ // instantiated from JNI only
+ protected NodeImpl() {}
+ protected NodeImpl(long p) {
+ p_nsIDOMNode = p;
+ }
+
+ public boolean equals(Object o) {
+ if (!(o instanceof NodeImpl))
+ return false;
+ else
+ return (XPCOM_equals(o));
+ }
+
+ public int hashCode(){
+ return XPCOM_hashCode();
+ }
+
+ public String toString() {
+ return "<" + getNodeName() +
+ " t=" + nodeTypeString(getNodeType()) +
+ " c=org.mozilla.dom.NodeImpl p=" +
+ Long.toHexString(p_nsIDOMNode) + ">";
+ }
+
+ private static String nodeTypeString(int type) {
+ switch (type) {
+ case Node.ELEMENT_NODE: return "ELEMENT";
+ case Node.ATTRIBUTE_NODE: return "ATTRIBUTE";
+ case Node.TEXT_NODE: return "TEXT";
+ case Node.CDATA_SECTION_NODE: return "CDATA_SECTION";
+ case Node.ENTITY_REFERENCE_NODE: return "ENTITY_REFERENCE";
+ case Node.ENTITY_NODE: return "ENTITY";
+ case Node.PROCESSING_INSTRUCTION_NODE: return "PROCESSING_INSTRUCTION";
+ case Node.COMMENT_NODE: return "COMMENT";
+ case Node.DOCUMENT_NODE: return "DOCUMENT";
+ case Node.DOCUMENT_TYPE_NODE: return "DOCUMENT_TYPE";
+ case Node.DOCUMENT_FRAGMENT_NODE: return "DOCUMENT_FRAGMENT";
+ case Node.NOTATION_NODE: return "NOTATION";
+ }
+ return "ERROR";
+ }
+
+ public native Node appendChild(Node newChild) throws DOMException;
+ public native Node cloneNode(boolean deep);
+ public native NamedNodeMap getAttributes();
+ public native NodeList getChildNodes();
+ public native Node getFirstChild();
+ public native Node getLastChild();
+ public native Node getNextSibling();
+ public native String getNodeName();
+ public native short getNodeType();
+ public native String getNodeValue();
+ public native Document getOwnerDocument();
+ public native Node getParentNode();
+ public native Node getPreviousSibling();
+ public native boolean hasChildNodes();
+ public native Node insertBefore(Node newChild, Node refChild) throws DOMException;
+ public native Node removeChild(Node oldChild) throws DOMException;
+ public native Node replaceChild(Node newChild, Node oldChild) throws DOMException;
+ public native void setNodeValue(String nodeValue);
+
+ protected native void finalize();
+
+ private native boolean XPCOM_equals(Object o);
+ private native int XPCOM_hashCode();
+
+ //since DOM level 2
+ public boolean supports(String feature, String version) {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getNamespaceURI() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getPrefix() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setPrefix(String prefix) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getLocalName() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addEventListener(String type,
+ EventListener listener,
+ boolean useCapture) {
+
+ long nativeListener = addNativeEventListener(type, listener, useCapture);
+
+ Long lnode = new Long(p_nsIDOMNode);
+
+ Vector listeners;
+
+ //in conjunction with internal synchronization of Hashtable and Vector
+ // this should be enough for safe concurrent access
+ synchronized (javaDOMlisteners) {
+ listeners = (Vector) javaDOMlisteners.get(lnode);
+
+ if (listeners == null) {
+ listeners = new Vector();
+ javaDOMlisteners.put(lnode, listeners);
+ }
+ }
+
+ if (nativeListener != 0) {
+
+ NodeEventListener l = new NodeEventListener(type,
+ listener,
+ useCapture,
+ nativeListener);
+ listeners.add(l);
+ }
+ }
+
+ public void removeEventListener(String type,
+ EventListener listener,
+ boolean useCapture) {
+
+ Vector listeners = (Vector) javaDOMlisteners.get(new Long(p_nsIDOMNode));
+
+ if (listeners == null)
+ return;
+
+ NodeEventListener l = new NodeEventListener(type,
+ listener, useCapture, 0);
+
+ int idx = listeners.indexOf(l);
+
+ //if trying to remove non-existing listener then return
+ if (idx == -1)
+ return;
+
+ l = (NodeEventListener) listeners.remove(idx);
+
+ removeNativeEventListener(type, l.nativeListener, useCapture);
+ }
+
+ public boolean dispatchEvent(Event evt) throws DOMException {
+ throw new UnsupportedOperationException();
+ }
+
+ private native long addNativeEventListener(String type,
+ EventListener listener,
+ boolean useCapture);
+
+ private native void removeNativeEventListener(String type,
+ long nativeListener,
+ boolean useCapture);
+
+ public void normalize() {
+ throw new UnsupportedOperationException();
+ };
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/NodeListImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/NodeListImpl.java
new file mode 100644
index 00000000000..f46e03e1115
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/NodeListImpl.java
@@ -0,0 +1,52 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class NodeListImpl implements NodeList {
+
+ private long p_nsIDOMNodeList = 0;
+
+ // instantiated from JNI or Document.createAttribute()
+ private NodeListImpl() {}
+
+ public boolean equals(Object o) {
+ if (!(o instanceof NodeListImpl))
+ return false;
+ else
+ return (XPCOM_equals(o));
+ }
+
+ public int hashCode(){
+ return XPCOM_hashCode();
+ }
+
+ public native int getLength();
+ public native Node item(int index);
+
+ protected native void finalize();
+
+ private native boolean XPCOM_equals(Object o);
+ private native int XPCOM_hashCode();
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/NotationImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/NotationImpl.java
new file mode 100644
index 00000000000..461fe5c563a
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/NotationImpl.java
@@ -0,0 +1,33 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.Notation;
+
+public class NotationImpl extends NodeImpl implements Notation {
+
+ // instantiated from JNI only
+ private NotationImpl() {}
+
+ public native String getPublicId();
+ public native String getSystemId();
+}
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/ProcessingInstructionImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/ProcessingInstructionImpl.java
new file mode 100644
index 00000000000..a46deefcab7
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/ProcessingInstructionImpl.java
@@ -0,0 +1,34 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom;
+
+import org.w3c.dom.ProcessingInstruction;
+
+public class ProcessingInstructionImpl extends NodeImpl implements ProcessingInstruction {
+
+ // instantiated from JNI or Document.createProcessingInstruction()
+ private ProcessingInstructionImpl() {}
+
+ public native String getData();
+ public native String getTarget();
+ public native void setData(String data);
+}
diff --git a/mozilla/java/dom/nsJavaDOMFactory.h b/mozilla/java/dom/classes/org/mozilla/dom/TextImpl.java
similarity index 59%
rename from mozilla/java/dom/nsJavaDOMFactory.h
rename to mozilla/java/dom/classes/org/mozilla/dom/TextImpl.java
index b501b3addf6..165f23abfc3 100644
--- a/mozilla/java/dom/nsJavaDOMFactory.h
+++ b/mozilla/java/dom/classes/org/mozilla/dom/TextImpl.java
@@ -19,27 +19,15 @@
Contributor(s):
*/
-#ifndef __nsJavaDOMFactory_h__
-#define __nsJavaDOMFactory_h__
+package org.mozilla.dom;
-#include "nsIFactory.h"
+import org.w3c.dom.Text;
-#define NS_JAVADOMFACTORY_IID \
- {0x6a07c434, 0x0e58, 0x11d3, \
- {0x86, 0xea, 0x00, 0x04, 0xac, 0x56, 0xc4, 0xa5}}
+public class TextImpl extends CharacterDataImpl implements Text {
-class nsJavaDOMFactory : public nsIFactory {
- NS_DECL_ISUPPORTS
+ // instantiated from JNI or Document.createTextNode()
+ protected TextImpl() {}
- public:
+ public native Text splitText(int offset);
+}
- nsJavaDOMFactory();
-
- NS_IMETHOD CreateInstance(nsISupports* aOuter,
- const nsIID& iid,
- void** retval);
-
- NS_IMETHOD LockFactory(PRBool lock);
-};
-
-#endif /* __nsJavaDOMFactory_h__ */
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/events/EventImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/events/EventImpl.java
new file mode 100644
index 00000000000..b7b6f986c0d
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/events/EventImpl.java
@@ -0,0 +1,162 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom.events;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.events.Event;
+import org.w3c.dom.events.EventTarget;
+
+/**
+ * The Event interface is used to provide contextual information
+ * about an event to the handler processing the event. An object which
+ * implements the Event interface is generally passed as the
+ * first parameter to an event handler. More specific context information
+ * is passed to event handlers by deriving additional interfaces from
+ * Event which contain information directly relating to the type
+ * of event they accompany. These derived interfaces are also implemented by
+ * the object passed to the event listener.
+ * @since DOM Level 2
+ */
+public class EventImpl implements Event {
+
+ protected long p_nsIDOMEvent = 0;
+
+ // instantiated from JNI only
+ protected EventImpl() {}
+
+ public String toString() {
+ return "type property represents the event name as a string
+ * property.
+ */
+ public native String getType();
+
+ /**
+ * The target property indicates the EventTarget
+ * to which the event was originally dispatched.
+ */
+ public native EventTarget getTarget();
+
+ /**
+ * The currentNode property indicates the Node
+ * whose EventListeners are currently being processed. This
+ * is particularly useful during capturing and bubbling.
+ */
+ public native Node getCurrentNode();
+
+ /**
+ * The eventPhase property indicates which phase of event flow
+ * is currently being evaluated.
+ */
+ public native short getEventPhase();
+
+ /**
+ * The bubbles property indicates whether or not an event is a
+ * bubbling event. If the event can bubble the value is true, else the
+ * value is false.
+ */
+ public boolean getBubbles() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * The cancelable property indicates whether or not an event
+ * can have its default action prevented. If the default action can be
+ * prevented the value is true, else the value is false.
+ */
+ public boolean getCancelable() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * The preventBubble method is used to end the bubbling phase
+ * of event flow. If this method is called by any
+ * EventListeners registered on the same
+ * EventTarget during bubbling, the bubbling phase will cease
+ * at that level and the event will not be propagated upward within the
+ * tree.
+ */
+ public native void preventBubble();
+
+ /**
+ * The preventCapture method is used to end the capturing phase
+ * of event flow. If this method is called by any
+ * EventListeners registered on the same
+ * EventTarget during capturing, the capturing phase will
+ * cease at that level and the event will not be propagated any further
+ * down.
+ */
+ public native void preventCapture();
+
+ /**
+ * If an event is cancelable, the preventCapture method is used
+ * to signify that the event is to be canceled, meaning any default action
+ * normally taken by the implementation as a result of the event will not
+ * occur. If, during any stage of event flow, the
+ * preventDefault method is called the event is canceled. Any
+ * default action associated with the event will not occur. Calling this
+ * method for a non-cancelable event has no effect. Once
+ * preventDefault has been called it will remain in effect
+ * throughout the remainder of the event's propagation.
+ */
+ public native void preventDefault();
+
+ /**
+ * The stopPropagation method is used prevent further
+ * propagation of an event during event flow. If this method is called by
+ * any EventListener the event will cease propagating
+ * through the tree. The event will complete dispatch to all listeners
+ * on the current EventTarget before event flow stops. This
+ * method may be used during any stage of event flow.
+ */
+ public void stopPropagation() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ *
+ * @param eventTypeArg Specifies the event type. This type may be any event
+ * type currently defined in this specification or a new event type. Any
+ * new event type must not begin with any upper, lower, or mixed case
+ * version of the string "DOM". This prefix is reserved for future DOM
+ * event sets.
+ * @param canBubbleArg Specifies whether or not the event can bubble.
+ * @param cancelableArg Specifies whether or not the event's default action
+ * can be prevented.
+ */
+ public void initEvent(String eventTypeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg) {
+ throw new UnsupportedOperationException();
+ }
+
+ public long getTimeStamp() {
+ throw new UnsupportedOperationException();
+ }
+}
+
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/events/MouseEventImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/events/MouseEventImpl.java
new file mode 100644
index 00000000000..636e1601829
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/events/MouseEventImpl.java
@@ -0,0 +1,163 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom.events;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.views.AbstractView;
+import org.w3c.dom.events.MouseEvent;
+
+/**
+ * The MouseEvent interface provides specific contextual
+ * information associated with Mouse events.
+ * The detail attribute inherited from UIEvent
+ * indicates the number of times a mouse button has been pressed and released
+ * over the same screen location during a user action. The attribute value
+ * is 1 when the user begins this action and increments by 1 for each full
+ * sequence of pressing and releasing. If the user moves the mouse between
+ * the mousedown and mouseup the value will be set to 0, indicating that no
+ * click is occurring.
+ * @since DOM Level 2
+ */
+public class MouseEventImpl extends UIEventImpl implements MouseEvent {
+
+ // instantiated from JNI only
+ private MouseEventImpl() {}
+
+ public String toString() {
+ return "screenX indicates the horizontal coordinate at which the
+ * event occurred in relative to the origin of the screen coordinate system.
+ */
+ public native int getScreenX();
+
+ /**
+ * screenY indicates the vertical coordinate at which the event
+ * occurred relative to the origin of the screen coordinate system.
+ */
+ public native int getScreenY();
+
+ /**
+ * clientX indicates the horizontal coordinate at which the
+ * event occurred relative to the DOM implementation's client area.
+ */
+ public native int getClientX();
+
+ /**
+ * clientY indicates the vertical coordinate at which the event
+ * occurred relative to the DOM implementation's client area.
+ */
+ public native int getClientY();
+
+ /**
+ * ctrlKey indicates whether the 'ctrl' key was depressed
+ * during the firing of the event.
+ */
+ public native boolean getCtrlKey();
+
+ /**
+ * shiftKey indicates whether the 'shift' key was depressed
+ * during the firing of the event.
+ */
+ public native boolean getShiftKey();
+
+ /**
+ * altKey indicates whether the 'alt' key was depressed during
+ * the firing of the event. On some platforms this key may map to an
+ * alternative key name.
+ */
+ public native boolean getAltKey();
+
+ /**
+ * metaKey indicates whether the 'meta' key was depressed
+ * during the firing of the event. On some platforms this key may map to
+ * an alternative key name.
+ */
+ public native boolean getMetaKey();
+
+ /**
+ * During mouse events caused by the depression or release of a mouse
+ * button, button is used to indicate which mouse button
+ * changed state.
+ */
+ public native short getButton();
+
+ /**
+ * relatedNode is used to identify a secondary node related to
+ * a UI event.
+ */
+ public Node getRelatedNode() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ *
+ * @param typeArg Specifies the event type.
+ * @param canBubbleArg Specifies whether or not the event can bubble.
+ * @param cancelableArg Specifies whether or not the event's default action
+ * can be prevent.
+ * @param viewArg Specifies the Event's
+ * AbstractView.
+ * @param detailArg Specifies the Event's mouse click count.
+ * @param screenXArg Specifies the Event's screen x coordinate
+ * @param screenYArg Specifies the Event's screen y coordinate
+ * @param clientXArg Specifies the Event's client x coordinate
+ * @param clientYArg Specifies the Event's client y coordinate
+ * @param ctrlKeyArg Specifies whether or not control key was depressed
+ * during the Event.
+ * @param altKeyArg Specifies whether or not alt key was depressed during
+ * the Event.
+ * @param shiftKeyArg Specifies whether or not shift key was depressed
+ * during the Event.
+ * @param metaKeyArg Specifies whether or not meta key was depressed during
+ * the Event.
+ * @param buttonArg Specifies the Event's mouse button.
+ * @param relatedNodeArg Specifies the Event's related Node.
+ */
+ public void initMouseEvent(String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ AbstractView viewArg,
+ int detailArg,
+ int screenXArg,
+ int screenYArg,
+ int clientXArg,
+ int clientYArg,
+ boolean ctrlKeyArg,
+ boolean altKeyArg,
+ boolean shiftKeyArg,
+ boolean metaKeyArg,
+ short buttonArg,
+ Node relatedNodeArg) {
+ throw new UnsupportedOperationException();
+ }
+}
+
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/events/MutationEventImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/events/MutationEventImpl.java
new file mode 100644
index 00000000000..62a9212662d
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/events/MutationEventImpl.java
@@ -0,0 +1,89 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom.events;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.events.MutationEvent;
+import org.mozilla.dom.events.EventImpl;
+
+public class MutationEventImpl extends EventImpl implements MutationEvent {
+ /**
+ * relatedNode is used to identify a secondary node related to
+ * a mutation event. For example, if a mutation event is dispatched to a
+ * node indicating that its parent has changed, the relatedNode
+ * is the changed parent. If an event is instead dispatch to a subtree
+ * indicating a node was changed within it, the relatedNode is
+ * the changed node.
+ */
+ public Node getRelatedNode() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * prevValue indicates the previous value of text nodes and
+ * attributes in attrModified and charDataModified events.
+ */
+ public String getPrevValue() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * newValue indicates the new value of text nodes and
+ * attributes in attrModified and charDataModified events.
+ */
+ public String getNewValue() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * attrName indicates the changed attr in the attrModified
+ * event.
+ */
+ public String getAttrName() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ *
+ * @param typeArg Specifies the event type.
+ * @param canBubbleArg Specifies whether or not the event can bubble.
+ * @param cancelableArg Specifies whether or not the event's default action
+ * can be prevent.
+ * @param relatedNodeArg Specifies the Event's related Node
+ * @param prevValueArg Specifies the Event's
+ * prevValue property
+ * @param newValueArg Specifies the Event's
+ * newValue property
+ * @param attrNameArg Specifies the Event's
+ * attrName property
+ */
+ public void initMutationEvent(String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ Node relatedNodeArg,
+ String prevValueArg,
+ String newValueArg,
+ String attrNameArg) {
+ throw new UnsupportedOperationException();
+ }
+}
+
diff --git a/mozilla/java/dom/classes/org/mozilla/dom/events/UIEventImpl.java b/mozilla/java/dom/classes/org/mozilla/dom/events/UIEventImpl.java
new file mode 100644
index 00000000000..f7fc6b1c438
--- /dev/null
+++ b/mozilla/java/dom/classes/org/mozilla/dom/events/UIEventImpl.java
@@ -0,0 +1,80 @@
+/*
+ The contents of this file are subject to the Mozilla Public
+ License Version 1.1 (the "License"); you may not use this file
+ except in compliance with the License. You may obtain a copy of
+ the License at http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS
+ IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ implied. See the License for the specific language governing
+ rights and limitations under the License.
+
+ The Original Code is mozilla.org code.
+
+ The Initial Developer of the Original Code is Sun Microsystems,
+ Inc. Portions created by Sun are
+ Copyright (C) 1999 Sun Microsystems, Inc. All
+ Rights Reserved.
+
+ Contributor(s):
+*/
+
+package org.mozilla.dom.events;
+
+import org.w3c.dom.events.UIEvent;
+import org.w3c.dom.views.AbstractView;
+import org.mozilla.dom.events.EventImpl;
+
+/**
+ * The UIEvent interface provides specific contextual
+ * information associated with User Interface events.
+ * @since DOM Level 2
+ */
+public class UIEventImpl extends EventImpl implements UIEvent {
+
+ // instantiated from JNI only
+ protected UIEventImpl() {}
+
+ public String toString() {
+ return "view attribute identifies the AbstractView
+ * from which the event was generated.
+ */
+ public AbstractView getView() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Specifies some detail information about the Event, depending
+ * on the type of event.
+ */
+ public int getDetail() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ *
+ * @param typeArg Specifies the event type.
+ * @param canBubbleArg Specifies whether or not the event can bubble.
+ * @param cancelableArg Specifies whether or not the event's default action
+ * can be prevent.
+ * @param viewArg Specifies the Event's
+ * AbstractView.
+ * @param detailArg Specifies the Event's detail.
+ */
+ public void initUIEvent(String typeArg,
+ boolean canBubbleArg,
+ boolean cancelableArg,
+ AbstractView viewArg,
+ int detailArg) {
+ throw new UnsupportedOperationException();
+ }
+}
+
diff --git a/mozilla/java/dom/jni/Makefile b/mozilla/java/dom/jni/Makefile
index 9bd2339820c..bbe67c5fb29 100644
--- a/mozilla/java/dom/jni/Makefile
+++ b/mozilla/java/dom/jni/Makefile
@@ -55,10 +55,3 @@ include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
-libs:: classes
-
-#XXX - assume that DOM2 java-bindings are in CLASSPATH
-classes: $(JAVA_DESTPATH)
- @echo "Making java classes ..."
- $(JAVAHOME)/bin/javac -d $(JAVA_DESTPATH) *.java
-
diff --git a/mozilla/java/dom/jni/Makefile.in b/mozilla/java/dom/jni/Makefile.in
index 9734aeca201..844bde2c6d3 100644
--- a/mozilla/java/dom/jni/Makefile.in
+++ b/mozilla/java/dom/jni/Makefile.in
@@ -56,10 +56,3 @@ include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
-libs:: classes
-
-#XXX - assume that DOM2 java-bindings are in CLASSPATH
-classes: $(JAVA_DESTPATH)
- @echo "Making java classes ..."
- $(JAVAHOME)/bin/javac -d $(JAVA_DESTPATH) *.java
-
diff --git a/mozilla/java/dom/jni/makefile.win b/mozilla/java/dom/jni/makefile.win
index 35255e761cb..a7968b13365 100755
--- a/mozilla/java/dom/jni/makefile.win
+++ b/mozilla/java/dom/jni/makefile.win
@@ -93,13 +93,6 @@ LLIBS= \
include <$(DEPTH)\config\config.mak>
include <$(DEPTH)\config\rules.mak>
-export:: classes
-
-#XXX - assume that DOM2 java-bindings are in CLASSPATH
-classes:
- @echo "Making java classes ..."
- $(JDKHOME)\bin\javac -d $(JAVA_DESTPATH) *.java
-
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
diff --git a/mozilla/java/dom/makefile.win b/mozilla/java/dom/makefile.win
index 41a7a85a78b..aeee17fe30d 100755
--- a/mozilla/java/dom/makefile.win
+++ b/mozilla/java/dom/makefile.win
@@ -1,5 +1,4 @@
-#!nmake
-#
+#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
@@ -19,67 +18,15 @@
#
# Contributor(s):
-DEPTH=..\..
-IGNORE_MANIFEST=1
-DIRS = jni
+IGNORE_MANIFEST=1
+#//------------------------------------------------------------------------
+#//
+#// Specify the depth of the current directory relative to the
+#// root of NS
+#//
+#//------------------------------------------------------------------------
+DEPTH = ..\..
-DEFINES=-D_IMPL_NS_WEB -DWIN32_LEAN_AND_MEAN
-!ifdef JAVA_DOM_OJI_ENABLE
-DEFINES=$(DEFINES) -DJAVA_DOM_OJI_ENABLE
-!endif
-MODULE=javadom
-IS_COMPONENT=1
-LIBRARY_NAME=libjavadom
-
-CPPSRCS= \
-!ifdef JAVA_DOM_OJI_ENABLE
- JavaDOMSecurityContext.cpp \
-!endif
- nsJavaDOMImpl.cpp \
- $(NULL)
-
-CPP_OBJS= \
-!ifdef JAVA_DOM_OJI_ENABLE
- .\$(OBJDIR)\JavaDOMSecurityContext.obj \
-!endif
- .\$(OBJDIR)\nsJavaDOMImpl.obj \
- $(NULL)
-
-EXPORTS = \
- nsIJavaDOM.h
-
-!ifndef JAVA_DOM_OJI_ENABLE
-LINCS= \
- -I$(JDKHOME)\include \
- -I$(JDKHOME)\include\win32
-!endif
-
-MAKE_OBJ_TYPE = DLL
-DLLNAME = javadom
-DLL=.\$(OBJDIR)\$(DLLNAME).dll
-
-LCFLAGS = \
- $(LCFLAGS) \
- $(DEFINES) \
- $(NULL)
-
-LLIBS= \
-!ifdef JAVA_DOM_OJI_ENABLE
- $(DIST)\lib\oji.lib \
-!else
- $(JDKHOME)\lib\jvm.lib \
-!endif
- $(DIST)\lib\xpcom.lib \
- $(LIBNSPR)
-
-include <$(DEPTH)\config\config.mak>
+DIRS = src jni classes
include <$(DEPTH)\config\rules.mak>
-
-install:: $(DLL)
- $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
- $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
-
-clobber::
- rm -f $(DIST)\bin\components\$(DLLNAME).dll
- rm -f $(DIST)\lib\$(DLLNAME).lib
diff --git a/mozilla/java/dom/nsIJavaDOM.h b/mozilla/java/dom/nsIJavaDOM.h
deleted file mode 100644
index 2dcee05e036..00000000000
--- a/mozilla/java/dom/nsIJavaDOM.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Sun Microsystems,
- Inc. Portions created by Sun are
- Copyright (C) 1999 Sun Microsystems, Inc. All
- Rights Reserved.
-
- Contributor(s):
-*/
-
-#ifndef __nsIJavaDOM_h__
-#define __nsIJavaDOM_h__
-
-#include "nsISupports.h"
-#include "nsString.h"
-#include "nsIDocumentLoaderObserver.h"
-#include "jni.h"
-
-class nsIURI;
-
-/* {9cc0ca50-0e31-11d3-8a61-0004ac56c4a5} */
-#define NS_IJAVADOM_IID_STR "9cc0ca50-0e31-11d3-8a61-0004ac56c4a5"
-#define NS_IJAVADOM_IID \
- {0x9cc0ca50, 0x0e31, 0x11d3, \
- { 0x8a, 0x61, 0x00, 0x04, 0xac, 0x56, 0xc4, 0xa5 }}
-#define NS_JAVADOM_CID \
- {0xd6b2e820, 0x9113, 0x11d3, \
- { 0x9c, 0x11, 0x0, 0x10, 0x5a , 0xe3, 0x80 , 0x1e }}
-
-class nsIJavaDOM : public nsIDocumentLoaderObserver {
- public:
- NS_DEFINE_STATIC_IID_ACCESSOR(NS_IJAVADOM_IID)
-
- /* nsIDocumentLoaderObserver methods */
- NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
- nsIURI* aURL,
- const char* aCommand) = 0;
-
- NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
- nsIChannel* channel,
- nsresult aStatus) = 0;
-
- NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
- nsIChannel* channel) = 0;
-
- NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
- nsIChannel* channel,
- PRUint32 aProgress,
- PRUint32 aProgressMax) = 0;
-
- NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
- nsIChannel* channel,
- nsString& aMsg) = 0;
-
- NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
- nsIChannel* channel,
- nsresult aStatus) = 0;
-
- NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
- nsIChannel* channel,
- const char *aContentType,
- const char *aCommand) = 0;
-};
-extern nsresult
-NS_NewJavaDOM(nsIJavaDOM** aJavaDOM);
-
-#endif /* __nsIJavaDOM_h__ */
diff --git a/mozilla/java/dom/nsJavaDOMFactory.cpp b/mozilla/java/dom/nsJavaDOMFactory.cpp
deleted file mode 100644
index 9d7a55b561e..00000000000
--- a/mozilla/java/dom/nsJavaDOMFactory.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Sun Microsystems,
- Inc. Portions created by Sun are
- Copyright (C) 1999 Sun Microsystems, Inc. All
- Rights Reserved.
-
- Contributor(s):
-*/
-
-#include "pratom.h"
-#include "nsCOMPtr.h"
-#include "nsIServiceManager.h"
-
-#include "nsJavaDOMCID.h"
-#include "nsJavaDOMImpl.h"
-#include "nsJavaDOMFactory.h"
-
-static PRInt32 gLockCount = 0;
-
-static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
-static NS_DEFINE_IID(kJavaDOMFactoryCID, NS_JAVADOMFACTORY_CID);
-static NS_DEFINE_IID(kJavaDOMFactoryIID, NS_JAVADOMFACTORY_IID);
-
-NS_IMPL_ISUPPORTS(nsJavaDOMFactory, kJavaDOMFactoryIID)
-
-nsJavaDOMFactory::nsJavaDOMFactory()
-{
- NS_INIT_REFCNT();
-}
-
-nsresult nsJavaDOMFactory::CreateInstance(nsISupports* aOuter,
- const nsIID& aIID,
- void** aResult)
-{
- if (aOuter != NULL)
- return NS_ERROR_NO_AGGREGATION;
-
- if (aResult == NULL)
- return NS_ERROR_NULL_POINTER;
-
- *aResult = NULL;
-
- nsISupports* inst = new nsJavaDOMImpl();
- if (inst == NULL)
- return NS_ERROR_OUT_OF_MEMORY;
-
- nsresult res = inst->QueryInterface(aIID, aResult);
- if (NS_FAILED(res))
- delete inst;
-
- return res;
-}
-
-nsresult nsJavaDOMFactory::LockFactory(PRBool aLock)
-{
- if (aLock)
- PR_AtomicIncrement(&gLockCount);
- else
- PR_AtomicDecrement(&gLockCount);
- return NS_OK;
-}
-
-extern "C"
-NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
- const nsCID& aClass,
- const char* aClassName,
- const char* aProgID,
- nsIFactory** aFactory)
-{
- if (aFactory == NULL)
- return NS_ERROR_NULL_POINTER;
-
- *aFactory = NULL;
- nsISupports *inst = NULL;
- static NS_DEFINE_IID(kJavaDOMFactoryCID, NS_JAVADOMFACTORY_CID);
- if (aClass.Equals(kJavaDOMFactoryCID))
- inst = new nsJavaDOMFactory();
- else
- return NS_ERROR_ILLEGAL_VALUE;
-
- if (inst == NULL)
- return NS_ERROR_OUT_OF_MEMORY;
-
- nsresult res = inst->QueryInterface(kJavaDOMFactoryIID,
- (void**) aFactory);
- if (res != NS_OK)
- delete inst;
-
- return res;
-}
-
-extern "C"
-NS_EXPORT PRBool NSCanUnload(nsISupports* serviceMgr)
-{
- return (PRBool) (gLockCount == 0);
-}
-
-extern "C"
-NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char* aPath)
-{
- nsresult rv;
- nsCOMPtr