Skip to content

Commit

Permalink
1. Keep up with interface change in nsIDocumentLoaderObserver.
Browse files Browse the repository at this point in the history
2. Fix lots of bugs.
3. Implement Entities and Notations.
  • Loading branch information
akhil.arora%sun.com committed Aug 23, 1999
1 parent 7e7bff3 commit cb9bd6e
Show file tree
Hide file tree
Showing 17 changed files with 629 additions and 22 deletions.
49 changes: 44 additions & 5 deletions java/dom/TODO
Original file line number Diff line number Diff line change
@@ -1,16 +1,55 @@
o Convert to using IDL and GenericFactories. Once support for
ComponentLoaders is implemented in xpcom, use that to load our
component.

[5d]

o Implement DOM exceptions.

[5d. In Progress. Denis Sharypov <[email protected]>]

o Implement the equals() and hashCode() methods for all DOM
objects. The equals method is to be implemented by doing a
QueryInterface to nsISupports and them comparing pointers to the
native DOM objects.
objects. The equals method is to be implemented by doing a
QueryInterface to nsISupports and them comparing pointers to the
native DOM objects. Similarly, thye hashCode method should do a
QI to nsISupports and then return the pointer.

[2d. In progress, [email protected]]

o Use OJI to obtain the JVM.

[5d. Awaiting OJI availability]

o i18n the API

o Implement DOMEvents from the DOM Level 2 current working draft.

[4w. Assigned. Contact: Sergey Lunegov <[email protected]>]

o Use nsISupportsProxies to work around thread
limitations. This will mean writing an IDL for nsIJavaDOM.h, but
that sould be trivial. Dcumentation for nsISupportsProxies is
available at
http://www.mozilla.org/projects/xpcom/Proxies.html.

[2w. Assigned. Contact: Sergey Lunegov <[email protected]>]

o Eliminate finalize methds from classes that extend Node,
DOMImplementation and NodeList. finalize need only be defined for
these three base classes. Having it defined in the derived classes
is redundant, but not an error.

[1d]

o Go through the spec and for all methods that return null, fix the
api so that no error message is logged. The api works fine, it
just logs some bogus errors. For an example, see
Node.getAttributes.

[2d. Assigned. Contact: Sergey Lunegov <[email protected]>]

o Investigate the possibility of writing a tool that can generate the
JNI code from idl. This is the only practical way to implement the
HTML DOM (because it is too big to hand-code).
JNI code from idl. This is the only practical way to implement the
HTML DOM (because it is too big to hand-code).

[4w+]
5 changes: 4 additions & 1 deletion java/dom/jni/DOMFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ private void dump(PrintStream ps, Node node, int indent, boolean isMapNode) {
/*
Node fc = node.getFirstChild();
if (fc != null)
System.out.println(fc);
System.out.println("firstchild=" + fc.toString());
Node lc = node.getLastChild();
if (lc != null)
System.out.println("lastchild=" + lc.toString());
*/

int length = children.getLength();
Expand Down
31 changes: 31 additions & 0 deletions java/dom/jni/EntityImpl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
The contents of this file are subject to the Mozilla Public License
Version 1.0 (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 Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are Copyright (C) 1999 Sun Microsystems,
Inc. All Rights Reserved.
*/

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();

protected native void finalize();
}
3 changes: 3 additions & 0 deletions java/dom/jni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ CPPSRCS = \
org_mozilla_dom_DocumentTypeImpl.cpp \
org_mozilla_dom_DOMImplementationImpl.cpp \
org_mozilla_dom_ElementImpl.cpp \
org_mozilla_dom_EntityImpl.cpp \
org_mozilla_dom_NamedNodeMapImpl.cpp \
org_mozilla_dom_NodeImpl.cpp \
org_mozilla_dom_NodeListImpl.cpp \
org_mozilla_dom_ProcessingInstructionImpl.cpp \
org_mozilla_dom_TextImpl.cpp

# org_mozilla_dom_NotationImpl.cpp \
include $(topsrcdir)/config/config.mk

include $(topsrcdir)/config/rules.mk
3 changes: 3 additions & 0 deletions java/dom/jni/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ CPPSRCS = \
org_mozilla_dom_DocumentTypeImpl.cpp \
org_mozilla_dom_DOMImplementationImpl.cpp \
org_mozilla_dom_ElementImpl.cpp \
org_mozilla_dom_EntityImpl.cpp \
org_mozilla_dom_NamedNodeMapImpl.cpp \
org_mozilla_dom_NodeImpl.cpp \
org_mozilla_dom_NodeListImpl.cpp \
org_mozilla_dom_ProcessingInstructionImpl.cpp \
org_mozilla_dom_TextImpl.cpp

# org_mozilla_dom_NotationImpl.cpp \
include $(topsrcdir)/config/config.mk

include $(topsrcdir)/config/rules.mk
30 changes: 30 additions & 0 deletions java/dom/jni/NotationImpl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
The contents of this file are subject to the Mozilla Public License
Version 1.0 (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 Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are Copyright (C) 1999 Sun Microsystems,
Inc. All Rights Reserved.
*/

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();

protected native void finalize();
}
Loading

0 comments on commit cb9bd6e

Please sign in to comment.