From 779b482a4396ae381462d79887d2dc61a3a7afa1 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Wed, 27 May 2015 21:18:32 +0300 Subject: [PATCH] Add some useful properties/methods to DOM wrappers --- .../src/main/java/org/teavm/dom/html/HTMLCanvasElement.java | 4 ++++ teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLCanvasElement.java b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLCanvasElement.java index d859aabf5..237874049 100644 --- a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLCanvasElement.java +++ b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLCanvasElement.java @@ -16,6 +16,7 @@ package org.teavm.dom.html; import org.teavm.dom.canvas.CanvasImageSource; +import org.teavm.jso.JSMethod; import org.teavm.jso.JSObject; import org.teavm.jso.JSProperty; @@ -39,4 +40,7 @@ public interface HTMLCanvasElement extends HTMLElement, CanvasImageSource { JSObject getContext(String contextId); JSObject getContext(String contextId, JSObject attributes); + + @JSMethod + String toDataURL(String type); } diff --git a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java index c02699870..00dc6008c 100644 --- a/teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java +++ b/teavm-dom/src/main/java/org/teavm/dom/html/HTMLElement.java @@ -102,4 +102,10 @@ public interface HTMLElement extends Element, ElementCSSInlineStyle, EventTarget @JSProperty @Override HTMLDocument getOwnerDocument(); + + @JSProperty + int getInnerHTML(); + + @JSProperty + void setInnerHTML(String content); }