示例#1
0
  public static void build(State s) {
    PROTOTYPE = new ObjectLabel(DOMObjects.MOUSE_EVENT_PROTOTYPE, ObjectLabel.Kind.OBJECT);
    INSTANCES = new ObjectLabel(DOMObjects.MOUSE_EVENT_INSTANCES, ObjectLabel.Kind.OBJECT);

    // Prototype object
    s.newObject(PROTOTYPE);
    s.writeInternalPrototype(PROTOTYPE, Value.makeObject(UIEvent.PROTOTYPE));

    // Multiplied object
    s.newObject(INSTANCES);
    s.writeInternalPrototype(INSTANCES, Value.makeObject(PROTOTYPE));

    /*
     * Properties.
     */
    createDOMProperty(s, INSTANCES, "screenX", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "screenY", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "clientX", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "clientY", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "ctrlKey", Value.makeAnyBool().setReadOnly());
    createDOMProperty(s, INSTANCES, "shiftKey", Value.makeAnyBool().setReadOnly());
    createDOMProperty(s, INSTANCES, "altKey", Value.makeAnyBool().setReadOnly());
    createDOMProperty(s, INSTANCES, "metaKey", Value.makeAnyBool().setReadOnly());
    createDOMProperty(s, INSTANCES, "button", Value.makeAnyNumUInt().setReadOnly());
    createDOMProperty(
        s, INSTANCES, "relatedTarget", DOMFunctions.makeAnyHTMLElement().setReadOnly());

    // DOM Level 0
    createDOMProperty(s, INSTANCES, "offsetX", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "offsetY", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "layerX", Value.makeAnyNum().setReadOnly());
    createDOMProperty(s, INSTANCES, "layerY", Value.makeAnyNum().setReadOnly());

    /*
     * Functions.
     */
    createDOMFunction(s, PROTOTYPE, DOMObjects.MOUSE_EVENT_INIT_MOUSE_EVENT, "initMouseEvent", 15);

    // Multiplied Object
    s.multiplyObject(INSTANCES);
    INSTANCES = INSTANCES.makeSingleton().makeSummary();

    // DOM Registry
    DOMRegistry.registerMouseEventLabel(INSTANCES);
  }
示例#2
0
  public static void build(State s) {
    CONSTRUCTOR =
        new ObjectLabel(DOMObjects.HTMLBASEELEMENT_CONSTRUCTOR, ObjectLabel.Kind.FUNCTION);
    PROTOTYPE = new ObjectLabel(DOMObjects.HTMLBASEELEMENT_PROTOTYPE, ObjectLabel.Kind.OBJECT);
    INSTANCES = new ObjectLabel(DOMObjects.HTMLBASEELEMENT_INSTANCES, ObjectLabel.Kind.OBJECT);

    // Constructor Object
    s.newObject(CONSTRUCTOR);
    s.writePropertyWithAttributes(
        CONSTRUCTOR, "length", Value.makeNum(0).setAttributes(true, true, true));
    s.writePropertyWithAttributes(
        CONSTRUCTOR, "prototype", Value.makeObject(PROTOTYPE).setAttributes(true, true, true));
    s.writeInternalPrototype(CONSTRUCTOR, Value.makeObject(InitialStateBuilder.OBJECT_PROTOTYPE));
    s.writeProperty(DOMWindow.WINDOW, "HTMLBaseElement", Value.makeObject(CONSTRUCTOR));

    // Prototype Object
    s.newObject(PROTOTYPE);
    s.writeInternalPrototype(PROTOTYPE, Value.makeObject(HTMLElement.ELEMENT_PROTOTYPE));

    // Multiplied Object
    s.newObject(INSTANCES);
    s.writeInternalPrototype(INSTANCES, Value.makeObject(PROTOTYPE));

    /*
     * Properties.
     */
    // DOM LEVEL 1
    createDOMProperty(s, INSTANCES, "href", Value.makeAnyStr());
    createDOMProperty(s, INSTANCES, "target", Value.makeAnyStr());

    s.multiplyObject(INSTANCES);
    INSTANCES = INSTANCES.makeSingleton().makeSummary();

    /*
     * Functions.
     */
    // No functions.
  }
示例#3
0
  public static void build(State s) {
    DOMNodeList.build(s);
    DOMNode.build(s);
    DOMAttr.build(s);
    DOMNamedNodeMap.build(s);
    DOMDocumentType.build(s);
    DOMException.build(s);
    DOMElement.build(s);
    DOMCharacterData.build(s);
    DOMText.build(s);
    DOMConfiguration.build(s);
    DOMNotation.build(s);
    DOMCDataSection.build(s);
    DOMComment.build(s);
    DOMEntity.build(s);
    DOMEntityReference.build(s);
    DOMProcessingInstruction.build(s);
    DOMStringList.build(s);
    DOMDocumentFragment.build(s);

    // Document
    DOMDocument.build(s);
    DOMImplementation.build(s);

    // Set the remaining properties on DOMNode, due to circularity, and
    // summarize.
    createDOMProperty(
        s,
        DOMNode.PROTOTYPE,
        "attributes",
        Value.makeObject(
            DOMNamedNodeMap.INSTANCES, new Dependency(), new DependencyGraphReference()),
        DOMSpec.LEVEL_1);
    createDOMProperty(
        s,
        DOMNode.PROTOTYPE,
        "ownerDocument",
        Value.makeObject(DOMDocument.INSTANCES, new Dependency(), new DependencyGraphReference()),
        DOMSpec.LEVEL_1);
    s.multiplyObject(DOMNode.INSTANCES);
    DOMNode.INSTANCES = DOMNode.INSTANCES.makeSingleton().makeSummary();
  }