[HtmlUnit] SVN: [14345] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[HtmlUnit] SVN: [14345] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ javascript

asashour-2
Revision: 14345
          http://sourceforge.net/p/htmlunit/code/14345
Author:   asashour
Date:     2017-05-04 08:47:42 +0000 (Thu, 04 May 2017)
Log Message:
-----------
delete EventNode

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java

Removed Paths:
-------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/EventNode.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/configuration/JavaScriptConfiguration.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -183,7 +183,6 @@
 import com.gargoylesoftware.htmlunit.javascript.host.dom.Document;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.DocumentFragment;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.DocumentType;
-import com.gargoylesoftware.htmlunit.javascript.host.dom.EventNode;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.IdleDeadline;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.MutationObserver;
@@ -451,7 +450,7 @@
         DOMPointReadOnly.class, DOMRectReadOnly.class, DOMRequest.class,
         DOMSettableTokenList.class, DOMStringList.class, DOMStringMap.class, DOMTokenList.class,
         DragEvent.class, DynamicsCompressorNode.class,
-        Element.class, Enumerator.class, ErrorEvent.class, Event.class, EventNode.class, EventSource.class,
+        Element.class, Enumerator.class, ErrorEvent.class, Event.class, EventSource.class,
         EventTarget.class, EXT_texture_filter_anisotropic.class, External.class, FederatedCredential.class,
         File.class, FileList.class, FileReader.class,
         FileSystem.class, FileSystemDirectoryEntry.class, FileSystemDirectoryReader.class,

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Element.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -61,7 +61,6 @@
 import com.gargoylesoftware.htmlunit.javascript.host.dom.Attr;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.DOMTokenList;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.Document;
-import com.gargoylesoftware.htmlunit.javascript.host.dom.EventNode;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.Node;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.NodeList;
 import com.gargoylesoftware.htmlunit.javascript.host.dom.TextRange;
@@ -88,7 +87,7 @@
  * @author Frank Danek
  */
 @JsxClass(domClass = DomElement.class)
-public class Element extends EventNode {
+public class Element extends Node {
 
     static final String POSITION_BEFORE_BEGIN = "beforebegin";
     static final String POSITION_AFTER_BEGIN = "afterbegin";
@@ -303,12 +302,12 @@
     }
 
     /**
-     * Returns true when the current element has any attributes or not.
-     * @return true if an attribute is specified on this element
+     * {@inheritDoc}
      */
-    @JsxFunction
+    @Override
+    @JsxFunction({CHROME, FF})
     public boolean hasAttributes() {
-        return getDomNodeOrDie().hasAttributes();
+        return super.hasAttributes();
     }
 
     /**
@@ -1114,12 +1113,12 @@
     }
 
     /**
-     * Returns the element ID.
-     * @return the ID of this element
+     * {@inheritDoc}
      */
-    @JsxGetter
+    @Override
+    @JsxGetter({CHROME, FF})
     public String getId() {
-        return getDomNodeOrDie().getId();
+        return super.getId();
     }
 
     /**

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -1131,6 +1131,24 @@
     }
 
     /**
+     * Sets the value of the {@code onblur} event handler.
+     * @param onblur the new handler
+     */
+    @JsxSetter
+    public void setOnblur(final Object onblur) {
+        getEventListenersContainer().setEventHandler(Event.TYPE_BLUR, onblur);
+    }
+
+    /**
+     * Returns the {@code onblur} property (not necessary a function if something else has been set).
+     * @return the {@code onblur} property
+     */
+    @JsxGetter
+    public Object getOnblur() {
+        return getHandlerForJavaScript(Event.TYPE_BLUR);
+    }
+
+    /**
      * Sets the value of the {@code onclick} event handler.
      * @param onclick the new handler
      */
@@ -2336,4 +2354,5 @@
             }
         }
     }
+
 }

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Document.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -117,6 +117,7 @@
 
 import net.sourceforge.htmlunit.corejs.javascript.Callable;
 import net.sourceforge.htmlunit.corejs.javascript.Context;
+import net.sourceforge.htmlunit.corejs.javascript.Function;
 import net.sourceforge.htmlunit.corejs.javascript.FunctionObject;
 import net.sourceforge.htmlunit.corejs.javascript.NativeFunction;
 import net.sourceforge.htmlunit.corejs.javascript.Scriptable;
@@ -144,7 +145,7 @@
  * @see <a href="http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-7068919">W3C Dom Level 1</a>
  */
 @JsxClass
-public class Document extends EventNode {
+public class Document extends Node {
 
     private static final Log LOG = LogFactory.getLog(Document.class);
     private static final Pattern TAG_NAME_PATTERN = Pattern.compile("\\w+");
@@ -1382,4 +1383,346 @@
         domain_ = newDomain;
     }
 
+    /**
+     * Sets the {@code onclick} event handler for this element.
+     * @param handler the {@code onclick} event handler for this element
+     */
+    @JsxSetter
+    public void setOnclick(final Object handler) {
+        setEventHandler("onclick", handler);
+    }
+
+    /**
+     * Returns the {@code onclick} event handler for this element.
+     * @return the {@code onclick} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnclick() {
+        return getEventHandlerProp("onclick");
+    }
+
+    /**
+     * Sets the {@code ondblclick} event handler for this element.
+     * @param handler the {@code ondblclick} event handler for this element
+     */
+    @JsxSetter
+    public void setOndblclick(final Object handler) {
+        setEventHandler("ondblclick", handler);
+    }
+
+    /**
+     * Returns the {@code ondblclick} event handler for this element.
+     * @return the {@code ondblclick} event handler for this element
+     */
+    @JsxGetter
+    public Object getOndblclick() {
+        return getEventHandlerProp("ondblclick");
+    }
+
+    /**
+     * Sets the {@code onblur} event handler for this element.
+     * @param handler the {@code onblur} event handler for this element
+     */
+    @JsxSetter
+    public void setOnblur(final Object handler) {
+        setEventHandler("onblur", handler);
+    }
+
+    /**
+     * Returns the {@code onblur} event handler for this element.
+     * @return the {@code onblur} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnblur() {
+        return getEventHandlerProp("onblur");
+    }
+
+    /**
+     * Sets the {@code onfocus} event handler for this element.
+     * @param handler the {@code onfocus} event handler for this element
+     */
+    @JsxSetter
+    public void setOnfocus(final Object handler) {
+        setEventHandler("onfocus", handler);
+    }
+
+    /**
+     * Returns the {@code onfocus} event handler for this element.
+     * @return the {@code onfocus} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnfocus() {
+        return getEventHandlerProp("onfocus");
+    }
+
+    /**
+     * Sets the {@code onfocusin} event handler for this element.
+     * @param handler the {@code onfocusin} event handler for this element
+     */
+    @JsxSetter(IE)
+    public void setOnfocusin(final Object handler) {
+        setEventHandler("onfocusin", handler);
+    }
+
+    /**
+     * Returns the {@code onfocusin} event handler for this element.
+     * @return the {@code onfocusin} event handler for this element
+     */
+    @JsxGetter(IE)
+    public Object getOnfocusin() {
+        return getEventHandlerProp("onfocusin");
+    }
+
+    /**
+     * Sets the {@code onfocusout} event handler for this element.
+     * @param handler the {@code onfocusout} event handler for this element
+     */
+    @JsxSetter(IE)
+    public void setOnfocusout(final Object handler) {
+        setEventHandler("onfocusout", handler);
+    }
+
+    /**
+     * Returns the {@code onfocusout} event handler for this element.
+     * @return the {@code onfocusout} event handler for this element
+     */
+    @JsxGetter(IE)
+    public Object getOnfocusout() {
+        return getEventHandlerProp("onfocusout");
+    }
+
+    /**
+     * Sets the {@code onkeydown} event handler for this element.
+     * @param handler the {@code onkeydown} event handler for this element
+     */
+    @JsxSetter
+    public void setOnkeydown(final Object handler) {
+        setEventHandler("onkeydown", handler);
+    }
+
+    /**
+     * Returns the {@code onkeydown} event handler for this element.
+     * @return the {@code onkeydown} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnkeydown() {
+        return getEventHandlerProp("onkeydown");
+    }
+
+    /**
+     * Sets the {@code onkeypress} event handler for this element.
+     * @param handler the {@code onkeypress} event handler for this element
+     */
+    @JsxSetter
+    public void setOnkeypress(final Object handler) {
+        setEventHandler("onkeypress", handler);
+    }
+
+    /**
+     * Returns the {@code onkeypress} event handler for this element.
+     * @return the {@code onkeypress} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnkeypress() {
+        return getEventHandlerProp("onkeypress");
+    }
+
+    /**
+     * Sets the {@code onkeyup} event handler for this element.
+     * @param handler the {@code onkeyup} event handler for this element
+     */
+    @JsxSetter
+    public void setOnkeyup(final Object handler) {
+        setEventHandler("onkeyup", handler);
+    }
+
+    /**
+     * Returns the {@code onkeyup} event handler for this element.
+     * @return the {@code onkeyup} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnkeyup() {
+        return getEventHandlerProp("onkeyup");
+    }
+
+    /**
+     * Sets the {@code onmousedown} event handler for this element.
+     * @param handler the {@code onmousedown} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmousedown(final Object handler) {
+        setEventHandler("onmousedown", handler);
+    }
+
+    /**
+     * Returns the {@code onmousedown} event handler for this element.
+     * @return the {@code onmousedown} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmousedown() {
+        return getEventHandlerProp("onmousedown");
+    }
+
+    /**
+     * Sets the {@code onmousemove} event handler for this element.
+     * @param handler the {@code onmousemove} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmousemove(final Object handler) {
+        setEventHandler("onmousemove", handler);
+    }
+
+    /**
+     * Returns the {@code onmousemove} event handler for this element.
+     * @return the {@code onmousemove} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmousemove() {
+        return getEventHandlerProp("onmousemove");
+    }
+
+    /**
+     * Sets the {@code onmouseout} event handler for this element.
+     * @param handler the {@code onmouseout} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmouseout(final Object handler) {
+        setEventHandler("onmouseout", handler);
+    }
+
+    /**
+     * Returns the {@code onmouseout} event handler for this element.
+     * @return the {@code onmouseout} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmouseout() {
+        return getEventHandlerProp("onmouseout");
+    }
+
+    /**
+     * Sets the {@code onmouseover} event handler for this element.
+     * @param handler the {@code onmouseover} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmouseover(final Object handler) {
+        setEventHandler("onmouseover", handler);
+    }
+
+    /**
+     * Returns the {@code onmouseover} event handler for this element.
+     * @return the {@code onmouseover} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmouseover() {
+        return getEventHandlerProp("onmouseover");
+    }
+
+    /**
+     * Sets the {@code onmouseup} event handler for this element.
+     * @param handler the {@code onmouseup} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmouseup(final Object handler) {
+        setEventHandler("onmouseup", handler);
+    }
+
+    /**
+     * Returns the {@code onmouseup} event handler for this element.
+     * @return the {@code onmouseup} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmouseup() {
+        return getEventHandlerProp("onmouseup");
+    }
+
+    /**
+     * Sets the {@code oncontextmenu} event handler for this element.
+     * @param handler the {@code oncontextmenu} event handler for this element
+     */
+    @JsxSetter
+    public void setOncontextmenu(final Object handler) {
+        setEventHandler("oncontextmenu", handler);
+    }
+
+    /**
+     * Returns the {@code oncontextmenu} event handler for this element.
+     * @return the {@code oncontextmenu} event handler for this element
+     */
+    @JsxGetter
+    public Object getOncontextmenu() {
+        return getEventHandlerProp("oncontextmenu");
+    }
+
+    /**
+     * Sets the {@code onresize} event handler for this element.
+     * @param handler the {@code onresize} event handler for this element
+     */
+    @JsxSetter
+    public void setOnresize(final Object handler) {
+        setEventHandler("onresize", handler);
+    }
+
+    /**
+     * Returns the {@code onresize} event handler for this element.
+     * @return the {@code onresize} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnresize() {
+        return getEventHandlerProp("onresize");
+    }
+
+    /**
+     * Sets the {@code onpropertychange} event handler for this element.
+     * @param handler the {@code onpropertychange} event handler for this element
+     */
+    @JsxSetter(IE)
+    public void setOnpropertychange(final Object handler) {
+        setEventHandler("onpropertychange", handler);
+    }
+
+    /**
+     * Returns the {@code onpropertychange} event handler for this element.
+     * @return the {@code onpropertychange} event handler for this element
+     */
+    @JsxGetter(IE)
+    public Object getOnpropertychange() {
+        return getEventHandlerProp("onpropertychange");
+    }
+
+    /**
+     * Sets the {@code onerror} event handler for this element.
+     * @param handler the {@code onerror} event handler for this element
+     */
+    @JsxSetter
+    public void setOnerror(final Object handler) {
+        setEventHandler("onerror", handler);
+    }
+
+    /**
+     * Returns the {@code onerror} event handler for this element.
+     * @return the {@code onerror} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnerror() {
+        return getEventHandlerProp("onerror");
+    }
+
+    /**
+     * Returns the {@code oninput} event handler for this element.
+     * @return the {@code oninput} event handler for this element
+     */
+    @JsxGetter
+    public Function getOninput() {
+        return getEventHandler("oninput");
+    }
+
+    /**
+     * Sets the {@code oninput} event handler for this element.
+     * @param onchange the {@code oninput} event handler for this element
+     */
+    @JsxSetter
+    public void setOninput(final Object onchange) {
+        setEventHandler("oninput", onchange);
+    }
+
 }

Deleted: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/EventNode.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/EventNode.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/EventNode.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -1,379 +0,0 @@
-/*
- * Copyright (c) 2002-2017 Gargoyle Software Inc.
- *
- * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gargoylesoftware.htmlunit.javascript.host.dom;
-
-import static com.gargoylesoftware.htmlunit.javascript.configuration.SupportedBrowser.IE;
-
-import com.gargoylesoftware.htmlunit.javascript.configuration.JsxClass;
-import com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter;
-import com.gargoylesoftware.htmlunit.javascript.configuration.JsxSetter;
-
-import net.sourceforge.htmlunit.corejs.javascript.Function;
-
-/**
- * A node which supports all of the <tt>onXXX</tt> event handlers and other event-related functions.
- *
- * Basically contains any event-related features that both elements and the document support.
- *
- * @author Daniel Gredler
- * @author Ahmed Ashour
- * @author Frank Danek
- */
-@JsxClass(isJSObject = false)
-public class EventNode extends Node {
-
-    /**
-     * Sets the {@code onclick} event handler for this element.
-     * @param handler the {@code onclick} event handler for this element
-     */
-    @JsxSetter
-    public void setOnclick(final Object handler) {
-        setEventHandler("onclick", handler);
-    }
-
-    /**
-     * Returns the {@code onclick} event handler for this element.
-     * @return the {@code onclick} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnclick() {
-        return getEventHandlerProp("onclick");
-    }
-
-    /**
-     * Sets the {@code ondblclick} event handler for this element.
-     * @param handler the {@code ondblclick} event handler for this element
-     */
-    @JsxSetter
-    public void setOndblclick(final Object handler) {
-        setEventHandler("ondblclick", handler);
-    }
-
-    /**
-     * Returns the {@code ondblclick} event handler for this element.
-     * @return the {@code ondblclick} event handler for this element
-     */
-    @JsxGetter
-    public Object getOndblclick() {
-        return getEventHandlerProp("ondblclick");
-    }
-
-    /**
-     * Sets the {@code onblur} event handler for this element.
-     * @param handler the {@code onblur} event handler for this element
-     */
-    @JsxSetter
-    public void setOnblur(final Object handler) {
-        setEventHandler("onblur", handler);
-    }
-
-    /**
-     * Returns the {@code onblur} event handler for this element.
-     * @return the {@code onblur} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnblur() {
-        return getEventHandlerProp("onblur");
-    }
-
-    /**
-     * Sets the {@code onfocus} event handler for this element.
-     * @param handler the {@code onfocus} event handler for this element
-     */
-    @JsxSetter
-    public void setOnfocus(final Object handler) {
-        setEventHandler("onfocus", handler);
-    }
-
-    /**
-     * Returns the {@code onfocus} event handler for this element.
-     * @return the {@code onfocus} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnfocus() {
-        return getEventHandlerProp("onfocus");
-    }
-
-    /**
-     * Sets the {@code onfocusin} event handler for this element.
-     * @param handler the {@code onfocusin} event handler for this element
-     */
-    @JsxSetter(IE)
-    public void setOnfocusin(final Object handler) {
-        setEventHandler("onfocusin", handler);
-    }
-
-    /**
-     * Returns the {@code onfocusin} event handler for this element.
-     * @return the {@code onfocusin} event handler for this element
-     */
-    @JsxGetter(IE)
-    public Object getOnfocusin() {
-        return getEventHandlerProp("onfocusin");
-    }
-
-    /**
-     * Sets the {@code onfocusout} event handler for this element.
-     * @param handler the {@code onfocusout} event handler for this element
-     */
-    @JsxSetter(IE)
-    public void setOnfocusout(final Object handler) {
-        setEventHandler("onfocusout", handler);
-    }
-
-    /**
-     * Returns the {@code onfocusout} event handler for this element.
-     * @return the {@code onfocusout} event handler for this element
-     */
-    @JsxGetter(IE)
-    public Object getOnfocusout() {
-        return getEventHandlerProp("onfocusout");
-    }
-
-    /**
-     * Sets the {@code onkeydown} event handler for this element.
-     * @param handler the {@code onkeydown} event handler for this element
-     */
-    @JsxSetter
-    public void setOnkeydown(final Object handler) {
-        setEventHandler("onkeydown", handler);
-    }
-
-    /**
-     * Returns the {@code onkeydown} event handler for this element.
-     * @return the {@code onkeydown} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnkeydown() {
-        return getEventHandlerProp("onkeydown");
-    }
-
-    /**
-     * Sets the {@code onkeypress} event handler for this element.
-     * @param handler the {@code onkeypress} event handler for this element
-     */
-    @JsxSetter
-    public void setOnkeypress(final Object handler) {
-        setEventHandler("onkeypress", handler);
-    }
-
-    /**
-     * Returns the {@code onkeypress} event handler for this element.
-     * @return the {@code onkeypress} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnkeypress() {
-        return getEventHandlerProp("onkeypress");
-    }
-
-    /**
-     * Sets the {@code onkeyup} event handler for this element.
-     * @param handler the {@code onkeyup} event handler for this element
-     */
-    @JsxSetter
-    public void setOnkeyup(final Object handler) {
-        setEventHandler("onkeyup", handler);
-    }
-
-    /**
-     * Returns the {@code onkeyup} event handler for this element.
-     * @return the {@code onkeyup} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnkeyup() {
-        return getEventHandlerProp("onkeyup");
-    }
-
-    /**
-     * Sets the {@code onmousedown} event handler for this element.
-     * @param handler the {@code onmousedown} event handler for this element
-     */
-    @JsxSetter
-    public void setOnmousedown(final Object handler) {
-        setEventHandler("onmousedown", handler);
-    }
-
-    /**
-     * Returns the {@code onmousedown} event handler for this element.
-     * @return the {@code onmousedown} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnmousedown() {
-        return getEventHandlerProp("onmousedown");
-    }
-
-    /**
-     * Sets the {@code onmousemove} event handler for this element.
-     * @param handler the {@code onmousemove} event handler for this element
-     */
-    @JsxSetter
-    public void setOnmousemove(final Object handler) {
-        setEventHandler("onmousemove", handler);
-    }
-
-    /**
-     * Returns the {@code onmousemove} event handler for this element.
-     * @return the {@code onmousemove} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnmousemove() {
-        return getEventHandlerProp("onmousemove");
-    }
-
-    /**
-     * Sets the {@code onmouseout} event handler for this element.
-     * @param handler the {@code onmouseout} event handler for this element
-     */
-    @JsxSetter
-    public void setOnmouseout(final Object handler) {
-        setEventHandler("onmouseout", handler);
-    }
-
-    /**
-     * Returns the {@code onmouseout} event handler for this element.
-     * @return the {@code onmouseout} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnmouseout() {
-        return getEventHandlerProp("onmouseout");
-    }
-
-    /**
-     * Sets the {@code onmouseover} event handler for this element.
-     * @param handler the {@code onmouseover} event handler for this element
-     */
-    @JsxSetter
-    public void setOnmouseover(final Object handler) {
-        setEventHandler("onmouseover", handler);
-    }
-
-    /**
-     * Returns the {@code onmouseover} event handler for this element.
-     * @return the {@code onmouseover} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnmouseover() {
-        return getEventHandlerProp("onmouseover");
-    }
-
-    /**
-     * Sets the {@code onmouseup} event handler for this element.
-     * @param handler the {@code onmouseup} event handler for this element
-     */
-    @JsxSetter
-    public void setOnmouseup(final Object handler) {
-        setEventHandler("onmouseup", handler);
-    }
-
-    /**
-     * Returns the {@code onmouseup} event handler for this element.
-     * @return the {@code onmouseup} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnmouseup() {
-        return getEventHandlerProp("onmouseup");
-    }
-
-    /**
-     * Sets the {@code oncontextmenu} event handler for this element.
-     * @param handler the {@code oncontextmenu} event handler for this element
-     */
-    @JsxSetter
-    public void setOncontextmenu(final Object handler) {
-        setEventHandler("oncontextmenu", handler);
-    }
-
-    /**
-     * Returns the {@code oncontextmenu} event handler for this element.
-     * @return the {@code oncontextmenu} event handler for this element
-     */
-    @JsxGetter
-    public Object getOncontextmenu() {
-        return getEventHandlerProp("oncontextmenu");
-    }
-
-    /**
-     * Sets the {@code onresize} event handler for this element.
-     * @param handler the {@code onresize} event handler for this element
-     */
-    @JsxSetter
-    public void setOnresize(final Object handler) {
-        setEventHandler("onresize", handler);
-    }
-
-    /**
-     * Returns the {@code onresize} event handler for this element.
-     * @return the {@code onresize} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnresize() {
-        return getEventHandlerProp("onresize");
-    }
-
-    /**
-     * Sets the {@code onpropertychange} event handler for this element.
-     * @param handler the {@code onpropertychange} event handler for this element
-     */
-    @JsxSetter(IE)
-    public void setOnpropertychange(final Object handler) {
-        setEventHandler("onpropertychange", handler);
-    }
-
-    /**
-     * Returns the {@code onpropertychange} event handler for this element.
-     * @return the {@code onpropertychange} event handler for this element
-     */
-    @JsxGetter(IE)
-    public Object getOnpropertychange() {
-        return getEventHandlerProp("onpropertychange");
-    }
-
-    /**
-     * Sets the {@code onerror} event handler for this element.
-     * @param handler the {@code onerror} event handler for this element
-     */
-    @JsxSetter
-    public void setOnerror(final Object handler) {
-        setEventHandler("onerror", handler);
-    }
-
-    /**
-     * Returns the {@code onerror} event handler for this element.
-     * @return the {@code onerror} event handler for this element
-     */
-    @JsxGetter
-    public Object getOnerror() {
-        return getEventHandlerProp("onerror");
-    }
-
-    /**
-     * Returns the {@code oninput} event handler for this element.
-     * @return the {@code oninput} event handler for this element
-     */
-    @JsxGetter
-    public Function getOninput() {
-        return getEventHandler("oninput");
-    }
-
-    /**
-     * Sets the {@code oninput} event handler for this element.
-     * @param onchange the {@code oninput} event handler for this element
-     */
-    @JsxSetter
-    public void setOninput(final Object onchange) {
-        setEventHandler("oninput", onchange);
-    }
-
-}

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/dom/Node.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -744,4 +744,23 @@
         }
         return getDomNodeOrDie().getPage().getUrl().toExternalForm();
     }
+
+    /**
+     * Returns true when the current element has any attributes or not.
+     * @return true if an attribute is specified on this element
+     */
+    @JsxFunction(IE)
+    public boolean hasAttributes() {
+        return getDomNodeOrDie().hasAttributes();
+    }
+
+    /**
+     * Returns the element ID.
+     * @return the ID of this element
+     */
+    @JsxGetter(IE)
+    public String getId() {
+        return "";
+    }
+
 }

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java 2017-05-04 08:22:50 UTC (rev 14344)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLElement.java 2017-05-04 08:47:42 UTC (rev 14345)
@@ -2166,4 +2166,347 @@
         }
         return getWindow().getComputedStyle(this, null);
     }
+
+    /**
+     * Sets the {@code onclick} event handler for this element.
+     * @param handler the {@code onclick} event handler for this element
+     */
+    @JsxSetter
+    public void setOnclick(final Object handler) {
+        setEventHandler("onclick", handler);
+    }
+
+    /**
+     * Returns the {@code onclick} event handler for this element.
+     * @return the {@code onclick} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnclick() {
+        return getEventHandlerProp("onclick");
+    }
+
+    /**
+     * Sets the {@code ondblclick} event handler for this element.
+     * @param handler the {@code ondblclick} event handler for this element
+     */
+    @JsxSetter
+    public void setOndblclick(final Object handler) {
+        setEventHandler("ondblclick", handler);
+    }
+
+    /**
+     * Returns the {@code ondblclick} event handler for this element.
+     * @return the {@code ondblclick} event handler for this element
+     */
+    @JsxGetter
+    public Object getOndblclick() {
+        return getEventHandlerProp("ondblclick");
+    }
+
+    /**
+     * Sets the {@code onblur} event handler for this element.
+     * @param handler the {@code onblur} event handler for this element
+     */
+    @JsxSetter
+    public void setOnblur(final Object handler) {
+        setEventHandler("onblur", handler);
+    }
+
+    /**
+     * Returns the {@code onblur} event handler for this element.
+     * @return the {@code onblur} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnblur() {
+        return getEventHandlerProp("onblur");
+    }
+
+    /**
+     * Sets the {@code onfocus} event handler for this element.
+     * @param handler the {@code onfocus} event handler for this element
+     */
+    @JsxSetter
+    public void setOnfocus(final Object handler) {
+        setEventHandler("onfocus", handler);
+    }
+
+    /**
+     * Returns the {@code onfocus} event handler for this element.
+     * @return the {@code onfocus} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnfocus() {
+        return getEventHandlerProp("onfocus");
+    }
+
+    /**
+     * Sets the {@code onfocusin} event handler for this element.
+     * @param handler the {@code onfocusin} event handler for this element
+     */
+    @JsxSetter(IE)
+    public void setOnfocusin(final Object handler) {
+        setEventHandler("onfocusin", handler);
+    }
+
+    /**
+     * Returns the {@code onfocusin} event handler for this element.
+     * @return the {@code onfocusin} event handler for this element
+     */
+    @JsxGetter(IE)
+    public Object getOnfocusin() {
+        return getEventHandlerProp("onfocusin");
+    }
+
+    /**
+     * Sets the {@code onfocusout} event handler for this element.
+     * @param handler the {@code onfocusout} event handler for this element
+     */
+    @JsxSetter(IE)
+    public void setOnfocusout(final Object handler) {
+        setEventHandler("onfocusout", handler);
+    }
+
+    /**
+     * Returns the {@code onfocusout} event handler for this element.
+     * @return the {@code onfocusout} event handler for this element
+     */
+    @JsxGetter(IE)
+    public Object getOnfocusout() {
+        return getEventHandlerProp("onfocusout");
+    }
+
+    /**
+     * Sets the {@code onkeydown} event handler for this element.
+     * @param handler the {@code onkeydown} event handler for this element
+     */
+    @JsxSetter
+    public void setOnkeydown(final Object handler) {
+        setEventHandler("onkeydown", handler);
+    }
+
+    /**
+     * Returns the {@code onkeydown} event handler for this element.
+     * @return the {@code onkeydown} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnkeydown() {
+        return getEventHandlerProp("onkeydown");
+    }
+
+    /**
+     * Sets the {@code onkeypress} event handler for this element.
+     * @param handler the {@code onkeypress} event handler for this element
+     */
+    @JsxSetter
+    public void setOnkeypress(final Object handler) {
+        setEventHandler("onkeypress", handler);
+    }
+
+    /**
+     * Returns the {@code onkeypress} event handler for this element.
+     * @return the {@code onkeypress} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnkeypress() {
+        return getEventHandlerProp("onkeypress");
+    }
+
+    /**
+     * Sets the {@code onkeyup} event handler for this element.
+     * @param handler the {@code onkeyup} event handler for this element
+     */
+    @JsxSetter
+    public void setOnkeyup(final Object handler) {
+        setEventHandler("onkeyup", handler);
+    }
+
+    /**
+     * Returns the {@code onkeyup} event handler for this element.
+     * @return the {@code onkeyup} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnkeyup() {
+        return getEventHandlerProp("onkeyup");
+    }
+
+    /**
+     * Sets the {@code onmousedown} event handler for this element.
+     * @param handler the {@code onmousedown} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmousedown(final Object handler) {
+        setEventHandler("onmousedown", handler);
+    }
+
+    /**
+     * Returns the {@code onmousedown} event handler for this element.
+     * @return the {@code onmousedown} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmousedown() {
+        return getEventHandlerProp("onmousedown");
+    }
+
+    /**
+     * Sets the {@code onmousemove} event handler for this element.
+     * @param handler the {@code onmousemove} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmousemove(final Object handler) {
+        setEventHandler("onmousemove", handler);
+    }
+
+    /**
+     * Returns the {@code onmousemove} event handler for this element.
+     * @return the {@code onmousemove} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmousemove() {
+        return getEventHandlerProp("onmousemove");
+    }
+
+    /**
+     * Sets the {@code onmouseout} event handler for this element.
+     * @param handler the {@code onmouseout} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmouseout(final Object handler) {
+        setEventHandler("onmouseout", handler);
+    }
+
+    /**
+     * Returns the {@code onmouseout} event handler for this element.
+     * @return the {@code onmouseout} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmouseout() {
+        return getEventHandlerProp("onmouseout");
+    }
+
+    /**
+     * Sets the {@code onmouseover} event handler for this element.
+     * @param handler the {@code onmouseover} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmouseover(final Object handler) {
+        setEventHandler("onmouseover", handler);
+    }
+
+    /**
+     * Returns the {@code onmouseover} event handler for this element.
+     * @return the {@code onmouseover} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmouseover() {
+        return getEventHandlerProp("onmouseover");
+    }
+
+    /**
+     * Sets the {@code onmouseup} event handler for this element.
+     * @param handler the {@code onmouseup} event handler for this element
+     */
+    @JsxSetter
+    public void setOnmouseup(final Object handler) {
+        setEventHandler("onmouseup", handler);
+    }
+
+    /**
+     * Returns the {@code onmouseup} event handler for this element.
+     * @return the {@code onmouseup} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnmouseup() {
+        return getEventHandlerProp("onmouseup");
+    }
+
+    /**
+     * Sets the {@code oncontextmenu} event handler for this element.
+     * @param handler the {@code oncontextmenu} event handler for this element
+     */
+    @JsxSetter
+    public void setOncontextmenu(final Object handler) {
+        setEventHandler("oncontextmenu", handler);
+    }
+
+    /**
+     * Returns the {@code oncontextmenu} event handler for this element.
+     * @return the {@code oncontextmenu} event handler for this element
+     */
+    @JsxGetter
+    public Object getOncontextmenu() {
+        return getEventHandlerProp("oncontextmenu");
+    }
+
+    /**
+     * Sets the {@code onresize} event handler for this element.
+     * @param handler the {@code onresize} event handler for this element
+     */
+    @JsxSetter
+    public void setOnresize(final Object handler) {
+        setEventHandler("onresize", handler);
+    }
+
+    /**
+     * Returns the {@code onresize} event handler for this element.
+     * @return the {@code onresize} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnresize() {
+        return getEventHandlerProp("onresize");
+    }
+
+    /**
+     * Sets the {@code onpropertychange} event handler for this element.
+     * @param handler the {@code onpropertychange} event handler for this element
+     */
+    @JsxSetter(IE)
+    public void setOnpropertychange(final Object handler) {
+        setEventHandler("onpropertychange", handler);
+    }
+
+    /**
+     * Returns the {@code onpropertychange} event handler for this element.
+     * @return the {@code onpropertychange} event handler for this element
+     */
+    @JsxGetter(IE)
+    public Object getOnpropertychange() {
+        return getEventHandlerProp("onpropertychange");
+    }
+
+    /**
+     * Sets the {@code onerror} event handler for this element.
+     * @param handler the {@code onerror} event handler for this element
+     */
+    @JsxSetter
+    public void setOnerror(final Object handler) {
+        setEventHandler("onerror", handler);
+    }
+
+    /**
+     * Returns the {@code onerror} event handler for this element.
+     * @return the {@code onerror} event handler for this element
+     */
+    @JsxGetter
+    public Object getOnerror() {
+        return getEventHandlerProp("onerror");
+    }
+
+    /**
+     * Returns the {@code oninput} event handler for this element.
+     * @return the {@code oninput} event handler for this element
+     */
+    @JsxGetter
+    public Function getOninput() {
+        return getEventHandler("oninput");
+    }
+
+    /**
+     * Sets the {@code oninput} event handler for this element.
+     * @param onchange the {@code oninput} event handler for this element
+     */
+    @JsxSetter
+    public void setOninput(final Object onchange) {
+        setEventHandler("oninput", onchange);
+    }
+
 }


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop