TreeWalker test

by Julien Etienne

HTML

<div id='walker'>
<div class="head">
  <p><a href="https://www.w3.org/"><img height="48" width="72" alt="W3C" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C"/></a></p>
  <h1 id="pagetitle">Scalable Vector Graphics (SVG) 2</h1>
  <h2 id="pagesubtitle">W3C Candidate Recommendation <em>15 September 2016</em></h2>
  <dl>
    <dt>This version:</dt>
    <dd><a href="https://www.w3.org/TR/2016/CR-SVG2-20160915/" class="url">https://www.w3.org/TR/2016/CR-SVG2-20160915/</a></dd>
    <dt>Latest version:</dt>
    <dd><a href="https://www.w3.org/TR/SVG2/" class="url">https://www.w3.org/TR/SVG2/</a></dd>
    <dt>Latest editor's draft:</dt><dd><a href="https://svgwg.org/svg2-draft/" class="url">https://svgwg.org/svg2-draft/</a></dd>
    <dt>Previous version:</dt>
    <dd><a href="https://www.w3.org/TR/2015/WD-SVG2-20150915/" class="url">https://www.w3.org/TR/2015/WD-SVG2-20150915/</a></dd>
    <dt>Single page version:</dt>
    <dd><a href="single-page.html" class="url">https://www.w3.org/TR/2016/CR-SVG2-20160915/single-page.html</a></dd>
    <dt>GitHub repository:</dt>
    <dd><a href="https://github.com/w3c/svgwg/">https://github.com/w3c/svgwg/</a></dd>
    <dt>Public comments:</dt>
    <dd><a href="mailto:[email protected]" class="url">[email protected]</a> (<a href="http://lists.w3.org/Archives/Public/www-svg/">archive</a>)</dd>

    <dt>Test suite:</dt>
    <dd><a href="https://github.com/w3c/web-platform-tests/tree/master/svg">https://github.com/w3c/web-platform-tests/tree/master/svg</a></dd>

    <dt class="top-editors">Editors:</dt>
    <dd>Nikos Andronikos, Canon, Inc. &lt;<a href="mailto:[email protected]" class="url">[email protected]</a>></dd>
    <dd>Rossen Atanassov, Microsoft Co. &lt;<a href="mailto:[email protected]" class="url">[email protected]</a>></dd>
    <dd>Tavmjong Bah, Invited Expert &lt;<a href="mailto:[email protected]" class="url">[email protected]</a>></dd>
    <dd>Amelia Bellamy-Royds, Invited Expert &lt;<a...

JavaScript

var treeWalker = document.createTreeWalker(
  document.getElementById('walker'));

var nodeList = [];

while (treeWalker.nextNode()) nodeList.push(treeWalker.currentNode);

console.log(nodeList)