You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking at #87 I noticed that updateSelection() as currently specified doesn't prevent the author from specifying a selection that's outside the bounds of the text.
This is not what I would have expected; it seems like a potential source of errors to allow selection to be set outside of the text. It's not exactly clear how the browser should handle adjusting selection in these scenarios.
We should consider enforcing that updateSelection() not allow the author to set a selection begin or end larger than the size of EditContext.text.
If we add this restriction, we'd also want to have updateText() adjust the selection offsets if the update would put them outside of the new shortened text.
The current Chromium implementation clamps the selection set in updateSelection() to the length of the text, but does not throw an error.
The text was updated successfully, but these errors were encountered:
johanneswilm
added
Agenda+
Queue this item for discussion at the next WG meeting
and removed
Agenda+
Queue this item for discussion at the next WG meeting
labels
Feb 8, 2024
While looking at #87 I noticed that
updateSelection()
as currently specified doesn't prevent the author from specifying a selection that's outside the bounds of the text.This is not what I would have expected; it seems like a potential source of errors to allow selection to be set outside of the text. It's not exactly clear how the browser should handle adjusting selection in these scenarios.
We should consider enforcing that
updateSelection()
not allow the author to set a selection begin or end larger than the size ofEditContext.text
.If we add this restriction, we'd also want to have updateText() adjust the selection offsets if the update would put them outside of the new shortened text.
The current Chromium implementation clamps the selection set in
updateSelection()
to the length of the text, but does not throw an error.The text was updated successfully, but these errors were encountered: