Fix bug in attribute selector parsing (#20303)