diff --git a/buildSrc/src/main/kotlin/karakum/browser/Generator.kt b/buildSrc/src/main/kotlin/karakum/browser/Generator.kt index a4c58a97a..cb9a2fcc1 100644 --- a/buildSrc/src/main/kotlin/karakum/browser/Generator.kt +++ b/buildSrc/src/main/kotlin/karakum/browser/Generator.kt @@ -200,6 +200,7 @@ private val DEFAULT_IMPORTS = Imports( "web.permissions.Permissions", "web.pip.PictureInPictureEvent", "web.pip.PictureInPictureWindow", + "web.popover.Popover", "web.push.PushManager", "web.ranges.AbstractRange", "web.ranges.Range", diff --git a/buildSrc/src/main/kotlin/karakum/browser/Html.kt b/buildSrc/src/main/kotlin/karakum/browser/Html.kt index 8273f876a..47f2ebe73 100644 --- a/buildSrc/src/main/kotlin/karakum/browser/Html.kt +++ b/buildSrc/src/main/kotlin/karakum/browser/Html.kt @@ -585,6 +585,7 @@ internal fun htmlDeclarations( return interfaces .plus(formTypes()) + .plus(popoverTypes()) .plus(customElementTypes()) .plus( ConversionResult( diff --git a/buildSrc/src/main/kotlin/karakum/browser/Patches.kt b/buildSrc/src/main/kotlin/karakum/browser/Patches.kt index 72f75e9db..c0d91c54a 100644 --- a/buildSrc/src/main/kotlin/karakum/browser/Patches.kt +++ b/buildSrc/src/main/kotlin/karakum/browser/Patches.kt @@ -14,6 +14,9 @@ internal fun String.applyPatches(): String { .patchInterfaces("Request", "RequestInit", "XMLHttpRequest") { it.replace(Regex("""([( ]method\??: )string([;,])"""), "$1$REQUEST_METHOD$2") } + .patchInterface("HTMLElement") { + it.replace(" popover: string | null;", " popover: $POPOVER | null;") + } .patchInterface("HTMLFormElement") { it.replace(" method: string;", " method: $FORM_METHOD;") .replace(" enctype: string;", " enctype: $FORM_ENCTYPE;") diff --git a/buildSrc/src/main/kotlin/karakum/browser/Popover.kt b/buildSrc/src/main/kotlin/karakum/browser/Popover.kt new file mode 100644 index 000000000..a71c75c9b --- /dev/null +++ b/buildSrc/src/main/kotlin/karakum/browser/Popover.kt @@ -0,0 +1,17 @@ +package karakum.browser + +import karakum.common.unionBody + +internal const val POPOVER = "Popover" + +internal fun popoverTypes(): Sequence = + sequenceOf( + ConversionResult( + POPOVER, + unionBody( + name = POPOVER, + values = listOf("auto", "manual"), + ), + pkg = "web.popover", + ), + )