Closed Bug 1860210 Opened 8 months ago Closed 7 months ago

`beforeinput.getTargetRanges()` may return outside of focused and nested editing host if it follows white-spaces

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

()

Details

Attachments

(1 file)

<div contenteditable><div id=a contenteditable="false">
  <div id=b contenteditable><p>[]<br></p></div>
</div></div>

Type Backspace after focusing the inner editing host. Then, getTargetRanges() will return <div id=a>,1 - <p>,1.

They check ancestor limiter when they are climbing up the DOM tree if and only
if the ancestor does not have a sibling. However, this causes moving into
a sibling of the ancestor limiter.

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/08912004c595
Make `HTMLEditUtils::GetPreviousEditablePoint` and `HTMLEditUtils::GetNextEditablePoint` check ancestor limiter before getting a sibling of ancestor r=m_kato
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43071 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: