Skip to content

Commit 7554ec6

Browse files
committed
Merge pull request scala-js#141 from japgolly/NonDocumentTypeChildNode
Add NonDocumentTypeChildNode
2 parents 447f545 + 1189eb7 commit 7554ec6

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/main/scala/org/scalajs/dom/raw/lib.scala

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,36 @@ trait ParentNode extends js.Object {
785785

786786
}
787787

788+
/**
789+
* The NonDocumentTypeChildNode interface contains methods that are particular to
790+
* Node objects that can have a parent, but not suitable for DocumentType.
791+
*
792+
* NonDocumentTypeChildNode is a raw interface and no object of this type can be
793+
* created; it is implemented by Element, and CharacterData objects.
794+
*
795+
* https://developer.mozilla.org/en-US/docs/Web/API/NonDocumentTypeChildNode
796+
*/
797+
trait NonDocumentTypeChildNode extends js.Object {
798+
799+
/**
800+
* The previousElementSibling read-only property returns the Element immediately prior
801+
* to the specified one in its parent's children list, or null if the specified element
802+
* is the first one in the list.
803+
*
804+
* MDN
805+
*/
806+
def previousElementSibling: Element = js.native
807+
808+
/**
809+
* The nextElementSibling read-only property returns the element immediately following
810+
* the specified one in its parent's children list, or null if the specified element is
811+
* the last one in the list.
812+
*
813+
* MDN
814+
*/
815+
def nextElementSibling: Element = js.native
816+
}
817+
788818
/**
789819
* The Element interface represents part of the document. This interface describes
790820
* methods and properties common to each kind of elements. Specific behaviors are
@@ -793,7 +823,7 @@ trait ParentNode extends js.Object {
793823
*
794824
* https://developer.mozilla.org/en-US/docs/Web/API/element
795825
*/
796-
abstract class Element extends Node with NodeSelector with ParentNode {
826+
abstract class Element extends Node with NodeSelector with ParentNode with NonDocumentTypeChildNode {
797827

798828

799829
/**
@@ -5689,7 +5719,7 @@ class StorageEvent extends Event {
56895719
*
56905720
* MDN
56915721
*/
5692-
abstract class CharacterData extends Node {
5722+
abstract class CharacterData extends Node with NonDocumentTypeChildNode {
56935723
/**
56945724
* Returns an unsigned long representing the size of the string contained in
56955725
* CharacterData.data.

0 commit comments

Comments
 (0)