For each DOM child C of N, perform the candidate examination algorithm for C in S, and terminate if it selects an anchor node.
This step, at some depth of traversal, will reach absolutely positioned elements, unless overflow-anchor on an intermediate element is used to block that traversal.
Then it says:
For each absolutely-positioned element A whose containing block is N, but whose DOM parent is not N, perform the candidate examination algorithm for A in S, and terminate if it selects an anchor node.
This will find the same absolutely positioned elements already visited in (1). So the only case where it seems like it could return something is if there's an overflow-anchor: none somewhere on the DOM path between the containing block and the absolutely positioned element.
This seems like it's probably unintentional, and perhaps that absolutely positioned elements were intended to be excluded from the regular DOM traversal -- maybe in all cases, or maybe only if the containing block is different from the parent. (The results would be different, so it seems less weird to exclude them in all cases!)
It's also not clear to me why absolute positioning gets a different treatment from floating (where overflow-anchor: none on an intermediate inline, based on the spec, does apparently have an effect, although I didn't test in Chrome).
The candidate examination algorithm visits absolutely positioned elements twice. First it does:
This step, at some depth of traversal, will reach absolutely positioned elements, unless
overflow-anchor
on an intermediate element is used to block that traversal.Then it says:
This will find the same absolutely positioned elements already visited in (1). So the only case where it seems like it could return something is if there's an
overflow-anchor: none
somewhere on the DOM path between the containing block and the absolutely positioned element.This seems like it's probably unintentional, and perhaps that absolutely positioned elements were intended to be excluded from the regular DOM traversal -- maybe in all cases, or maybe only if the containing block is different from the parent. (The results would be different, so it seems less weird to exclude them in all cases!)
It's also not clear to me why absolute positioning gets a different treatment from floating (where
overflow-anchor: none
on an intermediate inline, based on the spec, does apparently have an effect, although I didn't test in Chrome)./cc @eqrion who is implementing this in Gecko.