Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added loading attribute to img tag #220

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions api/kotlinx-html.api
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,8 @@ public final class kotlinx/html/Gen_consumer_tagsKt {
public static final fun iframe (Lkotlinx/html/TagConsumer;Lkotlinx/html/IframeSandbox;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static synthetic fun iframe$default (Lkotlinx/html/TagConsumer;Lkotlinx/html/IframeSandbox;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun iframe$default (Lkotlinx/html/TagConsumer;Lkotlinx/html/IframeSandbox;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun img (Lkotlinx/html/TagConsumer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static synthetic fun img$default (Lkotlinx/html/TagConsumer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun img (Lkotlinx/html/TagConsumer;Ljava/lang/String;Ljava/lang/String;Lkotlinx/html/ImgLoading;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static synthetic fun img$default (Lkotlinx/html/TagConsumer;Ljava/lang/String;Ljava/lang/String;Lkotlinx/html/ImgLoading;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun input (Lkotlinx/html/TagConsumer;Lkotlinx/html/InputType;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static synthetic fun input$default (Lkotlinx/html/TagConsumer;Lkotlinx/html/InputType;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun ins (Lkotlinx/html/TagConsumer;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
Expand Down Expand Up @@ -1532,6 +1532,8 @@ public final class kotlinx/html/Gen_tag_unionsKt {
public static synthetic fun details$default (Lkotlinx/html/FlowOrInteractiveContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun dfn (Lkotlinx/html/FlowOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun dfn$default (Lkotlinx/html/FlowOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun eagerImg (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun eagerImg$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun em (Lkotlinx/html/FlowOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun em$default (Lkotlinx/html/FlowOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun emailInput (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
Expand Down Expand Up @@ -1574,8 +1576,8 @@ public final class kotlinx/html/Gen_tag_unionsKt {
public static synthetic fun iframe$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/IframeSandbox;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun imageInput (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun imageInput$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun img (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun img$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun img (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Lkotlinx/html/ImgLoading;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun img$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Lkotlinx/html/ImgLoading;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun input (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/InputType;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun input$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/InputType;Lkotlinx/html/InputFormEncType;Lkotlinx/html/InputFormMethod;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun ins (Lkotlinx/html/FlowOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
Expand All @@ -1586,6 +1588,8 @@ public final class kotlinx/html/Gen_tag_unionsKt {
public static synthetic fun keyGen$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Lkotlinx/html/KeyGenKeyType;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun label (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun label$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun lazyImg (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun lazyImg$default (Lkotlinx/html/FlowOrInteractiveOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun link (Lkotlinx/html/FlowOrMetaDataOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun link$default (Lkotlinx/html/FlowOrMetaDataOrPhrasingContent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun main (Lkotlinx/html/SectioningOrFlowContent;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
Expand Down Expand Up @@ -1882,6 +1886,8 @@ public final class kotlinx/html/Gen_tags_oKt {
}

public final class kotlinx/html/Gen_tags_pKt {
public static final fun eagerImg (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun eagerImg$default (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun getAsFlowContent (Lkotlinx/html/P;)Lkotlinx/html/FlowContent;
public static final fun getAsFlowContent (Lkotlinx/html/PICTURE;)Lkotlinx/html/FlowContent;
public static final fun getAsFlowContent (Lkotlinx/html/PRE;)Lkotlinx/html/FlowContent;
Expand All @@ -1891,8 +1897,10 @@ public final class kotlinx/html/Gen_tags_pKt {
public static final fun getAsPhrasingContent (Lkotlinx/html/PICTURE;)Lkotlinx/html/PhrasingContent;
public static final fun getAsPhrasingContent (Lkotlinx/html/PRE;)Lkotlinx/html/PhrasingContent;
public static final fun getAsPhrasingContent (Lkotlinx/html/PROGRESS;)Lkotlinx/html/PhrasingContent;
public static final fun img (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun img$default (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun img (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Lkotlinx/html/ImgLoading;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun img$default (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Lkotlinx/html/ImgLoading;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun lazyImg (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun lazyImg$default (Lkotlinx/html/PICTURE;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static final fun source (Lkotlinx/html/PICTURE;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public static synthetic fun source$default (Lkotlinx/html/PICTURE;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
}
Expand Down Expand Up @@ -2179,12 +2187,14 @@ public class kotlinx/html/IMG : kotlinx/html/HTMLTag, kotlinx/html/CommonAttribu
public fun getConsumer ()Lkotlinx/html/TagConsumer;
public final fun getHeight ()Ljava/lang/String;
public final fun getIsmap ()Z
public final fun getLoading ()Lkotlinx/html/ImgLoading;
public final fun getSrc ()Ljava/lang/String;
public final fun getUsemap ()Ljava/lang/String;
public final fun getWidth ()Ljava/lang/String;
public final fun setAlt (Ljava/lang/String;)V
public final fun setHeight (Ljava/lang/String;)V
public final fun setIsmap (Z)V
public final fun setLoading (Lkotlinx/html/ImgLoading;)V
public final fun setSrc (Ljava/lang/String;)V
public final fun setUsemap (Ljava/lang/String;)V
public final fun setWidth (Ljava/lang/String;)V
Expand Down Expand Up @@ -2285,6 +2295,15 @@ public final class kotlinx/html/IframeSandbox : java/lang/Enum, kotlinx/html/Att
public static fun values ()[Lkotlinx/html/IframeSandbox;
}

public final class kotlinx/html/ImgLoading : java/lang/Enum, kotlinx/html/AttributeEnum {
public static final field eager Lkotlinx/html/ImgLoading;
public static final field lazy Lkotlinx/html/ImgLoading;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public fun getRealValue ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Lkotlinx/html/ImgLoading;
public static fun values ()[Lkotlinx/html/ImgLoading;
}

public final class kotlinx/html/InputFormEncType : java/lang/Enum, kotlinx/html/AttributeEnum {
public static final field applicationXWwwFormUrlEncoded Lkotlinx/html/InputFormEncType;
public static final field multipartFormData Lkotlinx/html/InputFormEncType;
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/kotlinx/html/generate/rules.kt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ val specialTypes = listOf(
).groupBy { it.first }.mapValues { it.value.single().second }

fun specialTypeFor(tagName: String, attributeName: String): AttributeType? =
specialTypes[tagName + "." + attributeName] ?: specialTypes["*." + attributeName]
specialTypes["$tagName.$attributeName"] ?: specialTypes["*.$attributeName"]

val wellKnownWords = listOf("span", "class", "enabled?", "edit(able)?",
"^on", "encoded?", "form", "type",
Expand All @@ -67,7 +67,7 @@ val wellKnownWords = listOf("span", "class", "enabled?", "edit(able)?",
"click", "play(ing)?", "context",
"rows?", "cols?", "group(ed)?", "auto",
"list", "field", "data", "block", "scripts?",
"item", "area", "length", "colors?", "suspend", "focus", "touch"
"item", "area", "length", "colors?", "suspend", "focus", "touch", "loading"
).map { it.toRegex(RegexOption.IGNORE_CASE) }

val excludeAttributes = listOf("^item$").map { Pattern.compile(it, Pattern.CASE_INSENSITIVE) }
Expand Down
8 changes: 8 additions & 0 deletions buildSrc/src/main/resources/html_5.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,14 @@
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="loading">
<xsd:simpleType>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="eager"/>
<xsd:enumeration value="lazy"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>

Expand Down
2 changes: 2 additions & 0 deletions src/commonMain/kotlin/generated/gen-attributes.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ internal val attributeFormMethodEnumFormMethodValues : Attribute<FormMethod> = E

internal val attributeIframeSandboxEnumIframeSandboxValues : Attribute<IframeSandbox> = EnumAttribute(iframeSandboxValues)

internal val attributeImgLoadingEnumImgLoadingValues : Attribute<ImgLoading> = EnumAttribute(imgLoadingValues)

internal val attributeInputFormEncTypeEnumInputFormEncTypeValues : Attribute<InputFormEncType> = EnumAttribute(inputFormEncTypeValues)

internal val attributeInputFormMethodEnumInputFormMethodValues : Attribute<InputFormMethod> = EnumAttribute(inputFormMethodValues)
Expand Down
5 changes: 4 additions & 1 deletion src/commonMain/kotlin/generated/gen-consumer-tags.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import kotlinx.html.IMG
import kotlinx.html.INPUT
import kotlinx.html.INS
import kotlinx.html.IframeSandbox
import kotlinx.html.ImgLoading
import kotlinx.html.InputFormEncType
import kotlinx.html.InputFormMethod
import kotlinx.html.InputType
Expand Down Expand Up @@ -614,9 +615,11 @@ public inline fun <T, C : TagConsumer<T>> C.iframe(
public inline fun <T, C : TagConsumer<T>> C.img(
alt: String? = null,
src: String? = null,
loading: ImgLoading? = null,
classes: String? = null,
crossinline block: IMG.() -> Unit = {},
): T = IMG(attributesMapOf("alt", alt,"src", src,"class", classes), this)
): T = IMG(attributesMapOf("alt", alt,"src", src,"loading", loading?.enumEncode(),"class", classes),
this)
.visitAndFinalize(this, block)

/**
Expand Down
7 changes: 7 additions & 0 deletions src/commonMain/kotlin/generated/gen-enums.kt
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ enum class IframeSandbox(override val realValue : String) : AttributeEnum {

internal val iframeSandboxValues : Map<String, IframeSandbox> = IframeSandbox.values().associateBy { it.realValue }
@Suppress("unused")
enum class ImgLoading(override val realValue : String) : AttributeEnum {
eager("eager"),
lazy("lazy")
}

internal val imgLoadingValues : Map<String, ImgLoading> = ImgLoading.values().associateBy { it.realValue }
@Suppress("unused")
enum class InputType(override val realValue : String) : AttributeEnum {
button("button"),
checkBox("checkbox"),
Expand Down
6 changes: 5 additions & 1 deletion src/commonMain/kotlin/generated/gen-tag-unions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,11 @@ fun FlowOrInteractiveOrPhrasingContent.allowScriptsIframe(classes : String? = nu
* Embedded image
*/
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.img(alt : String? = null, src : String? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"class", classes), consumer).visit(block)
inline fun FlowOrInteractiveOrPhrasingContent.img(alt : String? = null, src : String? = null, loading : ImgLoading? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"loading", loading?.enumEncode(),"class", classes), consumer).visit(block)
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.eagerImg(alt : String? = null, src : String? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"loading", ImgLoading.eager.realValue,"class", classes), consumer).visit(block)
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.lazyImg(alt : String? = null, src : String? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"loading", ImgLoading.lazy.realValue,"class", classes), consumer).visit(block)

/**
* Pictures container
Expand Down
4 changes: 4 additions & 0 deletions src/commonMain/kotlin/generated/gen-tags-i.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ open class IMG(initialAttributes : Map<String, String>, override val consumer :
get() = attributeBooleanTicker.get(this, "ismap")
set(newValue) {attributeBooleanTicker.set(this, "ismap", newValue)}

var loading : ImgLoading
get() = attributeImgLoadingEnumImgLoadingValues.get(this, "loading")
set(newValue) {attributeImgLoadingEnumImgLoadingValues.set(this, "loading", newValue)}


}
val IMG.asFlowContent : FlowContent
Expand Down
6 changes: 5 additions & 1 deletion src/commonMain/kotlin/generated/gen-tags-p.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ inline fun PICTURE.source(classes : String? = null, crossinline block : SOURCE.(
* Embedded image
*/
@HtmlTagMarker
inline fun PICTURE.img(alt : String? = null, src : String? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"class", classes), consumer).visit(block)
inline fun PICTURE.img(alt : String? = null, src : String? = null, loading : ImgLoading? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"loading", loading?.enumEncode(),"class", classes), consumer).visit(block)
@HtmlTagMarker
inline fun PICTURE.eagerImg(alt : String? = null, src : String? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"loading", ImgLoading.eager.realValue,"class", classes), consumer).visit(block)
@HtmlTagMarker
inline fun PICTURE.lazyImg(alt : String? = null, src : String? = null, classes : String? = null, crossinline block : IMG.() -> Unit = {}) : Unit = IMG(attributesMapOf("alt", alt,"src", src,"loading", ImgLoading.lazy.realValue,"class", classes), consumer).visit(block)

val PICTURE.asFlowContent : FlowContent
get() = this
Expand Down
5 changes: 4 additions & 1 deletion src/jsMain/kotlin/generated/gen-consumer-tags-js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import kotlinx.html.IMG
import kotlinx.html.INPUT
import kotlinx.html.INS
import kotlinx.html.IframeSandbox
import kotlinx.html.ImgLoading
import kotlinx.html.InputFormEncType
import kotlinx.html.InputFormMethod
import kotlinx.html.InputType
Expand Down Expand Up @@ -675,9 +676,11 @@ public inline fun TagConsumer<HTMLElement>.iframe(
public inline fun TagConsumer<HTMLElement>.img(
alt: String? = null,
src: String? = null,
loading: ImgLoading? = null,
classes: String? = null,
crossinline block: IMG.() -> Unit = {},
): HTMLImageElement = IMG(attributesMapOf("alt", alt,"src", src,"class", classes), this)
): HTMLImageElement = IMG(attributesMapOf("alt", alt,"src", src,"loading",
loading?.enumEncode(),"class", classes), this)
.visitAndFinalize(this, block) as HTMLImageElement

/**
Expand Down
5 changes: 4 additions & 1 deletion src/wasmJsMain/kotlin/generated/gen-consumer-tags-wasm-js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import kotlinx.html.IMG
import kotlinx.html.INPUT
import kotlinx.html.INS
import kotlinx.html.IframeSandbox
import kotlinx.html.ImgLoading
import kotlinx.html.InputFormEncType
import kotlinx.html.InputFormMethod
import kotlinx.html.InputType
Expand Down Expand Up @@ -674,9 +675,11 @@ public inline fun TagConsumer<Element>.iframe(
public inline fun TagConsumer<Element>.img(
alt: String? = null,
src: String? = null,
loading: ImgLoading? = null,
classes: String? = null,
crossinline block: IMG.() -> Unit = {},
): HTMLImageElement = IMG(attributesMapOf("alt", alt,"src", src,"class", classes), this)
): HTMLImageElement = IMG(attributesMapOf("alt", alt,"src", src,"loading",
loading?.enumEncode(),"class", classes), this)
.visitAndFinalize(this, block) as HTMLImageElement

/**
Expand Down