diff --git a/lime/_backend/html5/HTML5Window.hx b/lime/_backend/html5/HTML5Window.hx
index b7ecb3c14..4aa03e2d9 100644
--- a/lime/_backend/html5/HTML5Window.hx
+++ b/lime/_backend/html5/HTML5Window.hx
@@ -3,7 +3,11 @@ package lime._backend.html5;
import js.html.CanvasElement;
import js.html.DivElement;
+#if (haxe_ver >= "3.2")
+import js.html.HTMLElement;
+#else
import js.html.HtmlElement;
+#end
import js.html.MouseEvent;
import js.html.TouchEvent;
import js.Browser;
@@ -17,7 +21,7 @@ class HTML5Window {
public var canvas:CanvasElement;
public var div:DivElement;
- public var element:HtmlElement;
+ public var element:#if (haxe_ver >= "3.2") HTMLElement #else HtmlElement #end;
#if stats
public var stats:Dynamic;
#end
diff --git a/lime/app/Config.hx b/lime/app/Config.hx
index ea1aa3c8a..5bccc42ea 100644
--- a/lime/app/Config.hx
+++ b/lime/app/Config.hx
@@ -8,7 +8,7 @@ typedef Config = {
@:optional var borderless:Bool;
@:optional var depthBuffer:Bool;
#if (js && html5)
- @:optional var element:js.html.HtmlElement;
+ @:optional var element:#if (haxe_ver >= "3.2") js.html.HTMLElement #else js.html.HtmlElement #end;
@:optional var assetsPrefix:String;
#end
@:optional var fps:Int;
diff --git a/lime/app/Preloader.hx b/lime/app/Preloader.hx
index e76ae3ded..b78f9746c 100644
--- a/lime/app/Preloader.hx
+++ b/lime/app/Preloader.hx
@@ -5,6 +5,7 @@ import lime.Assets;
#if (js && html5)
import js.html.Image;
+import js.html.SpanElement;
import js.Browser;
import lime.net.URLLoader;
import lime.net.URLRequest;
@@ -147,7 +148,7 @@ class Preloader #if flash extends Sprite #end {
} else {
- var node = Browser.document.createElement ("span");
+ var node:SpanElement = cast Browser.document.createElement ("span");
node.innerHTML = "giItT1WQy@!-/#";
var style = node.style;
style.position = "absolute";
diff --git a/lime/audio/HTML5AudioContext.hx b/lime/audio/HTML5AudioContext.hx
index 78949ec68..1e996d1f6 100644
--- a/lime/audio/HTML5AudioContext.hx
+++ b/lime/audio/HTML5AudioContext.hx
@@ -56,6 +56,7 @@ class HTML5AudioContext {
}
+ #if (haxe_ver < "3.2")
public function getAudioDecodedByteCount (buffer:AudioBuffer):Int {
#if (js && html5)
@@ -69,6 +70,7 @@ class HTML5AudioContext {
return 0;
}
+ #end
public function getAutoplay (buffer:AudioBuffer):Bool {
@@ -101,6 +103,7 @@ class HTML5AudioContext {
}
+ #if (haxe_ver < "3.2")
public function getController (buffer:AudioBuffer):Dynamic /*MediaController*/ {
#if (js && html5)
@@ -114,6 +117,7 @@ class HTML5AudioContext {
return null;
}
+ #end
public function getCurrentSrc (buffer:AudioBuffer):String {
@@ -206,6 +210,7 @@ class HTML5AudioContext {
}
+ #if (haxe_ver < "3.2")
public function getInitialTime (buffer:AudioBuffer):Float {
#if (js && html5)
@@ -219,6 +224,7 @@ class HTML5AudioContext {
return 0;
}
+ #end
public function getLoop (buffer:AudioBuffer):Bool {
@@ -236,6 +242,7 @@ class HTML5AudioContext {
}
+ #if (haxe_ver < "3.2")
public function getMediaGroup (buffer:AudioBuffer):String {
#if (js && html5)
@@ -249,6 +256,7 @@ class HTML5AudioContext {
return null;
}
+ #end
public function getMuted (buffer:AudioBuffer):Bool {
@@ -483,6 +491,7 @@ class HTML5AudioContext {
}
+ #if (haxe_ver < "3.2")
public function setController (buffer:AudioBuffer, value:Dynamic /*MediaController*/):Void {
#if (js && html5)
@@ -494,6 +503,7 @@ class HTML5AudioContext {
#end
}
+ #end
public function setCurrentTime (buffer:AudioBuffer, value:Float):Void {
@@ -535,6 +545,7 @@ class HTML5AudioContext {
}
+ #if (haxe_ver < "3.2")
public function setMediaGroup (buffer:AudioBuffer, value:String):Void {
#if (js && html5)
@@ -546,6 +557,7 @@ class HTML5AudioContext {
#end
}
+ #end
public function setMuted (buffer:AudioBuffer, value:Bool):Void {
diff --git a/lime/graphics/GLRenderContext.hx b/lime/graphics/GLRenderContext.hx
index d4c112746..64743920e 100644
--- a/lime/graphics/GLRenderContext.hx
+++ b/lime/graphics/GLRenderContext.hx
@@ -1337,6 +1337,7 @@ class GLRenderContext {
#else
+import js.html.CanvasElement;
import lime.graphics.opengl.GLActiveInfo;
import lime.graphics.opengl.GLBuffer;
import lime.graphics.opengl.GLContextAttributes;
@@ -1350,7 +1351,7 @@ import lime.graphics.opengl.GLUniformLocation;
@:native("WebGLRenderingContext")
-extern class GLRenderContext extends js.html.CanvasRenderingContext {
+extern class GLRenderContext {
var ACTIVE_ATTRIBUTES:Int;
@@ -1649,6 +1650,7 @@ extern class GLRenderContext extends js.html.CanvasRenderingContext {
var VIEWPORT:Int;
var ZERO:Int;
+ var canvas (default, null):CanvasElement;
var drawingBufferHeight (default,null):Int;
var drawingBufferWidth (default,null):Int;
diff --git a/lime/graphics/utils/ImageCanvasUtil.hx b/lime/graphics/utils/ImageCanvasUtil.hx
index e11af5542..1004e735a 100644
--- a/lime/graphics/utils/ImageCanvasUtil.hx
+++ b/lime/graphics/utils/ImageCanvasUtil.hx
@@ -140,7 +140,7 @@ class ImageCanvasUtil {
untyped (buffer.__srcContext).mozImageSmoothingEnabled = false;
untyped (buffer.__srcContext).webkitImageSmoothingEnabled = false;
- buffer.__srcContext.imageSmoothingEnabled = false;
+ untyped (buffer.__srcContext).imageSmoothingEnabled = false;
}
#end
diff --git a/lime/system/System.hx b/lime/system/System.hx
index bc40aab76..b16eeed25 100644
--- a/lime/system/System.hx
+++ b/lime/system/System.hx
@@ -9,7 +9,11 @@ import haxe.Timer;
#end
#if (js && html5)
+#if (haxe_ver >= "3.2")
+import js.html.HTMLElement;
+#else
import js.html.HtmlElement;
+#end
import js.Browser;
#end
@@ -40,7 +44,7 @@ class System {
@:keep @:expose("lime.embed")
public static function embed (element:Dynamic, width:Null = null, height:Null = null, background:String = null, assetsPrefix:String = null) {
- var htmlElement:HtmlElement = null;
+ var htmlElement:#if (haxe_ver >= "3.2") HTMLElement #else HtmlElement #end = null;
if (Std.is (element, String)) {