Introduce idl definition for SVGMaskElement
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
namespace org.w3c.css.masking;
|
||||
|
||||
|
||||
// Downloaded from https://www.w3.org/TR/css-masking-1/
|
||||
interface SVGClipPathElement : SVGElement {
|
||||
readonly attribute SVGAnimatedEnumeration clipPathUnits;
|
||||
readonly attribute SVGAnimatedTransformList transform;
|
||||
};
|
||||
|
||||
SVGClipPathElement implements SVGUnitTypes;
|
||||
interface SVGMaskElement : SVGElement {
|
||||
readonly attribute SVGAnimatedEnumeration maskUnits;
|
||||
readonly attribute SVGAnimatedEnumeration maskContentUnits;
|
||||
readonly attribute SVGAnimatedLength x;
|
||||
readonly attribute SVGAnimatedLength y;
|
||||
readonly attribute SVGAnimatedLength width;
|
||||
readonly attribute SVGAnimatedLength height;
|
||||
};
|
||||
|
||||
SVGMaskElement implements SVGUnitTypes;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package org.khronos.webgl
|
||||
|
||||
import kotlin.js.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
|
||||
// See libraries/tools/idl2k for details
|
||||
|
||||
@file:Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
|
||||
package org.w3c.css.masking
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
import org.w3c.dom.parsing.*
|
||||
import org.w3c.dom.pointerevents.*
|
||||
import org.w3c.dom.svg.*
|
||||
import org.w3c.dom.url.*
|
||||
import org.w3c.fetch.*
|
||||
import org.w3c.files.*
|
||||
import org.w3c.notifications.*
|
||||
import org.w3c.performance.*
|
||||
import org.w3c.workers.*
|
||||
import org.w3c.xhr.*
|
||||
|
||||
/**
|
||||
* Exposes the JavaScript [SVGClipPathElement](https://developer.mozilla.org/en/docs/Web/API/SVGClipPathElement) to Kotlin
|
||||
*/
|
||||
public external abstract class SVGClipPathElement : SVGElement, SVGUnitTypes {
|
||||
open val clipPathUnits: SVGAnimatedEnumeration
|
||||
open val transform: SVGAnimatedTransformList
|
||||
|
||||
companion object {
|
||||
val SVG_UNIT_TYPE_UNKNOWN: Short
|
||||
val SVG_UNIT_TYPE_USERSPACEONUSE: Short
|
||||
val SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: Short
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes the JavaScript [SVGMaskElement](https://developer.mozilla.org/en/docs/Web/API/SVGMaskElement) to Kotlin
|
||||
*/
|
||||
public external abstract class SVGMaskElement : SVGElement, SVGUnitTypes {
|
||||
open val maskUnits: SVGAnimatedEnumeration
|
||||
open val maskContentUnits: SVGAnimatedEnumeration
|
||||
open val x: SVGAnimatedLength
|
||||
open val y: SVGAnimatedLength
|
||||
open val width: SVGAnimatedLength
|
||||
open val height: SVGAnimatedLength
|
||||
|
||||
companion object {
|
||||
val SVG_UNIT_TYPE_UNKNOWN: Short
|
||||
val SVG_UNIT_TYPE_USERSPACEONUSE: Short
|
||||
val SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: Short
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom.css
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.events.*
|
||||
import org.w3c.dom.parsing.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom.events
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.parsing.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
import org.w3c.dom.parsing.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom.parsing
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom.pointerevents
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom.svg
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.dom.url
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.fetch
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.files
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.notifications
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.performance
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.workers
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.w3c.xhr
|
||||
|
||||
import kotlin.js.*
|
||||
import org.khronos.webgl.*
|
||||
import org.w3c.css.masking.*
|
||||
import org.w3c.dom.*
|
||||
import org.w3c.dom.css.*
|
||||
import org.w3c.dom.events.*
|
||||
|
||||
@@ -34,7 +34,7 @@ generateGrammarSource {
|
||||
compileKotlin.dependsOn generateGrammarSource
|
||||
compileTestKotlin.dependsOn generateTestGrammarSource
|
||||
|
||||
task downloadAllIdls(type: JavaExec) {
|
||||
task downloadIDL(type: JavaExec) {
|
||||
main = "org.jetbrains.idl2k.dl.DownloadKt"
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
@@ -42,4 +42,4 @@ task downloadAllIdls(type: JavaExec) {
|
||||
task idl2k(type: JavaExec) {
|
||||
main = "org.jetbrains.idl2k.MainKt"
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,8 @@ val urls = listOf(
|
||||
"http://www.w3.org/TR/pointerevents/" to "org.w3c.dom.pointerevents",
|
||||
|
||||
"https://drafts.csswg.org/cssom/" to "org.w3c.dom.css",
|
||||
"https://www.w3.org/TR/css-masking-1/" to "org.w3c.css.masking",
|
||||
|
||||
"http://www.w3.org/TR/DOM-Parsing/" to "org.w3c.dom.parsing",
|
||||
"https://raw.githubusercontent.com/whatwg/url/master/url.html" to "org.w3c.dom.url",
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ fun main(args: Array<String>) {
|
||||
val arg = argsIterator.next()
|
||||
|
||||
when (arg) {
|
||||
"-package", "-pkg", "--package" -> if (argsIterator.hasNext()) packageFilter = argsIterator.next() else throw IllegalArgumentException("argument $arg requires argument")
|
||||
"--pkg" -> if (argsIterator.hasNext()) packageFilter = argsIterator.next() else throw IllegalArgumentException("argument $arg requires argument")
|
||||
else -> throw IllegalArgumentException("Argument $arg is unknown")
|
||||
}
|
||||
}
|
||||
@@ -79,23 +79,28 @@ private fun fetch(url: String): String? {
|
||||
}
|
||||
}
|
||||
|
||||
private fun Appendable.append(element: Element) {
|
||||
val text = element.text()
|
||||
appendln(text)
|
||||
if (!text.trimEnd().endsWith(";")) {
|
||||
appendln(";")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun List<Element>.attachTo(out: Appendable) = map { element ->
|
||||
if (!element.tag().preserveWhitespace()) {
|
||||
Element(Tag.valueOf("pre"), element.baseUri()).appendChild(element)
|
||||
} else element
|
||||
}.forEach { out.append(it) }
|
||||
|
||||
|
||||
private fun extractIDLText(rawContent: String, out: Appendable) {
|
||||
val soup = Jsoup.parse(rawContent)
|
||||
fun append(it : Element) {
|
||||
if (!it.tag().preserveWhitespace()) {
|
||||
return append(Element(Tag.valueOf("pre"), it.baseUri()).appendChild(it))
|
||||
}
|
||||
|
||||
val text = it.text()
|
||||
out.appendln(text)
|
||||
if (!text.trimEnd().endsWith(";")) {
|
||||
out.appendln(";")
|
||||
}
|
||||
}
|
||||
|
||||
soup.select(".dfn-panel").remove()
|
||||
|
||||
soup.select("pre.idl").filter {!it.hasClass("extract")}.forEach(::append)
|
||||
soup.select("code.idl-code").forEach(::append)
|
||||
soup.select("spec-idl").forEach(::append)
|
||||
soup.select("pre.idl").filter {!it.hasClass("extract")}.attachTo(out)
|
||||
soup.select("code.idl-code").attachTo(out)
|
||||
soup.select("spec-idl").attachTo(out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user