-
- Downloads
Bug 1815969 - part 5: Make editors handle pasting something in new focused...
Bug 1815969 - part 5: Make editors handle pasting something in new focused editor if a `paste` event listener moves focus r=m_kato If a `paste` event listener moves focus, Chrome makes new editor keep handling the pasting. For the compatibility, we should follow it unless the new focused element is in different document because user should allow to paste it explicitly. On the other hand, this just stops handling "cut" in same situation because handling it requires to update clipboard without user's activation. Therefore, the clipboard content and/or the new editor content may be lost from the users point of view. Note that `nsContentUtils::GetActiveEditor` may return `HTMLEditor` instance when focused element does not have `TextEditor` even when non-editable element has focus. Therefore, if it returns an `HTMLEditor`, we need to check whether it's active in the DOM window with a call of `HTMEditor::IsActiveInDOMWindow`. Differential Revision: https://phabricator.services.mozilla.com/D176741
Showing
- editor/libeditor/EditorBase.cpp 128 additions, 5 deletionseditor/libeditor/EditorBase.cpp
- editor/libeditor/EditorBase.h 4 additions, 1 deletioneditor/libeditor/EditorBase.h
- editor/libeditor/EditorCommands.cpp 5 additions, 4 deletionseditor/libeditor/EditorCommands.cpp
- editor/libeditor/HTMLEditor.h 5 additions, 2 deletionseditor/libeditor/HTMLEditor.h
- editor/libeditor/HTMLEditorCommands.cpp 6 additions, 4 deletionseditor/libeditor/HTMLEditorCommands.cpp
- editor/libeditor/HTMLEditorDataTransfer.cpp 49 additions, 6 deletionseditor/libeditor/HTMLEditorDataTransfer.cpp
- editor/libeditor/tests/mochitest.ini 1 addition, 0 deletionseditor/libeditor/tests/mochitest.ini
- editor/libeditor/tests/test_paste_redirect_focus_in_paste_event_listener.html 143 additions, 0 deletions...ts/test_paste_redirect_focus_in_paste_event_listener.html
- testing/specialpowers/content/SpecialPowersChild.sys.mjs 8 additions, 2 deletionstesting/specialpowers/content/SpecialPowersChild.sys.mjs
Loading
Please register or sign in to comment