`Selection.modify()` from collapsed white-space only text node after `Selection.selectAllChildren(document.querySelector("[contenteditable]"))` causes putting caret into following non-editable text
Categories
(Core :: DOM: Selection, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox133 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
()
Details
Attachments
(1 file)
STR
- Load https://jsfiddle.net/d_toybox/70jse21k/1/
- See the console
ER
The console shows: "focusNode=#text: \" ;\", anchorNode=#text: \" ;\"". I.e., Selection should be collapsed in the text node after the non-editable <span>.
AR
The console shows: "focusNode=#text: \"not editable\", anchorNode=#text: \"not editable\"", e.g., Selection is collapsed in the text node in the non-editable <span>.
If there is no getSelection().selectAllChildren(editingHost) call, it works. So, it seems that the call causes resetting the ancestor limiter.
| Assignee | ||
Comment 1•1 year ago
|
||
Okay, it seems that selectAllChildren() causes setting caret hint to "after" and that changed the behavior.
| Assignee | ||
Comment 2•1 year ago
|
||
When PeekOffsetForCharacter find a non-editable content, it should never
return the frame because user must want to move caret only in editable content
when the previous position is editable. Additionally, when a non-selectable
frame is skipped, caret will be moved enough, so it should not skip any editable
content. Finally, the found frame may cause a line break. Therefore, this
patch overwrites the result of SelectablePeekReport::PeekOffsetForCharacter
from FOUND to CONTINUE_UNSELECTABLE when non-editable content is found.
The remaining failures of the new WPT should be handled in bug 449685 because
they are caused by no frame for invisible preceding/trailing white spaces around
the block element boundary.
Depends on D223909
Comment 5•1 year ago
|
||
| bugherder | ||
Description
•