From e4e05c826c9471f44a40bd0037eeab6f4d418370 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Wed, 21 Jul 2021 01:30:55 +0200 Subject: [PATCH] Li can be build in any context We won't try to type-check the DOM structure, it's up to user which elements and where to use --- .../compose/web/elements/Elements.kt | 8 +-- .../jsTest/kotlin/elements/ElementsTests.kt | 69 +------------------ 2 files changed, 3 insertions(+), 74 deletions(-) diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt index 38542fff30..d532d46907 100644 --- a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/elements/Elements.kt @@ -551,13 +551,7 @@ fun Ol( ) = TagElement(elementBuilder = Ol, applyAttrs = attrs, content = content) @Composable -fun DOMScope.Li( - attrs: AttrBuilderContext? = null, - content: ContentBuilder? = null -) = TagElement(elementBuilder = Li, applyAttrs = attrs, content = content) - -@Composable -fun DOMScope.Li( +fun Li( attrs: AttrBuilderContext? = null, content: ContentBuilder? = null ) = TagElement(elementBuilder = Li, applyAttrs = attrs, content = content) diff --git a/web/core/src/jsTest/kotlin/elements/ElementsTests.kt b/web/core/src/jsTest/kotlin/elements/ElementsTests.kt index 37500bd378..721cd11841 100644 --- a/web/core/src/jsTest/kotlin/elements/ElementsTests.kt +++ b/web/core/src/jsTest/kotlin/elements/ElementsTests.kt @@ -8,72 +8,7 @@ package org.jetbrains.compose.web.core.tests.elements import androidx.compose.runtime.Composable import org.jetbrains.compose.web.attributes.AttrsBuilder import org.jetbrains.compose.web.core.tests.runTest -import org.jetbrains.compose.web.dom.A -import org.jetbrains.compose.web.dom.Address -import org.jetbrains.compose.web.dom.Area -import org.jetbrains.compose.web.dom.Article -import org.jetbrains.compose.web.dom.Aside -import org.jetbrains.compose.web.dom.Audio -import org.jetbrains.compose.web.dom.B -import org.jetbrains.compose.web.dom.Br -import org.jetbrains.compose.web.dom.Button -import org.jetbrains.compose.web.dom.Caption -import org.jetbrains.compose.web.dom.Code -import org.jetbrains.compose.web.dom.Col -import org.jetbrains.compose.web.dom.Colgroup -import org.jetbrains.compose.web.dom.ContentBuilder -import org.jetbrains.compose.web.dom.Datalist -import org.jetbrains.compose.web.dom.Div -import org.jetbrains.compose.web.dom.Em -import org.jetbrains.compose.web.dom.Embed -import org.jetbrains.compose.web.dom.Fieldset -import org.jetbrains.compose.web.dom.Footer -import org.jetbrains.compose.web.dom.Form -import org.jetbrains.compose.web.dom.H1 -import org.jetbrains.compose.web.dom.H2 -import org.jetbrains.compose.web.dom.H3 -import org.jetbrains.compose.web.dom.H4 -import org.jetbrains.compose.web.dom.H5 -import org.jetbrains.compose.web.dom.H6 -import org.jetbrains.compose.web.dom.HTMLMap -import org.jetbrains.compose.web.dom.Header -import org.jetbrains.compose.web.dom.Hr -import org.jetbrains.compose.web.dom.I -import org.jetbrains.compose.web.dom.Iframe -import org.jetbrains.compose.web.dom.Img -import org.jetbrains.compose.web.dom.Label -import org.jetbrains.compose.web.dom.Legend -import org.jetbrains.compose.web.dom.Main -import org.jetbrains.compose.web.dom.Meter -import org.jetbrains.compose.web.dom.Nav -import org.jetbrains.compose.web.dom.Object -import org.jetbrains.compose.web.dom.Ol -import org.jetbrains.compose.web.dom.OptGroup -import org.jetbrains.compose.web.dom.Option -import org.jetbrains.compose.web.dom.Output -import org.jetbrains.compose.web.dom.P -import org.jetbrains.compose.web.dom.Param -import org.jetbrains.compose.web.dom.Picture -import org.jetbrains.compose.web.dom.Pre -import org.jetbrains.compose.web.dom.Progress -import org.jetbrains.compose.web.dom.Section -import org.jetbrains.compose.web.dom.Select -import org.jetbrains.compose.web.dom.Small -import org.jetbrains.compose.web.dom.Source -import org.jetbrains.compose.web.dom.Span -import org.jetbrains.compose.web.dom.Table -import org.jetbrains.compose.web.dom.TagElement -import org.jetbrains.compose.web.dom.Tbody -import org.jetbrains.compose.web.dom.Td -import org.jetbrains.compose.web.dom.Text -import org.jetbrains.compose.web.dom.TextArea -import org.jetbrains.compose.web.dom.Tfoot -import org.jetbrains.compose.web.dom.Th -import org.jetbrains.compose.web.dom.Thead -import org.jetbrains.compose.web.dom.Tr -import org.jetbrains.compose.web.dom.Track -import org.jetbrains.compose.web.dom.Ul -import org.jetbrains.compose.web.dom.Video +import org.jetbrains.compose.web.dom.* import org.w3c.dom.HTMLElement import org.w3c.dom.get import kotlin.test.Test @@ -129,7 +64,7 @@ class ElementsTests { Pair({ Ul() }, "UL"), Pair({ Ol() }, "OL"), - //Pair({ Tag.Li() }, "LI"), + Pair({ Li() }, "LI"), Pair({ Img(src="whatever") }, "IMG"), Pair({ Form() }, "FORM"),