Iterator should not skip block boundaries.
We must shrink range when at outer boundaries or not a path block boundary.
Code refactoring: Extracted repeating code to function.
Changelog entry.
Merge branch 't/12178'