Sha256: 5604d577411e4d269a589881550598c06ad4615fafce19e2a8cbd5eb42702f6a

Contents?: true

Size: 685 Bytes

Versions: 3

Compression:

Stored size: 685 Bytes

Contents

"use strict";

const domSymbolTree = require("../helpers/internal-constants").domSymbolTree;
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
};

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js
lanes-0.8.0 node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js
select_all-rails-0.3.1 node_modules/jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js