Improve correctness of NodeIterator and Treewalker

In their current implementation, both the NodeIterator and TreeWalker would
skip over ignored nodes. However, while the node itself should have been ignored
its children should still be iterated.

For example, when going over:

```
<div id="container">
  <!-- comment1 -->
  <span>
    <!-- comment2 -->
  </span>
</div>
```

With `SHOW_COMMENT`, the previous version would completely skip over `container`
and its children. Now the code still won't emit the `container` div itself,
it will still iterate through its children (and thus emit the two comments).

This change relates to ongoing react compatibility.
This commit is contained in:
Karl Seguin
2025-10-15 09:23:54 +08:00
parent d87d782fd5
commit 3657a49a2c
5 changed files with 290 additions and 13 deletions