gecko-dev/editor
Masayuki Nakano a1b8ba8568 Bug 1556235 - Make `HTMLEditRules::WillDeleteSelection()` remove empty parent blocks when it's called by drop handler r=m_kato
Chromium removes new empty blocks only when the content is removed by dragging.
Before bug 1504910, we just removed the dragged range, i.e., kept the new
empty blocks.  However, now, we put `<br>` element from
`HTMLEditRules::AfterEditInner()` because a D&D action was split to the deletion
part and inserting part (It wasn't called after inserting the dropped content).

Therefore, this patch adds new path for D&D into
`HTMLEditRules::WillDeleteSelection()`.  If parent blocks become empty,
the path removes such blocks and collapse `Selection` to where the most
ancestor empty block was.  With this patch, we get same behavior as Chrome
in most cases.  You can check it in https://jsfiddle.net/d_toybox/9px07yLr/

Differential Revision: https://phabricator.services.mozilla.com/D34147

--HG--
extra : moz-landing-system : lando
2019-06-10 10:31:13 +00:00
..
composer Bug 1556656 - Restrict script access for some methods in nsIEditingSession r=masayuki 2019-06-06 05:31:16 +00:00
libeditor Bug 1556235 - Make `HTMLEditRules::WillDeleteSelection()` remove empty parent blocks when it's called by drop handler r=m_kato 2019-06-10 10:31:13 +00:00
reftests Bug 1521280 - Convert search-textbox to a custom element. r=dao,bgrins 2019-05-13 18:12:37 +00:00
spellchecker Bug 1529884 - part 6: Through subject principal at Document::ExecCommand() to constructor of EditorBase::AutoEditActionDataSetter r=smaug 2019-06-10 10:27:07 +00:00
txmgr Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan 2019-05-01 08:47:10 +00:00
AsyncSpellCheckTestHelper.jsm Bug 1489980 - Enable ESLint for editor/ - Manual fixes. r=masayuki 2018-09-13 07:59:47 +00:00
moz.build Bug 1491199 - Get rid of nsIEditorBlobListener. r=masayuki 2018-09-18 04:34:21 +00:00
nsIDocumentStateListener.idl Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
nsIEditActionListener.idl Bug 1545822 - Clean up some whitespace in XPIDL files. r=froydnj 2019-04-21 01:47:00 +00:00
nsIEditor.idl Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
nsIEditorMailSupport.idl Bug 1545822 - Clean up some whitespace in XPIDL files. r=froydnj 2019-04-21 01:47:00 +00:00
nsIEditorObserver.idl Bug 1432528 - part 4: Remove nsIEditorObserver::BeforeEditAction() and nsIEditorObserver::CancelEditAction() because nobody implements them r=m_kato 2018-01-24 14:31:29 +09:00
nsIEditorSpellCheck.idl Bug 1556922. Stop using [array] in nsIEditorSpellCheck. r=masayuki 2019-06-05 04:07:28 +00:00
nsIEditorStyleSheets.idl Bug 1545822 - Clean up some whitespace in XPIDL files. r=froydnj 2019-04-21 01:47:00 +00:00
nsIHTMLAbsPosEditor.idl Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
nsIHTMLEditor.idl Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
nsIHTMLInlineTableEditor.idl Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
nsIHTMLObjectResizer.idl Bug 1549925 - Mark all methods of nsIDocumentStateListener as can_run_script r=m_kato 2019-05-09 07:37:51 +00:00
nsIPlaintextEditor.idl Bug 1540062 - Get rid of nsIPlaintextEditor.setWrapColumn. r=masayuki 2019-03-29 09:44:36 +00:00
nsITableEditor.idl Bug 1533293 - part 3: Make editor and ContentEventHandler not use Selection::Extend() due to too slow r=m_kato 2019-03-26 10:09:47 +00:00
nsIURIRefObject.idl Bug 1545822 - Clean up some whitespace in XPIDL files. r=froydnj 2019-04-21 01:47:00 +00:00