Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/227937

Change subject: Update domino to 1.0.19.
......................................................................

Update domino to 1.0.19.

This provides some fixes to the TreeWalker interface which are needed
for the new mwparserfromhell-like JsApi.

Change-Id: Ie1de26734b00712237adebf55e16c50d1ccea5ec
---
M node_modules/domino/.travis.yml
M node_modules/domino/CHANGELOG.md
M node_modules/domino/lib/Document.js
A node_modules/domino/lib/NodeIterator.js
A node_modules/domino/lib/NodeTraversal.js
M node_modules/domino/lib/TreeWalker.js
M node_modules/domino/package.json
M node_modules/domino/test/domino.js
M node_modules/domino/test/fixture/doc.html
9 files changed, 325 insertions(+), 81 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid/deploy 
refs/changes/37/227937/1

diff --git a/node_modules/domino/.travis.yml b/node_modules/domino/.travis.yml
index f238dc5..df42fb2 100644
--- a/node_modules/domino/.travis.yml
+++ b/node_modules/domino/.travis.yml
@@ -4,3 +4,4 @@
   - 0.10
   - 0.11
 script: npm run test-spec
+sudo: false
diff --git a/node_modules/domino/CHANGELOG.md b/node_modules/domino/CHANGELOG.md
index 74fc313..cc944b6 100644
--- a/node_modules/domino/CHANGELOG.md
+++ b/node_modules/domino/CHANGELOG.md
@@ -1,3 +1,9 @@
+# domino 1.0.19 (29 Jul 2015)
+* Bug fixes for `TreeWalker` / `document.createTreeWalker` (filter
+  argument was ignored; various traversal issues)
+* Implement `NodeIterator` / `document.createNodeIterator` (#54)
+* Update `mocha` dependency to 2.2.x and `should` to 7.0.x.
+
 # domino 1.0.18 (25 Sep 2014)
 * HTMLAnchorElement now implements URLUtils. (#47)
 * Be consistent with our handling of null/empty namespaces. (#48)
diff --git a/node_modules/domino/lib/Document.js 
b/node_modules/domino/lib/Document.js
index 3dd15cf..16d1246 100644
--- a/node_modules/domino/lib/Document.js
+++ b/node_modules/domino/lib/Document.js
@@ -11,6 +11,7 @@
 var DOMImplementation = require('./DOMImplementation');
 var FilteredElementList = require('./FilteredElementList');
 var TreeWalker = require('./TreeWalker');
+var NodeIterator = require('./NodeIterator');
 var NodeFilter = require('./NodeFilter');
 var URL = require('./URL');
 var select = require('./select')
@@ -184,9 +185,10 @@
   createTreeWalker: {value: function (root, whatToShow, filter) {
     whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : whatToShow;
 
-    if (filter && typeof filter.acceptNode == 'function') {
-      filter = filter.acceptNode;
-      // Support filter being a function
+    if (filter && typeof filter === 'object' &&
+               typeof filter.acceptNode == 'function') {
+      filter = filter.acceptNode.bind(filter);
+       // Support filter being a function
       // https://developer.mozilla.org/en-US/docs/DOM/document.createTreeWalker
     }
     else if (typeof filter != 'function') {
@@ -195,6 +197,22 @@
     return new TreeWalker(root, whatToShow, filter);
   }},
 
+  // See: http://www.w3.org/TR/dom/#dom-document-createnodeiterator
+  createNodeIterator: {value: function (root, whatToShow, filter) {
+    whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : whatToShow;
+
+    if (filter && typeof filter === 'object' &&
+               typeof filter.acceptNode == 'function') {
+      filter = filter.acceptNode.bind(filter);
+      // Support filter being a function
+      // 
https://developer.mozilla.org/en-US/docs/DOM/document.createNodeIterator
+    }
+    else if (typeof filter != 'function') {
+      filter = null;
+    }
+    return new NodeIterator(root, whatToShow, filter);
+  }},
+
   // Add some (surprisingly complex) document hierarchy validity
   // checks when adding, removing and replacing nodes into a
   // document object, and also maintain the documentElement and
diff --git a/node_modules/domino/lib/NodeIterator.js 
b/node_modules/domino/lib/NodeIterator.js
new file mode 100644
index 0000000..11892ba
--- /dev/null
+++ b/node_modules/domino/lib/NodeIterator.js
@@ -0,0 +1,144 @@
+module.exports = NodeIterator;
+
+var NodeFilter = require('./NodeFilter');
+var NodeTraversal = require('./NodeTraversal');
+
+/* Private methods and helpers */
+
+/**
+ * @based on WebKit's NodeIterator::moveToNext and NodeIterator::moveToPrevious
+ * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeIterator.cpp?rev=186279#L51
+ */
+function move(node, stayWithin, directionIsNext) {
+  if (directionIsNext) {
+    return NodeTraversal.next(node, stayWithin);
+  } else {
+    if (node === stayWithin) {
+      return null;
+    }
+    return NodeTraversal.previous(node, null);
+  }
+}
+
+/**
+ * @spec http://www.w3.org/TR/dom/#concept-nodeiterator-traverse
+ * @method
+ * @access private
+ * @param {NodeIterator} ni
+ * @param {string} direction One of 'next' or 'previous'.
+ * @return {Node|null}
+ */
+function traverse(ni, directionIsNext) {
+  var node, beforeNode;
+  node = ni.referenceNode;
+  beforeNode = ni.pointerBeforeReferenceNode;
+  while (true) {
+    if (beforeNode === directionIsNext) {
+      beforeNode = !beforeNode;
+    } else {
+      node = move(node, ni.root, directionIsNext);
+      if (node === null) {
+        return null;
+      }
+    }
+    result = ni.filter.acceptNode(node);
+    if (result === NodeFilter.FILTER_ACCEPT) {
+      break;
+    }
+  }
+  ni.referenceNode = node;
+  ni.pointerBeforeReferenceNode = beforeNode;
+  return node;
+}
+
+/* Public API */
+
+/**
+ * Implemented version: http://www.w3.org/TR/2015/WD-dom-20150618/#nodeiterator
+ * Latest version: http://www.w3.org/TR/dom/#nodeiterator
+ *
+ * @constructor
+ * @param {Node} root
+ * @param {number} whatToShow [optional]
+ * @param {Function|NodeFilter} filter [optional]
+ * @throws Error
+ */
+function NodeIterator(root, whatToShow, filter) {
+  var ni = this, active = false;
+
+  if (!root || !root.nodeType) {
+    throw new Error('DOMException: NOT_SUPPORTED_ERR');
+  }
+
+  ni.root = ni.referenceNode = root;
+  ni.pointerBeforeReferenceNode = true;
+  ni.whatToShow = Number(whatToShow) || 0;
+
+  if (typeof filter !== 'function') {
+    filter = null;
+  }
+
+  ni.filter = Object.create(NodeFilter.prototype);
+
+  /**
+   * @method
+   * @param {Node} node
+   * @return {Number} Constant NodeFilter.FILTER_ACCEPT,
+   *  NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP.
+   */
+  ni.filter.acceptNode = function (node) {
+    var result;
+    if (active) {
+      throw new Error('DOMException: INVALID_STATE_ERR');
+    }
+
+    // Maps nodeType to whatToShow
+    if (!(((1 << (node.nodeType - 1)) & ni.whatToShow))) {
+      return NodeFilter.FILTER_SKIP;
+    }
+
+    if (filter === null) {
+      return NodeFilter.FILTER_ACCEPT;
+    }
+
+    active = true;
+    result = filter(node);
+    active = false;
+
+    return result;
+  };
+};
+
+NodeIterator.prototype = {
+  constructor: NodeIterator,
+
+  /**
+   * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-nextnode
+   * @method
+   * @return {Node|null}
+   */
+  nextNode: function () {
+    return traverse(this, true);
+  },
+
+  /**
+   * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-previousnode
+   * @method
+   * @return {Node|null}
+   */
+  previousNode: function () {
+    return traverse(this, false);
+  },
+
+  /**
+   * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-detach
+   * @method
+   * @return void
+   */
+  detach: function() {
+    /* "The detach() method must do nothing.
+     * Its functionality (disabling a NodeIterator object) was removed,
+     * but the method itself is preserved for compatibility.
+     */
+  }
+};
diff --git a/node_modules/domino/lib/NodeTraversal.js 
b/node_modules/domino/lib/NodeTraversal.js
new file mode 100644
index 0000000..65582ab
--- /dev/null
+++ b/node_modules/domino/lib/NodeTraversal.js
@@ -0,0 +1,85 @@
+var NodeTraversal = module.exports = {
+  nextSkippingChildren: nextSkippingChildren,
+  nextAncestorSibling: nextAncestorSibling,
+  next: next,
+  previous: previous,
+  deepLastChild: deepLastChild
+}
+
+/**
+ * @based on WebKit's NodeTraversal::nextSkippingChildren
+ * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L109
+ */
+function nextSkippingChildren(node, stayWithin) {
+  if (node === stayWithin) {
+    return null;
+  }
+  if (node.nextSibling !== null) {
+    return node.nextSibling;
+  }
+  return nextAncestorSibling(node, stayWithin);
+}
+
+/**
+ * @based on WebKit's NodeTraversal::nextAncestorSibling
+ * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L93
+ */
+function nextAncestorSibling(node, stayWithin) {
+  for (node = node.parentNode; node !== null; node = node.parentNode) {
+    if (node === stayWithin) {
+      return null;
+    }
+    if (node.nextSibling !== null) {
+      return node.nextSibling;
+    }
+  }
+  return null;
+}
+
+/**
+ * @based on WebKit's NodeTraversal::next
+ * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L99
+ */
+function next(node, stayWithin) {
+  var n;
+  n = node.firstChild;
+  if (n !== null) {
+    return n;
+  }
+  if (node === stayWithin) {
+    return null;
+  }
+  n = node.nextSibling;
+  if (n !== null) {
+    return n;
+  }
+  return nextAncestorSibling(node, stayWithin);
+}
+
+/**
+ * @based on WebKit's NodeTraversal::deepLastChild
+ * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L116
+ */
+function deepLastChild(node) {
+  while (node.lastChild) {
+       node = node.lastChild;
+  }
+  return node;
+}
+
+/**
+ * @based on WebKit's NodeTraversal::previous
+ * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L121
+ */
+function previous(node, stayWithin) {
+  var p;
+  p = node.previousSibling;
+  if (p !== null) {
+       return deepLastChild(p);
+  }
+  p = node.parentNode;
+  if (p === stayWithin) {
+       return null;
+  }
+  return p;
+}
diff --git a/node_modules/domino/lib/TreeWalker.js 
b/node_modules/domino/lib/TreeWalker.js
index 2bfe662..d24c15b 100644
--- a/node_modules/domino/lib/TreeWalker.js
+++ b/node_modules/domino/lib/TreeWalker.js
@@ -1,6 +1,7 @@
 module.exports = TreeWalker;
 
 var NodeFilter = require('./NodeFilter');
+var NodeTraversal = require('./NodeTraversal');
 
 var mapChild = {
   first: 'firstChild',
@@ -10,6 +11,8 @@
 };
 
 var mapSibling = {
+  first: 'nextSibling',
+  last: 'previousSibling',
   next: 'nextSibling',
   previous: 'previousSibling'
 };
@@ -41,7 +44,7 @@
       }
     }
     while (node !== null) {
-      sibling = node[mapChild[type]];
+      sibling = node[mapSibling[type]];
       if (sibling !== null) {
         node = sibling;
         break;
@@ -56,7 +59,7 @@
     }
   }
   return null;
-};
+}
 
 /**
  * @spec http://www.w3.org/TR/dom/#concept-traverse-siblings
@@ -82,7 +85,7 @@
         return node;
       }
       sibling = node[mapChild[type]];
-      if (result === NodeFilter.FILTER_REJECT) {
+      if (result === NodeFilter.FILTER_REJECT || sibling === null) {
         sibling = node[mapSibling[type]];
       }
     }
@@ -94,46 +97,19 @@
       return null;
     }
   }
-};
+}
 
-/**
- * @based on WebKit's NodeTraversal::nextSkippingChildren
- * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=137221#L103
- */
-function nextSkippingChildren(node, stayWithin) {
-  if (node === stayWithin) {
-    return null;
-  }
-  if (node.nextSibling !== null) {
-    return node.nextSibling;
-  }
-
-  /**
-   * @based on WebKit's NodeTraversal::nextAncestorSibling
-   * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=137221#L43
-   */
-  while (node.parentNode !== null) {
-    node = node.parentNode;
-    if (node === stayWithin) {
-      return null;
-    }
-    if (node.nextSibling !== null) {
-      return node.nextSibling;
-    }
-  }
-  return null;
-};
 
 /* Public API */
 
 /**
- * Implemented version: 
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/traversal.html#Traversal-TreeWalker
+ * Implemented version: 
http://www.w3.org/TR/2015/WD-dom-20150618/#interface-treewalker
  * Latest version: http://www.w3.org/TR/dom/#interface-treewalker
  *
  * @constructor
  * @param {Node} root
  * @param {number} whatToShow [optional]
- * @param {Function} filter [optional]
+ * @param {Function|NodeFilter} filter [optional]
  * @throws Error
  */
 function TreeWalker(root, whatToShow, filter) {
@@ -148,7 +124,7 @@
 
   tw.currentNode = root;
 
-  if (typeof filter == 'function') {
+  if (typeof filter !== 'function') {
     filter = null;
   }
 
@@ -181,7 +157,7 @@
 
     return result;
   };
-};
+}
 
 TreeWalker.prototype = {
 
@@ -261,6 +237,7 @@
           this.currentNode = node;
           return node;
         }
+        sibling = node.previousSibling;
       }
       if (node === this.root || node.parentNode === null) {
         return null;
@@ -276,6 +253,8 @@
 
   /**
    * @spec http://www.w3.org/TR/dom/#dom-treewalker-nextnode
+   * @based on WebKit's TreeWalker::nextNode
+   * 
https://trac.webkit.org/browser/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=179143#L252
    * @method
    * @return {Node|null}
    */
@@ -293,7 +272,7 @@
           return node;
         }
       }
-      following = nextSkippingChildren(node, this.root);
+      following = NodeTraversal.nextSkippingChildren(node, this.root);
       if (following !== null) {
         node = following;
       }
@@ -308,4 +287,3 @@
     }
   }
 };
-
diff --git a/node_modules/domino/package.json b/node_modules/domino/package.json
index 5111ebd..a3eaf6b 100644
--- a/node_modules/domino/package.json
+++ b/node_modules/domino/package.json
@@ -1,6 +1,6 @@
 {
   "name": "domino",
-  "version": "1.0.18",
+  "version": "1.0.19",
   "author": {
     "name": "Felix Gnass",
     "email": "[email protected]"
@@ -10,42 +10,23 @@
   "main": "./lib",
   "repository": {
     "type": "git",
-    "url": "https://github.com/fgnass/domino.git";
+    "url": "git+https://github.com/fgnass/domino.git";
   },
   "scripts": {
     "test": "mocha",
     "test-spec": "mocha -R spec"
   },
   "devDependencies": {
-    "mocha": "~1.21.4",
-    "should": "~4.0.4"
+    "mocha": "~2.2.5",
+    "should": "~7.0.2"
   },
-  "gitHead": "4fd8d1bb48fca35ce8d4fab319c663ecae43b0d5",
+  "gitHead": "f7ca3c27c7a441e18fa06da7a23b93c2a1b2a27e",
+  "readme": "# Server-side DOM implementation based on Mozilla's 
dom.js\n\n[![Build Status][1]][2] [![dependency status][3]][4] [![dev 
dependency status][5]][6]\n\nAs the name might suggest, domino's goal is to 
provide a <b>DOM in No</b>de.\n\nIn contrast to the original 
[dom.js](https://github.com/andreasgal/dom.js) project, domino was not designed 
to run untrusted code. Hence it doesn't have to hide its internals behind a 
proxy facade which makes the code not only simpler, but also [more 
performant](https://github.com/fgnass/dombench).\n\nDomino currently doesn't 
use any harmony features like proxies or WeakMaps and therefore also runs in 
older Node versions.\n\n## Speed over Compliance\n\nDomino is intended for 
_building_ pages rather than scraping them. Hence Domino doesn't execute 
scripts nor does it download external resources.\n\nAlso Domino doesn't 
implement any properties which have been deprecated in HTML5.\n\nDomino sticks 
to the [DOM level 
4](http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-attr) 
working draft, which means that Attributes do not inherit the Node interface. 
Also 
[Element.attributes](http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-element-attributes)
 returns a read-only array instead of a NamedNodeMap.\n\n<b>Note that</b> 
because domino does not use proxies,\n`Element.attributes` is not a true 
JavaScript array; it is an object\nwith a `length` property and an `item(n)` 
accessor method.  See\n[github issue 
#27](https://github.com/fgnass/domino/issues/27) for\nfurther discussion.\n\n## 
CSS Selector Support\n\nDomino provides support for `querySelector()`, 
`querySelectorAll()`, and `matches()` backed by the 
[Zest](https://github.com/chjj/zest) selector engine.\n\n## 
Usage\n\n```javascript\nvar domino = require('domino');\n\nvar window = 
domino.createWindow('<h1>Hello world</h1>');\nvar document = 
window.document;\n\nvar h1 = 
document.querySelector('h1');\nconsole.log(h1.innerHTML);\n```\n\n## 
Tests\n\nDomino includes test from the [W3C DOM Conformance 
Suites](http://www.w3.org/DOM/Test/)\nas well as tests from [HTML Working 
Group](http://www.w3.org/html/wg/wiki/Testing).\n\nThe tests can be run via 
`npm test` or directly though the [Mocha](http://visionmedia.github.com/mocha/) 
command 
line:\n\n![Screenshot](http://fgnass.github.com/images/domino.png)\n\n## 
License and Credits\n\nThe majority of the code was written by [Andreas 
Gal](https://github.com/andreasgal/) and [David 
Flanagan](https://github.com/davidflanagan) as part of the 
[dom.js](https://github.com/andreasgal/dom.js) project. Please refer to the 
included LICENSE file for the original copyright notice and disclaimer.\n\n[1]: 
https://travis-ci.org/fgnass/domino.png\n[2]: 
https://travis-ci.org/fgnass/domino\n[3]: 
https://david-dm.org/fgnass/domino.png\n[4]: 
https://david-dm.org/fgnass/domino\n[5]: 
https://david-dm.org/fgnass/domino/dev-status.png\n[6]: 
https://david-dm.org/fgnass/domino#info=devDependencies\n";,
+  "readmeFilename": "README.md",
   "bugs": {
     "url": "https://github.com/fgnass/domino/issues";
   },
-  "_id": "[email protected]",
-  "_shasum": "3a9bcf9db6d693e1ffb7d06d96c9138e1d331a7b",
-  "_from": "[email protected]",
-  "_npmVersion": "1.4.28",
-  "_npmUser": {
-    "name": "cscott",
-    "email": "[email protected]"
-  },
-  "maintainers": [
-    {
-      "name": "fgnass",
-      "email": "[email protected]"
-    },
-    {
-      "name": "cscott",
-      "email": "[email protected]"
-    }
-  ],
-  "dist": {
-    "shasum": "3a9bcf9db6d693e1ffb7d06d96c9138e1d331a7b",
-    "tarball": "http://registry.npmjs.org/domino/-/domino-1.0.18.tgz";
-  },
-  "directories": {},
-  "_resolved": "https://registry.npmjs.org/domino/-/domino-1.0.18.tgz";
+  "_id": "[email protected]",
+  "_shasum": "c7461ffa9646a5fcce7879c3f416f8cddfed1b5e",
+  "_from": "domino@~1.0.18"
 }
diff --git a/node_modules/domino/test/domino.js 
b/node_modules/domino/test/domino.js
index f6b5dc8..83610d7 100644
--- a/node_modules/domino/test/domino.js
+++ b/node_modules/domino/test/domino.js
@@ -110,7 +110,7 @@
   // but if there is a <head>, then setting Document.title should create the
   // <title> element if necessary.
   d.documentElement.insertBefore(d.createElement('head'), d.body);
-  (d.head === null).should.be.false;
+  (d.head === null).should.be.false();
   d.title.should.equal('');
   d.title = "Lorem!";
   d.title.should.equal("Lorem!");
@@ -159,10 +159,10 @@
   var cl = el.classList;
   cl.should.have.length(3);
   cl[0].should.equal('foo');
-  cl.contains('bar').should.be.ok;
-  cl.contains('baz').should.not.be.ok;
+  cl.contains('bar').should.be.ok();
+  cl.contains('baz').should.not.be.ok();
   cl.add('baz');
-  cl.contains('baz').should.be.ok;
+  cl.contains('baz').should.be.ok();
   cl.should.have.length(4);
   el.className.should.match(/baz/);
   cl.remove('foo');
@@ -178,14 +178,14 @@
   div.attributes.should.have.property('onclick');
   div.attributes.onclick.should.have.property('value', 't');
   div.removeAttribute('onclick');
-  (div.attributes.onclick === undefined).should.be.true;
+  (div.attributes.onclick === undefined).should.be.true();
 }
 
 exports.jquery = function() {
   var window = domino.createWindow(html);
   var f = __dirname + '/fixture/jquery-1.9.1.js';
   window._run(fs.readFileSync(f, 'utf8'), f);
-  window.$.should.be.ok;
+  window.$.should.be.ok();
   window.$('.foo').should.have.length(3);
 }
 
@@ -193,7 +193,10 @@
   var window = domino.createWindow(html);
   var d = window.document;
   var root = d.getElementById('tw');
-  var tw = d.createTreeWalker(root, window.NodeFilter.SHOW_TEXT);
+  var tw = d.createTreeWalker(root, window.NodeFilter.SHOW_TEXT, function(n) {
+    return (n.data === 'ignore') ?
+      window.NodeFilter.FILTER_REJECT : window.NodeFilter.FILTER_ACCEPT;
+  });
   tw.root.should.equal(root);
   tw.currentNode.should.equal(root);
   tw.whatToShow.should.equal(0x4);
@@ -204,6 +207,34 @@
     actual.push(tw.currentNode);
   }
 
+  actual.length.should.equal(4);
+  actual.should.eql([
+    root.firstChild.firstChild,
+    root.firstChild.lastChild.firstChild,
+    root.lastChild.firstChild,
+    root.lastChild.lastChild.firstChild
+  ]);
+}
+
+exports.nodeIterator = function() {
+  var window = domino.createWindow(html);
+  var d = window.document;
+  var root = d.getElementById('tw');
+  var ni = d.createNodeIterator(root, window.NodeFilter.SHOW_TEXT, function(n) 
{
+    return (n.data === 'ignore') ?
+      window.NodeFilter.FILTER_REJECT : window.NodeFilter.FILTER_ACCEPT;
+  });
+  ni.root.should.equal(root);
+  ni.referenceNode.should.equal(root);
+  ni.whatToShow.should.equal(0x4);
+  ni.filter.constructor.should.equal(window.NodeFilter.constructor);
+
+  var actual = [], n;
+  for (var n = ni.nextNode(); n ; n = ni.nextNode()) {
+       actual.push(n);
+  }
+
+  actual.length.should.equal(4);
   actual.should.eql([
     root.firstChild.firstChild,
     root.firstChild.lastChild.firstChild,
@@ -310,7 +341,7 @@
   var html = '<div\rid=a data-test=1\rfoo="\r"\rbar=\'\r\'\rbat=\r>\r</div\r>';
   var doc = domino.createDocument(html);
   var div = doc.querySelector('#a');
-  (div != null).should.be.true;
+  (div != null).should.be.true();
   // all \r should be converted to \n
   div.outerHTML.should.equal('<div id="a" data-test="1" foo="\n" bar="\n" 
bat="">\n</div>');
 };
@@ -319,7 +350,7 @@
   var html = "<div id=a ==x><a=B></A=b></div>";
   var doc = domino.createDocument(html);
   var div = doc.querySelector('#a');
-  (div != null).should.be.true;
+  (div != null).should.be.true();
   div.attributes.length.should.equal(2);
   div.attributes.item(1).name.should.equal('=');
   div.children.length.should.equal(1);
@@ -340,7 +371,7 @@
   var html = "<div id=a b=\"x &quot;y\" c='a \rb'><\np></div>";
   var doc = domino.createDocument(html);
   var div = doc.querySelector('#a');
-  (div != null).should.be.true;
+  (div != null).should.be.true();
   div.attributes.length.should.equal(3);
   div.attributes.item(1).value.should.equal('x "y');
   div.attributes.item(2).value.should.equal('a \nb');
@@ -351,7 +382,7 @@
   var html = "<a 
href='http://user:[email protected]:1234/foo/bar?bat#baz'>!</a>";
   var doc = domino.createDocument(html);
   var a = doc.querySelector('a');
-  (a != null).should.be.true;
+  (a != null).should.be.true();
   a.href.should.equal('http://user:[email protected]:1234/foo/bar?bat#baz');
   a.protocol.should.equal('http:');
   a.host.should.equal('example.com:1234');
diff --git a/node_modules/domino/test/fixture/doc.html 
b/node_modules/domino/test/fixture/doc.html
index 1174528..bd9153c 100644
--- a/node_modules/domino/test/fixture/doc.html
+++ b/node_modules/domino/test/fixture/doc.html
@@ -8,6 +8,6 @@
   <p class="foo">
     Cras mattis <tt class="foo">consectetur</tt> purus sit amet fermentum. 
Donec ullamcorper nulla non metus auctor fringilla. Etiam porta sem malesuada 
magna mollis euismod. Duis mollis, est non commodo luctus, nisi erat porttitor 
<tt class="foo bar baz">ligula</tt>, eget lacinia odio sem nec elit. Donec 
ullamcorper nulla non metus auctor fringilla. Donec ullamcorper nulla non metus 
auctor fringilla.
   </p>
-  <div id="tw"><div id="hello">Hello <em id="world" title="World: The 
Title">World</em></div><div id="foo" title="Foo: The Title">Foo, <strong 
id="bar">bar</strong></div></div>
+  <div id="tw"><div id="hello">Hello <em id="world" title="World: The 
Title">World</em></div>ignore<div id="foo" title="Foo: The Title">Foo, <strong 
id="bar">bar</strong></div></div>
 </body>
 </html>

-- 
To view, visit https://gerrit.wikimedia.org/r/227937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1de26734b00712237adebf55e16c50d1ccea5ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid/deploy
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to