Reinstate active flag for iterators
https://bugs.webkit.org/show_bug.cgi?id=175312
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
Resync WPT tests from upstream to gain test coverage.
* web-platform-tests/dom/traversal/NodeIterator-expected.txt:
* web-platform-tests/dom/traversal/NodeIterator.html:
* web-platform-tests/dom/traversal/TreeWalker-expected.txt:
* web-platform-tests/dom/traversal/TreeWalker.html:
Source/WebCore:
NodeIterator / TreeWalker should no longer allow recursive filters
after the following change to the DOM specification:
- https://github.com/whatwg/dom/pull/359
This patch aligns our behavior with the latest specification.
No new tests, updated existing tests.
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::nextNode):
(WebCore::NodeIterator::previousNode):
Note that we now also call m_candidateNode.clear() before returning an
exception. This was a pre-existing bug that we failed to do so in the
exception case but it became more obvious after this change now that
we throw. This was causing traversal/moz-bug559526.html to fail
otherwise (the filter was called one too many times). The test case
is passing in Firefox (The filter is called 4 times and they throw
each time).
* dom/Traversal.cpp:
(WebCore::NodeIteratorBase::NodeIteratorBase):
(WebCore::NodeIteratorBase::acceptNode):
* dom/Traversal.h:
* dom/TreeWalker.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220453
268f45cc-cd09-0410-ab3c-
d52691b4dbfc