Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add options parameter to Document#createElement #788

Merged
merged 4 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,11 @@ Document[JC] def createCDATASection(data: String): CDATASection
Document[JC] def createComment(data: String): Comment
Document[JC] def createDocumentFragment(): DocumentFragment
Document[JC] def createElement(tagName: String): Element
Document[JC] def createElement(tagName: String, options: ElementCreationOptions): Element
Document[JC] def createElement(tagName: String, options: String): Element
Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element
Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element
Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element
Document[JC] def createEvent(eventInterface: String): Event
Document[JC] def createNSResolver(node: Node): XPathNSResolver
Document[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator
Expand Down Expand Up @@ -2065,6 +2069,7 @@ Element[JC] def setAttributeNodeNS(newAttr: Attr): Attr
Element[JC] def shadowRoot: ShadowRoot
Element[JC] def tagName: String
Element[JC] var textContent: String
ElementCreationOptions[JT] var is: js.UndefOr[String]
ElementDefinitionOptions[JT] var `extends`: js.UndefOr[String]
EndOfStreamError[JT]
EndOfStreamError[SO] val decode: EndOfStreamError
Expand Down Expand Up @@ -4902,7 +4907,11 @@ HTMLDocument[JC] def createCDATASection(data: String): CDATASection
HTMLDocument[JC] def createComment(data: String): Comment
HTMLDocument[JC] def createDocumentFragment(): DocumentFragment
HTMLDocument[JC] def createElement(tagName: String): Element
HTMLDocument[JC] def createElement(tagName: String, options: ElementCreationOptions): Element
HTMLDocument[JC] def createElement(tagName: String, options: String): Element
HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element
HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element
HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element
HTMLDocument[JC] def createEvent(eventInterface: String): Event
HTMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver
HTMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator
Expand Down
9 changes: 9 additions & 0 deletions api-reports/2_13.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,11 @@ Document[JC] def createCDATASection(data: String): CDATASection
Document[JC] def createComment(data: String): Comment
Document[JC] def createDocumentFragment(): DocumentFragment
Document[JC] def createElement(tagName: String): Element
Document[JC] def createElement(tagName: String, options: ElementCreationOptions): Element
Document[JC] def createElement(tagName: String, options: String): Element
Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element
Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element
Document[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element
Document[JC] def createEvent(eventInterface: String): Event
Document[JC] def createNSResolver(node: Node): XPathNSResolver
Document[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator
Expand Down Expand Up @@ -2065,6 +2069,7 @@ Element[JC] def setAttributeNodeNS(newAttr: Attr): Attr
Element[JC] def shadowRoot: ShadowRoot
Element[JC] def tagName: String
Element[JC] var textContent: String
ElementCreationOptions[JT] var is: js.UndefOr[String]
ElementDefinitionOptions[JT] var `extends`: js.UndefOr[String]
EndOfStreamError[JT]
EndOfStreamError[SO] val decode: EndOfStreamError
Expand Down Expand Up @@ -4902,7 +4907,11 @@ HTMLDocument[JC] def createCDATASection(data: String): CDATASection
HTMLDocument[JC] def createComment(data: String): Comment
HTMLDocument[JC] def createDocumentFragment(): DocumentFragment
HTMLDocument[JC] def createElement(tagName: String): Element
HTMLDocument[JC] def createElement(tagName: String, options: ElementCreationOptions): Element
HTMLDocument[JC] def createElement(tagName: String, options: String): Element
HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String): Element
HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element
HTMLDocument[JC] def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element
HTMLDocument[JC] def createEvent(eventInterface: String): Event
HTMLDocument[JC] def createNSResolver(node: Node): XPathNSResolver
HTMLDocument[JC] def createNodeIterator(root: Node, whatToShow: Int, filter: NodeFilter, entityReferenceExpansion: Boolean): NodeIterator
Expand Down
8 changes: 8 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/Document.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,17 @@ abstract class Document extends Node with NodeSelector with DocumentEvent with P
*/
def createElement(tagName: String): Element = js.native

def createElement(tagName: String, options: String): Element = js.native

def createElement(tagName: String, options: ElementCreationOptions): Element = js.native

/** Creates an element with the specified namespace URI and qualified name. */
def createElementNS(namespaceURI: String, qualifiedName: String): Element = js.native

def createElementNS(namespaceURI: String, qualifiedName: String, options: String): Element = js.native

def createElementNS(namespaceURI: String, qualifiedName: String, options: ElementCreationOptions): Element = js.native

/** createAttribute creates a new attribute node, and returns it. */
def createAttribute(name: String): Attr = js.native

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.scalajs.dom

import scala.scalajs.js

trait ElementCreationOptions extends js.Object {
var is: js.UndefOr[String] = js.undefined
}