Skip to content

Commit ed2704b

Browse files
committed
Add NonDocumentTypeChildNode
1 parent 447f545 commit ed2704b

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

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

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,32 @@ 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+
* Returns the Element immediately prior to this node in its parent's children list.
801+
*
802+
* MDN
803+
*/
804+
def previousElementSibling: js.UndefOr[Element] = js.native
805+
806+
/**
807+
* Returns the Element immediately following this node in its parent's children list.
808+
*
809+
* MDN
810+
*/
811+
def nextElementSibling: js.UndefOr[Element] = js.native
812+
}
813+
788814
/**
789815
* The Element interface represents part of the document. This interface describes
790816
* methods and properties common to each kind of elements. Specific behaviors are
@@ -793,7 +819,7 @@ trait ParentNode extends js.Object {
793819
*
794820
* https://developer.mozilla.org/en-US/docs/Web/API/element
795821
*/
796-
abstract class Element extends Node with NodeSelector with ParentNode {
822+
abstract class Element extends Node with NodeSelector with ParentNode with NonDocumentTypeChildNode {
797823

798824

799825
/**
@@ -5689,7 +5715,7 @@ class StorageEvent extends Event {
56895715
*
56905716
* MDN
56915717
*/
5692-
abstract class CharacterData extends Node {
5718+
abstract class CharacterData extends Node with NonDocumentTypeChildNode {
56935719
/**
56945720
* Returns an unsigned long representing the size of the string contained in
56955721
* CharacterData.data.

0 commit comments

Comments
 (0)