gecko-dev/editor
Masayuki Nakano 37ef2fd403 Bug 1882818 - Make HTMLEditor paste ancestors under the closest common ancestor in the range r=m_kato
When copying paragraphs in Gecko, some private type data is copied into the
clipboard and our editor refers the private data at pasting such data.  In
this case, `text/_moz_htmlinfo` has 2 integers to specify the range at the
copy.  If selection range ends at end of text followed by an invisible `<br>`
and a block boundary, this is set to the depth of the text node.  Then,
`HTMLWithContextInserter::CollectTopMostChildContentsCompletelyInRange` collects
top most children of the last paragraph in `HTMLWithContextInserter::Run` [1].
Therefore, the last `<div>` in the clipboard is unwrapped at pasting in the
test case.  This patch makes
`FragmentFromPasteCreator::MoveStartAndEndAccordingToHTMLInfo` re-climb up the
tree under the common ancestor of found start/last nodes.

1. https://searchfox.org/mozilla-central/rev/6b1e306175c2284958fb185bab388021e2890ed0/editor/libeditor/HTMLEditorDataTransfer.cpp#646-651

Differential Revision: https://phabricator.services.mozilla.com/D203574
2024-03-07 09:37:50 +00:00
..
composer Bug 1864896: Autofix unused function arguments (editor). r=masayuki 2024-03-01 18:28:33 +00:00
docs Bug 1842986 - Remove dom.forms.inputmode pref r=emilio 2023-09-15 16:49:21 +00:00
libeditor Bug 1882818 - Make HTMLEditor paste ancestors under the closest common ancestor in the range r=m_kato 2024-03-07 09:37:50 +00:00
reftests Bug 1879538 - cleanup unnecessary and redundant reftest conditions. r=aryx,jgilbert 2024-02-22 23:04:45 +00:00
spellchecker Bug 1864896: Autofix unused function arguments (editor). r=masayuki 2024-03-01 18:28:33 +00:00
txmgr Bug 1856795 - Remove redundant member init r=emilio 2023-10-15 15:29:02 +00:00
AsyncSpellCheckTestHelper.sys.mjs Bug 1864896: Autofix unused function arguments (editor). r=masayuki 2024-03-01 18:28:33 +00:00
moz.build Bug 1820593 - Convert AsyncSpellCheckTestHelper to an ES module. r=masayuki 2023-03-07 09:40:39 +00:00
nsIDocumentStateListener.idl
nsIEditActionListener.idl Bug 1859245 - part 3: Make JoinNodesTransaction and SplitNodeTransaction handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
nsIEditor.idl Bug 1764895 - part 3: Get rid of nsIEditor.setShouldTxnSetSelection r=m_kato DONTBUILD 2023-12-14 00:41:20 +00:00
nsIEditorMailSupport.idl Bug 1839814 - Move nsIEditor.wrapWidth to nsIEditorMailSupport r=m_kato 2023-06-27 05:47:55 +00:00
nsIEditorSpellCheck.idl
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1851951 - Make HTMLEditor refer computed display instead of the HTML default style at considering block or inline element r=m_kato 2023-09-27 03:01:26 +00:00
nsIHTMLInlineTableEditor.idl Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
nsIHTMLObjectResizer.idl Bug 1802288 - remove trailing whitespaces in idl/webidl files r=credential-management-reviewers,webidl,smaug,sgalich 2022-12-28 09:52:44 +00:00
nsITableEditor.idl