You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
675 B
28 lines
675 B
"use strict";
|
|
|
|
const { domSymbolTree } = require("../helpers/internal-constants");
|
|
const NODE_TYPE = require("../node-type");
|
|
|
|
class NonDocumentTypeChildNodeImpl {
|
|
get nextElementSibling() {
|
|
for (const sibling of domSymbolTree.nextSiblingsIterator(this)) {
|
|
if (sibling.nodeType === NODE_TYPE.ELEMENT_NODE) {
|
|
return sibling;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
get previousElementSibling() {
|
|
for (const sibling of domSymbolTree.previousSiblingsIterator(this)) {
|
|
if (sibling.nodeType === NODE_TYPE.ELEMENT_NODE) {
|
|
return sibling;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
implementation: NonDocumentTypeChildNodeImpl
|
|
};
|
|
|