diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java b/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java index 3ee30f4059..2404bd643c 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/events/MouseEvent.java @@ -41,6 +41,24 @@ public interface MouseEvent extends Event { @JSProperty int getClientY(); + @JSProperty + int getPageX(); + + @JSProperty + int getPageY(); + + @JSProperty + int getOffsetX(); + + @JSProperty + int getOffsetY(); + + @JSProperty + int getX(); + + @JSProperty + int getY(); + @JSProperty boolean getCtrlKey(); diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java index 25055f0ee2..e9031c5d67 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLElement.java @@ -120,6 +120,21 @@ public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget @JSProperty void setClassName(String className); + @JSProperty + HTMLElement getOffsetParent(); + + @JSProperty + int getOffsetTop(); + + @JSProperty + int getOffsetLeft(); + + @JSProperty + int getOffsetWidth(); + + @JSProperty + int getOffsetHeight(); + default HTMLElement withAttr(String name, String value) { setAttribute(name, value); return this; diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/xml/DOMTokenList.java b/jso/apis/src/main/java/org/teavm/jso/dom/xml/DOMTokenList.java new file mode 100644 index 0000000000..4f6ffb6244 --- /dev/null +++ b/jso/apis/src/main/java/org/teavm/jso/dom/xml/DOMTokenList.java @@ -0,0 +1,31 @@ +/* + * Copyright 2017 Colin Alworth. + * + * 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 org.teavm.jso.dom.xml; + +import org.teavm.jso.core.JSArrayReader; +import org.teavm.jso.core.JSString; + +public interface DOMTokenList extends JSArrayReader { + boolean contains(String token); + + void add(String... tokens); + + void remove(String... tokens); + + boolean toggle(String token); + + boolean toggle(String token, boolean force); +} diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/xml/Element.java b/jso/apis/src/main/java/org/teavm/jso/dom/xml/Element.java index f74ac0bef8..3540f717e2 100644 --- a/jso/apis/src/main/java/org/teavm/jso/dom/xml/Element.java +++ b/jso/apis/src/main/java/org/teavm/jso/dom/xml/Element.java @@ -15,6 +15,8 @@ */ package org.teavm.jso.dom.xml; +import org.teavm.jso.JSProperty; + public interface Element extends Node { String getTagName(); @@ -47,4 +49,11 @@ public interface Element extends Node { boolean hasAttribute(String name); boolean hasAttributeNS(String namespaceURI, String localName); + + Element querySelector(String selectors); + + NodeList querySelectorAll(String selectors); + + @JSProperty + DOMTokenList getClassList(); }