setUnfilteredPosition was incorrectly leaving the walker's currentNode
inside a rejected parent if the target node was a TEXT_NODE. Adjusted
branching logic to ensure the walker always moves to a valid position
if the specified position is not accepted by the current filters.
Fixes#797
* remove @license tag, for consistency with library source files
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released stuff
* separate license header by empty line from following content
runtime.loadClass(...) no longer expects that eval(fileContent) yields
the constructor, and a few loaded files rely on that (e.g. all singletons/namespaces),
so let's be consistent
unfilteredDomOffset is extremely slow under certain conditions, greatly
limiting the iteration speed. This patch eliminates all calls that would
trigger this slow call, improving iteration performance.
An additional advantage of this is that the adjusted logic now avoids
the somewhat messy logic that involved diving into the the container
and offset just in case the container's child was a paragraph as
well. By using isBeforeNode, the bookmark creator now knows that
the current node is fetched by getCurrentNode.
The names of the test functions are now passed separately from the function in
a structure. The reason for this is that Closure Compiler does not allow adding
additional fields to functions.
Calling setUnfilteredPosition with a result previously obtained from the
iterator should effectively resume iteration at exactly this position.
As added tests demonstrated, specifying a node with no children and an
offset of 0 was incorrectly causing currentPos to be restored to the value
of 0. This meant calls to iterator.container() would return the a different
value.
PositionIterator.setUnfilteredPosition API doc report that when given
a forbidden position, the iterator jumps to the next visible position.
Add code to cover a missed corner case if the container was a child of
a forbidden parent (or grand parent) node.
PositionIterator exposes a myriad of confusing offsets. These are being
slowly retired where possible in an effort to reduce possible mis-use
and confusion.
This makes the result of next & previous always a node that will pass
the filter. Previous implementations could return entirely unexpected
nodes
* Corrected module load order for tests