mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-05 00:25:27 +00:00
c478236f6f
Implementation of DOM Events from the W3c DOM Level 2 current working draft
61 lines
1.9 KiB
Diff
61 lines
1.9 KiB
Diff
Index: DOMFactory.java
|
|
===================================================================
|
|
RCS file: /cvsroot/mozilla/java/dom/jni/DOMFactory.java,v
|
|
retrieving revision 1.2
|
|
diff -r1.2 DOMFactory.java
|
|
23a24,25
|
|
> import java.util.Vector;
|
|
>
|
|
30a33,37
|
|
> import org.w3c.dom.events.TestEventListener;
|
|
> import org.w3c.dom.events.EventListener;
|
|
> import org.w3c.dom.events.EventTarget;
|
|
> import org.mozilla.dom.NodeImpl;
|
|
>
|
|
76c83,84
|
|
<
|
|
---
|
|
>
|
|
>
|
|
108a117,156
|
|
> if (url.endsWith("test.html")){
|
|
> System.out.println("TestCases Tuned to run with test.html...");
|
|
> Vector v;
|
|
> Object o;
|
|
> Node n;
|
|
> NodeList l;
|
|
> int i;
|
|
> EventListener listener;
|
|
> NodeImpl target;
|
|
> String [] types = {"mouseover", "dblclick", "mouseout", "keydown", "keyup",
|
|
> "mousedown", "mouseup", "click", "keypress",
|
|
> "mousemove", "focus", "blur", "submit", "reset",
|
|
> "change", "select", "input", "load", "unload",
|
|
> "abort", "error", "paint", "create", "destroy",
|
|
> "command", "broadcast", "commandupdate",
|
|
> "dragenter", "dragover", "dragexit", "dragdrop",
|
|
> "draggesture"};
|
|
>
|
|
> listener = new TestEventListener();
|
|
> v = new Vector (20, 10);
|
|
> v.add(doc);
|
|
>
|
|
> while(!v.isEmpty()) {
|
|
> o = v.elementAt(0);
|
|
> if (o instanceof Node) {
|
|
> n = (Node) o;
|
|
> if (n instanceof NodeImpl)
|
|
> for(i=0; i < types.length; i++) {
|
|
> target = (NodeImpl) n;
|
|
> target.addEventListener(types[i], listener, false);
|
|
> // target.removeEventListener(types[i], listener, false);
|
|
> }
|
|
>
|
|
> l = n.getChildNodes();
|
|
> for(i=0; i<l.getLength(); i++)
|
|
> v.add(l.item(i));
|
|
> }
|
|
> v.remove(0);
|
|
> }
|
|
> }
|