demo · v132
The four cross-tree selection cases
A selection that spans a shadow boundary is the canonical bug. Pick a case, see the sample, and watch all three readings: selection.isCollapsed (fixed in v132), anchor === focus (the spec definition), and the pre-v132 buggy answer.
Before shadow1 after, with regular light text and then shadow2 trailing.
selection.isCollapsed (Chrome 132+)
—
anchor === focus (spec)
—
pre-v132 buggy answer
—
click a case — the answer changes