This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In section 19.8.7.8 Streamability of Filter Expressions, a filter expression B[P] is considered in situations (1) when B is crawling, (2) when P is motionless and otherwise, the rules state that it is roaming and free-ranging. These rules seem to be incomplete. Consider $doc[child::foo]. $doc is a VarRef, which is grounded by default (except in functions). The expression should therefor be grounded and motionless. I think it would work if we change: "2. If P is motionless, then the posture and sweep of B;", such that we make sure that P is assessed with the context posture set to the posture of B, in which case $doc, which has grounded posture, would yield child::foo in the example above as motionless. Alternatively or in addition, we could simply add a rule: "If B is grounded, B[P] is grounded and motionless". In fact, it looks like we don't say at all what the context posture is in cases of filter expressions. And rule 5 of 19.8.7.7 Streamability of Axis Steps doesn't say it either for predicates in axis steps.
In your example, the predicate child::foo is motionless, because the context posture is grounded. So I think there is no bug.
I think the problem lies in the fact that it is unclear that P should be assessed with context posture of B. In (some?) other situations, we write stuff like (example from 19.8.7.5 Streamability of Simple Mapping Expressions): "The posture and sweep of the expression are the posture and sweep of the right-hand operand, assessed with a context posture and type set to the posture and type of the left-hand operand." I'm not sure if a change is needed, assuming this information is provided elsewhere, but it is not very clear that one need to analyze P this way (though intuitively one could say it is).
The WG agreed that the spec is correct but that some clarification would be helpful, for example a note under the streamability of filter expressions as to how the context posture for the predicate is determined, and the consequence that if the base expression is grounded then the whole expression is typically grounded.
A suitable clarification has been added to the section on streamability of filter expressions, as suggested.