When an <input> is present inside a shadow root, pressing the up/down arrows no longer moves the cursor to the start/end of the field. The following fiddle demonstrates a standard input with the correct behavior and an input within a shadow root with differing behavior. Fiddle: https://jsfiddle.net/me9yatxz/1/
Does anyone know if this is a recent change or a long-standing issue?
This also reproduces on Safari 13.1.2.
<rdar://problem/71042487>
Seems like this bug is in Safari, not WebKit.
Safari uses JavaScript to get metadata about the text field, and when it can’t because the field is in a shadow tree, its code misfires and blocks the up and down arrows. The misbehaving code is in Safari for handling autocompletion lists. The smaller fix is to make it just not screw up and confuse itself when the text field is in a shadow tree. The bigger fix would be to make autocompletion work with those fields too.
The test case works as expected in MiniBrowser, and likely in other WebKit-based browsers. There is a slim chance that some kind of change in WebKit could solve the problem, since it’s indirectly due to difficulty getting data about the text field from the Safari code.