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.
 
 

26 lines
630 B

"use strict";
var Node = require('./Node.js');
var NonDocumentTypeChildNode = {
nextElementSibling: { get: function() {
if (this.parentNode) {
for (var kid = this.nextSibling; kid !== null; kid = kid.nextSibling) {
if (kid.nodeType === Node.ELEMENT_NODE) return kid;
}
}
return null;
}},
previousElementSibling: { get: function() {
if (this.parentNode) {
for (var kid = this.previousSibling; kid !== null; kid = kid.previousSibling) {
if (kid.nodeType === Node.ELEMENT_NODE) return kid;
}
}
return null;
}}
};
module.exports = NonDocumentTypeChildNode;