The more I think about this, the harder it gets.
Hit test info items are added to the BorderBackground() list, but once we've traversed through a block , the current BorderBackground() list will actually be the Content() or BlockBorderBackgrounds() list on the nearest stacking context.
Positioned descendants with z-index < 0 will be behind content and block border backgrounds , so a normal element might need a new hit-test info (and can't use the one generated by the parent) if there is negative z-index content behind it.
It seems like the only correct solution would be to track what the topmost hit test info within a given display list (probably by adding more information to nsDisplayListCollection/Set), and adding a new hit-test info if the current frame's size/hit-test flags don't match the previous hit-test data for that last.
When nsBlockFrame creates a new collection, and connects the BorderBackground list to the stacking context's BlockBorderBackgrounds list, we'd also want to connect the previous hit-test data in the same way.
Creating a new (pseudo-)stacking context could inherit the current top-most hit-test info for the outer positioned descendants list (where the stacking context is going to go after flattening) and use that to initialize the BorderBackground (the backmost-list in the flattend SC) previous hit test info.
PositionedDescendants is going to be sorted, so the previous data would probably have to be for the z-index:0 subset (or track previous for each unique value of z-index).
I think that works, but it's still going to create a lot more hit test info items that we'd like, since we'll be adding lots for the possibility that a different list will put something behind us.
CC'ing some more people who've looked at this code before, anyone got any better ideas?