Right now the offsets are assumed to be text offsets. The implementation could evaluate whether the container expression evaluates to a `Text` or `Element` and then treat the offset as appropriate.