Skip to content

Commit

Permalink
Added IE-specific values for textarea wrap attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
severn-everett committed Mar 26, 2024
1 parent f1b51c6 commit 01cd343
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
6 changes: 4 additions & 2 deletions buildSrc/src/main/kotlin/kotlinx/html/generate/rules.kt
Expand Up @@ -78,8 +78,10 @@ fun isEnumExcluded(name: String) = excludedEnums.any { it.containsMatchIn(name)

val contentlessTags = setOf("html", "head", "script", "style")

val deprecated = listOf(".*FormMethod#(put|patch|delete)" to "method is not allowed in browsers")
.map { it.first.toRegex(RegexOption.IGNORE_CASE) to it.second }
val deprecated = listOf(
".*FormMethod#(put|patch|delete)" to "method is not allowed in browsers",
".*TextAreaWrap#(virtual|physical|off)" to "values only supported in IE"
).map { it.first.toRegex(RegexOption.IGNORE_CASE) to it.second }

fun findEnumDeprecation(attribute: AttributeInfo, value: AttributeEnumValue): String? {
return deprecated.firstOrNull { p -> p.first.matches("""${attribute.enumTypeName}#${value.realName}""") }?.second
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/resources/html_5.xsd
Expand Up @@ -1688,6 +1688,9 @@
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="hard"/>
<xsd:enumeration value="soft"/>
<xsd:enumeration value="virtual"/>
<xsd:enumeration value="physical"/>
<xsd:enumeration value="off"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
Expand Down
5 changes: 4 additions & 1 deletion src/commonMain/kotlin/generated/gen-enums.kt
Expand Up @@ -406,7 +406,10 @@ object StyleMedia {
@Suppress("unused")
enum class TextAreaWrap(override val realValue : String) : AttributeEnum {
hard("hard"),
soft("soft")
soft("soft"),
@Deprecated("values only supported in IE") virtual("virtual"),
@Deprecated("values only supported in IE") physical("physical"),
@Deprecated("values only supported in IE") off("off")
}

internal val textAreaWrapValues : Map<String, TextAreaWrap> = TextAreaWrap.values().associateBy { it.realValue }
Expand Down
18 changes: 18 additions & 0 deletions src/commonMain/kotlin/generated/gen-tag-unions.kt
Expand Up @@ -551,10 +551,28 @@ fun FlowOrInteractiveOrPhrasingContent.textArea(rows : String? = null, cols : St
inline fun FlowOrInteractiveOrPhrasingContent.hardTextArea(rows : String? = null, cols : String? = null, classes : String? = null, crossinline block : TEXTAREA.() -> Unit = {}) : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.hard.realValue,"class", classes), consumer).visit(block)
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.softTextArea(rows : String? = null, cols : String? = null, classes : String? = null, crossinline block : TEXTAREA.() -> Unit = {}) : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.soft.realValue,"class", classes), consumer).visit(block)
@Suppress("DEPRECATION")
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.virtualTextArea(rows : String? = null, cols : String? = null, classes : String? = null, crossinline block : TEXTAREA.() -> Unit = {}) : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.virtual.realValue,"class", classes), consumer).visit(block)
@Suppress("DEPRECATION")
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.physicalTextArea(rows : String? = null, cols : String? = null, classes : String? = null, crossinline block : TEXTAREA.() -> Unit = {}) : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.physical.realValue,"class", classes), consumer).visit(block)
@Suppress("DEPRECATION")
@HtmlTagMarker
inline fun FlowOrInteractiveOrPhrasingContent.offTextArea(rows : String? = null, cols : String? = null, classes : String? = null, crossinline block : TEXTAREA.() -> Unit = {}) : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.off.realValue,"class", classes), consumer).visit(block)
@HtmlTagMarker
fun FlowOrInteractiveOrPhrasingContent.hardTextArea(rows : String? = null, cols : String? = null, classes : String? = null, content : String = "") : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.hard.realValue,"class", classes), consumer).visit({+content})
@HtmlTagMarker
fun FlowOrInteractiveOrPhrasingContent.softTextArea(rows : String? = null, cols : String? = null, classes : String? = null, content : String = "") : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.soft.realValue,"class", classes), consumer).visit({+content})
@Suppress("DEPRECATION")
@HtmlTagMarker
fun FlowOrInteractiveOrPhrasingContent.virtualTextArea(rows : String? = null, cols : String? = null, classes : String? = null, content : String = "") : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.virtual.realValue,"class", classes), consumer).visit({+content})
@Suppress("DEPRECATION")
@HtmlTagMarker
fun FlowOrInteractiveOrPhrasingContent.physicalTextArea(rows : String? = null, cols : String? = null, classes : String? = null, content : String = "") : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.physical.realValue,"class", classes), consumer).visit({+content})
@Suppress("DEPRECATION")
@HtmlTagMarker
fun FlowOrInteractiveOrPhrasingContent.offTextArea(rows : String? = null, cols : String? = null, classes : String? = null, content : String = "") : Unit = TEXTAREA(attributesMapOf("rows", rows,"cols", cols,"wrap", TextAreaWrap.off.realValue,"class", classes), consumer).visit({+content})

/**
* Video player
Expand Down

0 comments on commit 01cd343

Please sign in to comment.