fune/testing/web-platform/meta/selection
Masayuki Nakano 87da8e59cd Bug 1612076 - Make AdjustCaretFrameForLineEnd stop scanning text node if first node is editable but reached non-editable one r=emilio
When pressing `ArrowLeft` key at:
```
<p>abc</p><p><span contenteditable=false>def</span>{}<br></p>
```
, caret is moved into the non-editable text because
`nsCaret::GetCaretFrameForNodeOffset` looks for a preceding text node from
the `BRFrame`. This is required if the preceding text node ends with a
collapsible white-space but followed by a `<br>` because the text frame
should not contain the white-space rect and `BRFrame` frame should be next
to it, i.e., the white-space looks like a overflown content.

So, for rendering a caret, the method needs to return non-editable text frame
even in the case, but for considering new caret position in the DOM tree, it
should not return non-editable text frame.

Therefore, this patch adds a param to `nsCaret::GetCaretFrameForNodeOffset()`
which forcibly return editable content frame or not and makes
`Selection::GetPrimaryOrCaretFrameForNodeOffset` call it with the new option
because its callers are the handler of caret navigation.

Differential Revision: https://phabricator.services.mozilla.com/D196259
2023-12-19 01:58:07 +00:00
..
caret
contenteditable
textcontrols
addRange-00.html.ini
addRange-04.html.ini
addRange-08.html.ini
addRange-12.html.ini
addRange-16.html.ini
addRange-20.html.ini
addRange-24.html.ini
addRange-28.html.ini
addRange-32.html.ini
addRange-36.html.ini
addRange-40.html.ini
addRange-44.html.ini
addRange-48.html.ini
addRange-52.html.ini
addRange-56.html.ini
addRange.htm.ini
addRange.tentative.html.ini
collapse-00.html.ini
collapse-15.html.ini
collapse-30.html.ini
collapse-45.html.ini
collapse.htm.ini
collapseToStartEnd.html.ini
deleteFromDocument.html.ini
extend-00.html.ini
extend-20.html.ini
extend-exception.html.ini
getRangeAt.html.ini
getSelection.html.ini
idlharness.window.js.ini
isCollapsed.html.ini
modify-extend-word-trailing-inline-block.tentative.html.ini
modify-line-flex-column.tentative.html.ini
modify-line-flex-row.tentative.html.ini
modify-line-grid-basic.tentative.html.ini
modify.tentative.html.ini
removeAllRanges.html.ini
removeRange.html.ini
script-and-style-elements.html.ini
select-end-of-line-image.tentative.html.ini
selectAllChildren.html.ini
setBaseAndExtent.html.ini
stringifier.tentative.html.ini
toString-ff-bug-001.html.ini
type.html.ini
user-select-on-input-and-contenteditable.html.ini