Opened 5 years ago

Last modified 5 years ago

#12983 confirmed New Feature

Walker.guard is called more than once for every node boundary

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description (last modified by Piotrek Koszuliński)

Discovered when working on #12964.

See tests pushed in branch:t/12983.

It would be useful if we knew that guard will be called only once, because it makes some iterations easier (and guard is the only callback which is called for both element boundaries).

Change History (2)

comment:1 Changed 5 years ago by Piotrek Koszuliński

Status: newconfirmed
Type: BugTask

I made an attempt to change this behaviour, but it looks that walker wasn't designed with this constraint in mind. I tracked some issues in the code of the iterate() function which does not seem to care about how many times the guard function is called. Therefore, I had to abandon the idea of changing this behaviour.

PS. Not only walker would need to be changed, but also node.getNext/PreviousSourceNode which also accepts guard and is used by the walker. It also had some odd behaviours like calling guard on itself even though it was called with the startFromSibling param.

comment:2 Changed 5 years ago by Piotrek Koszuliński

Description: modified (diff)
Type: TaskNew Feature
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy