Public bug reported: I’m working on adding unit tests for a new WebView::editingCapabilities API, and I stumbled across this issue:
- if I select all the text in a contenteditable with e.g. webView.executeEditingCommand(WebView.EditingCommandSelectAll), the RWHV’s selection range is correctly updated - if I cut that text with e.g. webView.executeEditingCommand(WebView.EditingCommandCut), the range is again correctly updated (it becomes empty) - if I undo the last command with e.g. webView.executeEditingCommand(WebView.EditingCommandUndo), the selection is visually restored, but the RWHV’s selection range is *not* updated, it remains empty I’m not really sure where the issue lies yet. I dug into chromium’s code, and saw that in RenderFrameImpl::didChangeSelection(), if handling_select_range_ is false the method may return early, thus not calling SyncSelectionIfRequired(). I also saw that RenderFrameImpl::OnUndo() and RenderFrameImpl::OnRedo() do not temporarily set handling_select_range_ to true, unlike RenderFrameImpl::OnCut() and other editing command handlers. I wonder whether this is intentional, or a bug in chromium. ** Affects: oxide Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu WebApps bug tracking, which is subscribed to Oxide. https://bugs.launchpad.net/bugs/1524288 Title: selection range incorrect after undoing a cut operation in a contenteditable Status in Oxide: New Bug description: I’m working on adding unit tests for a new WebView::editingCapabilities API, and I stumbled across this issue: - if I select all the text in a contenteditable with e.g. webView.executeEditingCommand(WebView.EditingCommandSelectAll), the RWHV’s selection range is correctly updated - if I cut that text with e.g. webView.executeEditingCommand(WebView.EditingCommandCut), the range is again correctly updated (it becomes empty) - if I undo the last command with e.g. webView.executeEditingCommand(WebView.EditingCommandUndo), the selection is visually restored, but the RWHV’s selection range is *not* updated, it remains empty I’m not really sure where the issue lies yet. I dug into chromium’s code, and saw that in RenderFrameImpl::didChangeSelection(), if handling_select_range_ is false the method may return early, thus not calling SyncSelectionIfRequired(). I also saw that RenderFrameImpl::OnUndo() and RenderFrameImpl::OnRedo() do not temporarily set handling_select_range_ to true, unlike RenderFrameImpl::OnCut() and other editing command handlers. I wonder whether this is intentional, or a bug in chromium. To manage notifications about this bug go to: https://bugs.launchpad.net/oxide/+bug/1524288/+subscriptions -- Mailing list: https://launchpad.net/~ubuntu-webapps-bugs Post to : ubuntu-webapps-bugs@lists.launchpad.net Unsubscribe : https://launchpad.net/~ubuntu-webapps-bugs More help : https://help.launchpad.net/ListHelp