Skip to content

Commit 69fdc08

Browse files
authored
Merge pull request scala-js#858 from Quafadas/mathml
Proposal for MathML base class
2 parents 5a85518 + 6e3e18e commit 69fdc08

File tree

4 files changed

+300
-3
lines changed

4 files changed

+300
-3
lines changed

api-reports/2_12.txt

+129
Original file line numberDiff line numberDiff line change
@@ -16495,6 +16495,135 @@ MIMEType[SO] val `application/xml` = "application/xml".asInstanceOf[MIMEType]
1649516495
MIMEType[SO] val `image/svg+xml` = "image/svg+xml".asInstanceOf[MIMEType]
1649616496
MIMEType[SO] val `text/html` = "text/html".asInstanceOf[MIMEType]
1649716497
MIMEType[SO] val `text/xml` = "text/xml".asInstanceOf[MIMEType]
16498+
MathMLElement[JC] var accessKey: String
16499+
MathMLElement[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
16500+
MathMLElement[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
16501+
MathMLElement[JC] def after(nodes: Node | String*): Unit
16502+
MathMLElement[JC] def append(nodes: Node | String*): Unit
16503+
MathMLElement[JC] def appendChild(newChild: Node): Node
16504+
MathMLElement[JC] var arg: String
16505+
MathMLElement[JC] def attachShadow(init: ShadowRootInit): ShadowRoot
16506+
MathMLElement[JC] def attributes: NamedNodeMap
16507+
MathMLElement[JC] var autofocus: Boolean
16508+
MathMLElement[JC] def baseURI: String
16509+
MathMLElement[JC] def before(nodes: Node | String*): Unit
16510+
MathMLElement[JC] def childElementCount: Int
16511+
MathMLElement[JC] def childNodes: NodeList[Node]
16512+
MathMLElement[JC] def children: HTMLCollection[Element]
16513+
MathMLElement[JC] var `class`: String
16514+
MathMLElement[JC] var classList: DOMTokenList
16515+
MathMLElement[JC] def clientHeight: Int
16516+
MathMLElement[JC] def clientLeft: Int
16517+
MathMLElement[JC] def clientTop: Int
16518+
MathMLElement[JC] def clientWidth: Int
16519+
MathMLElement[JC] def cloneNode(deep: Boolean?): Node
16520+
MathMLElement[JC] def closest(selector: String): Element
16521+
MathMLElement[JC] def compareDocumentPosition(other: Node): Int
16522+
MathMLElement[JC] def contains(otherNode: Node): Boolean
16523+
MathMLElement[JC] var dir: String
16524+
MathMLElement[JC] def dispatchEvent(evt: Event): Boolean
16525+
MathMLElement[JC] var displaystyle: Boolean
16526+
MathMLElement[JC] def firstChild: Node
16527+
MathMLElement[JC] def firstElementChild: Element
16528+
MathMLElement[JC] def getAttribute(name: String): String
16529+
MathMLElement[JC] def getAttributeNS(namespaceURI: String, localName: String): String
16530+
MathMLElement[JC] def getAttributeNode(name: String): Attr
16531+
MathMLElement[JC] def getAttributeNodeNS(namespaceURI: String, localName: String): Attr
16532+
MathMLElement[JC] def getBoundingClientRect(): DOMRect
16533+
MathMLElement[JC] def getClientRects(): DOMRectList
16534+
MathMLElement[JC] def getElementsByClassName(classNames: String): HTMLCollection[Element]
16535+
MathMLElement[JC] def getElementsByTagName(name: String): HTMLCollection[Element]
16536+
MathMLElement[JC] def getElementsByTagNameNS(namespaceURI: String, localName: String): HTMLCollection[Element]
16537+
MathMLElement[JC] def hasAttribute(name: String): Boolean
16538+
MathMLElement[JC] def hasAttributeNS(namespaceURI: String, localName: String): Boolean
16539+
MathMLElement[JC] def hasAttributes(): Boolean
16540+
MathMLElement[JC] def hasChildNodes(): Boolean
16541+
MathMLElement[JC] def hasPointerCapture(pointerId: Double): Boolean
16542+
MathMLElement[JC] var id: String
16543+
MathMLElement[JC] var innerHTML: String
16544+
MathMLElement[JC] var innerText: String
16545+
MathMLElement[JC] def insertAdjacentElement(position: String, element: Element): Element
16546+
MathMLElement[JC] def insertAdjacentHTML(where: String, html: String): Unit
16547+
MathMLElement[JC] def insertBefore(newChild: Node, refChild: Node): Node
16548+
MathMLElement[JC] var intent: String
16549+
MathMLElement[JC] def isConnected: Boolean
16550+
MathMLElement[JC] def isDefaultNamespace(namespaceURI: String): Boolean
16551+
MathMLElement[JC] def isEqualNode(arg: Node): Boolean
16552+
MathMLElement[JC] def isSameNode(other: Node): Boolean
16553+
MathMLElement[JC] def isSupported(feature: String, version: String): Boolean
16554+
MathMLElement[JC] def lastChild: Node
16555+
MathMLElement[JC] def lastElementChild: Element
16556+
MathMLElement[JC] def localName: String
16557+
MathMLElement[JC] def lookupNamespaceURI(prefix: String): String
16558+
MathMLElement[JC] def lookupPrefix(namespaceURI: String): String
16559+
MathMLElement[JC] def matches(selector: String): Boolean
16560+
MathMLElement[JC] var mathbackground: String
16561+
MathMLElement[JC] var mathcolor: String
16562+
MathMLElement[JC] var mathsize: String
16563+
MathMLElement[JC] def namespaceURI: String
16564+
MathMLElement[JC] def nextElementSibling: Element
16565+
MathMLElement[JC] def nextSibling: Node
16566+
MathMLElement[JC] def nodeName: String
16567+
MathMLElement[JC] def nodeType: Int
16568+
MathMLElement[JC] var nodeValue: String
16569+
MathMLElement[JC] var nonce: String
16570+
MathMLElement[JC] def normalize(): Unit
16571+
MathMLElement[JC] var onclick: js.Function1[MouseEvent, _]
16572+
MathMLElement[JC] var oncompositionend: js.Function1[CompositionEvent, _]
16573+
MathMLElement[JC] var oncompositionstart: js.Function1[CompositionEvent, _]
16574+
MathMLElement[JC] var oncompositionupdate: js.Function1[CompositionEvent, _]
16575+
MathMLElement[JC] var oncopy: js.Function1[ClipboardEvent, _]
16576+
MathMLElement[JC] var oncut: js.Function1[ClipboardEvent, _]
16577+
MathMLElement[JC] var onfocusin: js.Function1[FocusEvent, _]
16578+
MathMLElement[JC] var onfocusout: js.Function1[FocusEvent, _]
16579+
MathMLElement[JC] var onfullscreenchange: js.Function1[Event, _]
16580+
MathMLElement[JC] var onfullscreenerror: js.Function1[Event, _]
16581+
MathMLElement[JC] var onload: js.Function1[Event, _]
16582+
MathMLElement[JC] var onmousedown: js.Function1[MouseEvent, _]
16583+
MathMLElement[JC] var onmousemove: js.Function1[MouseEvent, _]
16584+
MathMLElement[JC] var onmouseout: js.Function1[MouseEvent, _]
16585+
MathMLElement[JC] var onmouseover: js.Function1[MouseEvent, _]
16586+
MathMLElement[JC] var onmouseup: js.Function1[MouseEvent, _]
16587+
MathMLElement[JC] var onpaste: js.Function1[ClipboardEvent, _]
16588+
MathMLElement[JC] var outerHTML: String
16589+
MathMLElement[JC] def ownerDocument: Document
16590+
MathMLElement[JC] def parentNode: Node
16591+
MathMLElement[JC] def prefix: String
16592+
MathMLElement[JC] def prepend(nodes: Node | String*): Unit
16593+
MathMLElement[JC] def previousElementSibling: Element
16594+
MathMLElement[JC] def previousSibling: Node
16595+
MathMLElement[JC] def querySelector(selectors: String): Element
16596+
MathMLElement[JC] def querySelectorAll(selectors: String): NodeList[Element]
16597+
MathMLElement[JC] def releasePointerCapture(pointerId: Double): Unit
16598+
MathMLElement[JC] def remove(): Unit
16599+
MathMLElement[JC] def removeAttribute(name: String): Unit
16600+
MathMLElement[JC] def removeAttributeNS(namespaceURI: String, localName: String): Unit
16601+
MathMLElement[JC] def removeAttributeNode(oldAttr: Attr): Attr
16602+
MathMLElement[JC] def removeChild(oldChild: Node): Node
16603+
MathMLElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
16604+
MathMLElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
16605+
MathMLElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
16606+
MathMLElement[JC] def replaceChildren(nodes: Node | String*): Unit
16607+
MathMLElement[JC] def replaceWith(nodes: Node | String*): Unit
16608+
MathMLElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
16609+
MathMLElement[JC] def requestPointerLock(): Unit
16610+
MathMLElement[JC] var scriptlevel: Int
16611+
MathMLElement[JC] def scrollHeight: Int
16612+
MathMLElement[JC] def scrollIntoView(top: Boolean?): Unit
16613+
MathMLElement[JC] var scrollLeft: Double
16614+
MathMLElement[JC] var scrollTop: Double
16615+
MathMLElement[JC] def scrollWidth: Int
16616+
MathMLElement[JC] def setAttribute(name: String, value: String): Unit
16617+
MathMLElement[JC] def setAttributeNS(namespaceURI: String, qualifiedName: String, value: String): Unit
16618+
MathMLElement[JC] def setAttributeNode(newAttr: Attr): Attr
16619+
MathMLElement[JC] def setAttributeNodeNS(newAttr: Attr): Attr
16620+
MathMLElement[JC] def setPointerCapture(pointerId: Double): Unit
16621+
MathMLElement[JC] def shadowRoot: ShadowRoot
16622+
MathMLElement[JC] var style: String
16623+
MathMLElement[JC] var tabindex: Int
16624+
MathMLElement[JC] def tagName: String
16625+
MathMLElement[JC] var textContent: String
16626+
MathMLElement[JC] var xmlbase: String
1649816627
MediaDeviceInfo[JT] val deviceId: String
1649916628
MediaDeviceInfo[JT] val groupId: String
1650016629
MediaDeviceInfo[JT] val kind: MediaDeviceKind

api-reports/2_13.txt

+129
Original file line numberDiff line numberDiff line change
@@ -16495,6 +16495,135 @@ MIMEType[SO] val `application/xml` = "application/xml".asInstanceOf[MIMEType]
1649516495
MIMEType[SO] val `image/svg+xml` = "image/svg+xml".asInstanceOf[MIMEType]
1649616496
MIMEType[SO] val `text/html` = "text/html".asInstanceOf[MIMEType]
1649716497
MIMEType[SO] val `text/xml` = "text/xml".asInstanceOf[MIMEType]
16498+
MathMLElement[JC] var accessKey: String
16499+
MathMLElement[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
16500+
MathMLElement[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
16501+
MathMLElement[JC] def after(nodes: Node | String*): Unit
16502+
MathMLElement[JC] def append(nodes: Node | String*): Unit
16503+
MathMLElement[JC] def appendChild(newChild: Node): Node
16504+
MathMLElement[JC] var arg: String
16505+
MathMLElement[JC] def attachShadow(init: ShadowRootInit): ShadowRoot
16506+
MathMLElement[JC] def attributes: NamedNodeMap
16507+
MathMLElement[JC] var autofocus: Boolean
16508+
MathMLElement[JC] def baseURI: String
16509+
MathMLElement[JC] def before(nodes: Node | String*): Unit
16510+
MathMLElement[JC] def childElementCount: Int
16511+
MathMLElement[JC] def childNodes: NodeList[Node]
16512+
MathMLElement[JC] def children: HTMLCollection[Element]
16513+
MathMLElement[JC] var `class`: String
16514+
MathMLElement[JC] var classList: DOMTokenList
16515+
MathMLElement[JC] def clientHeight: Int
16516+
MathMLElement[JC] def clientLeft: Int
16517+
MathMLElement[JC] def clientTop: Int
16518+
MathMLElement[JC] def clientWidth: Int
16519+
MathMLElement[JC] def cloneNode(deep: Boolean?): Node
16520+
MathMLElement[JC] def closest(selector: String): Element
16521+
MathMLElement[JC] def compareDocumentPosition(other: Node): Int
16522+
MathMLElement[JC] def contains(otherNode: Node): Boolean
16523+
MathMLElement[JC] var dir: String
16524+
MathMLElement[JC] def dispatchEvent(evt: Event): Boolean
16525+
MathMLElement[JC] var displaystyle: Boolean
16526+
MathMLElement[JC] def firstChild: Node
16527+
MathMLElement[JC] def firstElementChild: Element
16528+
MathMLElement[JC] def getAttribute(name: String): String
16529+
MathMLElement[JC] def getAttributeNS(namespaceURI: String, localName: String): String
16530+
MathMLElement[JC] def getAttributeNode(name: String): Attr
16531+
MathMLElement[JC] def getAttributeNodeNS(namespaceURI: String, localName: String): Attr
16532+
MathMLElement[JC] def getBoundingClientRect(): DOMRect
16533+
MathMLElement[JC] def getClientRects(): DOMRectList
16534+
MathMLElement[JC] def getElementsByClassName(classNames: String): HTMLCollection[Element]
16535+
MathMLElement[JC] def getElementsByTagName(name: String): HTMLCollection[Element]
16536+
MathMLElement[JC] def getElementsByTagNameNS(namespaceURI: String, localName: String): HTMLCollection[Element]
16537+
MathMLElement[JC] def hasAttribute(name: String): Boolean
16538+
MathMLElement[JC] def hasAttributeNS(namespaceURI: String, localName: String): Boolean
16539+
MathMLElement[JC] def hasAttributes(): Boolean
16540+
MathMLElement[JC] def hasChildNodes(): Boolean
16541+
MathMLElement[JC] def hasPointerCapture(pointerId: Double): Boolean
16542+
MathMLElement[JC] var id: String
16543+
MathMLElement[JC] var innerHTML: String
16544+
MathMLElement[JC] var innerText: String
16545+
MathMLElement[JC] def insertAdjacentElement(position: String, element: Element): Element
16546+
MathMLElement[JC] def insertAdjacentHTML(where: String, html: String): Unit
16547+
MathMLElement[JC] def insertBefore(newChild: Node, refChild: Node): Node
16548+
MathMLElement[JC] var intent: String
16549+
MathMLElement[JC] def isConnected: Boolean
16550+
MathMLElement[JC] def isDefaultNamespace(namespaceURI: String): Boolean
16551+
MathMLElement[JC] def isEqualNode(arg: Node): Boolean
16552+
MathMLElement[JC] def isSameNode(other: Node): Boolean
16553+
MathMLElement[JC] def isSupported(feature: String, version: String): Boolean
16554+
MathMLElement[JC] def lastChild: Node
16555+
MathMLElement[JC] def lastElementChild: Element
16556+
MathMLElement[JC] def localName: String
16557+
MathMLElement[JC] def lookupNamespaceURI(prefix: String): String
16558+
MathMLElement[JC] def lookupPrefix(namespaceURI: String): String
16559+
MathMLElement[JC] def matches(selector: String): Boolean
16560+
MathMLElement[JC] var mathbackground: String
16561+
MathMLElement[JC] var mathcolor: String
16562+
MathMLElement[JC] var mathsize: String
16563+
MathMLElement[JC] def namespaceURI: String
16564+
MathMLElement[JC] def nextElementSibling: Element
16565+
MathMLElement[JC] def nextSibling: Node
16566+
MathMLElement[JC] def nodeName: String
16567+
MathMLElement[JC] def nodeType: Int
16568+
MathMLElement[JC] var nodeValue: String
16569+
MathMLElement[JC] var nonce: String
16570+
MathMLElement[JC] def normalize(): Unit
16571+
MathMLElement[JC] var onclick: js.Function1[MouseEvent, _]
16572+
MathMLElement[JC] var oncompositionend: js.Function1[CompositionEvent, _]
16573+
MathMLElement[JC] var oncompositionstart: js.Function1[CompositionEvent, _]
16574+
MathMLElement[JC] var oncompositionupdate: js.Function1[CompositionEvent, _]
16575+
MathMLElement[JC] var oncopy: js.Function1[ClipboardEvent, _]
16576+
MathMLElement[JC] var oncut: js.Function1[ClipboardEvent, _]
16577+
MathMLElement[JC] var onfocusin: js.Function1[FocusEvent, _]
16578+
MathMLElement[JC] var onfocusout: js.Function1[FocusEvent, _]
16579+
MathMLElement[JC] var onfullscreenchange: js.Function1[Event, _]
16580+
MathMLElement[JC] var onfullscreenerror: js.Function1[Event, _]
16581+
MathMLElement[JC] var onload: js.Function1[Event, _]
16582+
MathMLElement[JC] var onmousedown: js.Function1[MouseEvent, _]
16583+
MathMLElement[JC] var onmousemove: js.Function1[MouseEvent, _]
16584+
MathMLElement[JC] var onmouseout: js.Function1[MouseEvent, _]
16585+
MathMLElement[JC] var onmouseover: js.Function1[MouseEvent, _]
16586+
MathMLElement[JC] var onmouseup: js.Function1[MouseEvent, _]
16587+
MathMLElement[JC] var onpaste: js.Function1[ClipboardEvent, _]
16588+
MathMLElement[JC] var outerHTML: String
16589+
MathMLElement[JC] def ownerDocument: Document
16590+
MathMLElement[JC] def parentNode: Node
16591+
MathMLElement[JC] def prefix: String
16592+
MathMLElement[JC] def prepend(nodes: Node | String*): Unit
16593+
MathMLElement[JC] def previousElementSibling: Element
16594+
MathMLElement[JC] def previousSibling: Node
16595+
MathMLElement[JC] def querySelector(selectors: String): Element
16596+
MathMLElement[JC] def querySelectorAll(selectors: String): NodeList[Element]
16597+
MathMLElement[JC] def releasePointerCapture(pointerId: Double): Unit
16598+
MathMLElement[JC] def remove(): Unit
16599+
MathMLElement[JC] def removeAttribute(name: String): Unit
16600+
MathMLElement[JC] def removeAttributeNS(namespaceURI: String, localName: String): Unit
16601+
MathMLElement[JC] def removeAttributeNode(oldAttr: Attr): Attr
16602+
MathMLElement[JC] def removeChild(oldChild: Node): Node
16603+
MathMLElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
16604+
MathMLElement[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
16605+
MathMLElement[JC] def replaceChild(newChild: Node, oldChild: Node): Node
16606+
MathMLElement[JC] def replaceChildren(nodes: Node | String*): Unit
16607+
MathMLElement[JC] def replaceWith(nodes: Node | String*): Unit
16608+
MathMLElement[JC] def requestFullscreen(options: FullscreenOptions?): js.Promise[Unit]
16609+
MathMLElement[JC] def requestPointerLock(): Unit
16610+
MathMLElement[JC] var scriptlevel: Int
16611+
MathMLElement[JC] def scrollHeight: Int
16612+
MathMLElement[JC] def scrollIntoView(top: Boolean?): Unit
16613+
MathMLElement[JC] var scrollLeft: Double
16614+
MathMLElement[JC] var scrollTop: Double
16615+
MathMLElement[JC] def scrollWidth: Int
16616+
MathMLElement[JC] def setAttribute(name: String, value: String): Unit
16617+
MathMLElement[JC] def setAttributeNS(namespaceURI: String, qualifiedName: String, value: String): Unit
16618+
MathMLElement[JC] def setAttributeNode(newAttr: Attr): Attr
16619+
MathMLElement[JC] def setAttributeNodeNS(newAttr: Attr): Attr
16620+
MathMLElement[JC] def setPointerCapture(pointerId: Double): Unit
16621+
MathMLElement[JC] def shadowRoot: ShadowRoot
16622+
MathMLElement[JC] var style: String
16623+
MathMLElement[JC] var tabindex: Int
16624+
MathMLElement[JC] def tagName: String
16625+
MathMLElement[JC] var textContent: String
16626+
MathMLElement[JC] var xmlbase: String
1649816627
MediaDeviceInfo[JT] val deviceId: String
1649916628
MediaDeviceInfo[JT] val groupId: String
1650016629
MediaDeviceInfo[JT] val kind: MediaDeviceKind
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.scalajs.dom
2+
3+
import scala.scalajs.js
4+
import scala.scalajs.js.annotation._
5+
6+
/** The MathMLElement interface represents any MathML element. */
7+
@js.native
8+
@JSGlobal
9+
abstract class MathMLElement extends Element {
10+
var onclick: js.Function1[MouseEvent, _] = js.native
11+
var onmouseover: js.Function1[MouseEvent, _] = js.native
12+
var onmouseout: js.Function1[MouseEvent, _] = js.native
13+
var onmousedown: js.Function1[MouseEvent, _] = js.native
14+
var onmouseup: js.Function1[MouseEvent, _] = js.native
15+
var onmousemove: js.Function1[MouseEvent, _] = js.native
16+
var onload: js.Function1[Event, _] = js.native
17+
var onfocusin: js.Function1[FocusEvent, _] = js.native
18+
var onfocusout: js.Function1[FocusEvent, _] = js.native
19+
20+
/** Corresponds to attribute xml:base on the given element. */
21+
var xmlbase: String = js.native
22+
23+
var autofocus: Boolean = js.native
24+
var `class`: String = js.native
25+
var dir: String = js.native
26+
var displaystyle: Boolean = js.native
27+
var mathbackground: String = js.native
28+
var mathcolor: String = js.native
29+
var mathsize: String = js.native
30+
var nonce: String = js.native
31+
var scriptlevel: Int = js.native
32+
var style: String = js.native
33+
var tabindex: Int = js.native
34+
35+
var intent: String = js.native
36+
var arg: String = js.native
37+
38+
}

tests-shared/src/main/scala/org/scalajs/dom/tests/shared/BrowserTests.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ trait BrowserTests extends WebCryptoApiTests {
137137
import org.scalajs.dom.{ImageData, ImageDataSettings, PredefinedColorSpace}
138138
import PredefinedColorSpace._
139139

140-
val width:Int = 200
141-
val height:Int = 100
140+
val width: Int = 200
141+
val height: Int = 100
142142

143143
// new ImageData(width, height)
144144
val imgDat1: ImageData = new ImageData(width, height)
@@ -164,7 +164,8 @@ trait BrowserTests extends WebCryptoApiTests {
164164
assertEquals(imgDat3.data.length, width * height * 4)
165165

166166
// new ImageData(dataArray, width, height, settings)
167-
val defaultImageData: ImageData = new ImageData(imgDat3.data, width, height, new ImageDataSettings { colorSpace = `display-p3` })
167+
val defaultImageData: ImageData =
168+
new ImageData(imgDat3.data, width, height, new ImageDataSettings { colorSpace = `display-p3` })
168169
assertEquals(defaultImageData.width, width)
169170
assertEquals(defaultImageData.height, height)
170171
}

0 commit comments

Comments
 (0)