gecko-dev/editor
Masayuki Nakano e940a313f8 Bug 1315065 When selection is collapsed in an empty text node, Backspace/Delete key press should modify the nearest text node r=smaug
Currently, when selection is collapsed at an empty text node, the behavior of each major browser is different.

When you remove the last character of non-empty text node followed by empty text nodes, Chromium removes all following empty text nodes.  However, Edge never removes empty text nodes even when selection is collapsed at an empty text node.

With this patch, our behavior becomes same as Edge.  I think that we should take this for keeping backward compatibility since Gecko never removes empty text nodes.  So, in other words, this patch makes Backspace key press at an empty text node modify the preceding non-empty text node.

When you remove the first character of non-empty text node preceded with empty text nodes, Edge removes all preceding empty text nodes.  However, Chromium and Gecko keeps previous empty text nodes than caret position.  So, we should keep current behavior for backward compatibility.  In other words, this patch makes Delete key press at an empty text node modify the following non-empty text node and keep current behavior.


The fixing approach of this is, making WSRunObject::PriorVisibleNode() and WSRunObject::NextVisibleNode() ignore empty text node.  This should make sense because empty text node is not a visible node. (On the other hand, when the DOMPoint has a null character, it should treat as visible character.  That is visible with Unicode codepoint.)

MozReview-Commit-ID: 11YtqBktEvK

--HG--
extra : rebase_source : 70fa858866cc768179c1ca6a869e1a5c7cfe6e1a
2016-11-11 12:24:21 +09:00
..
composer Bug 1316432 - Fix nsCOMPtr constructions&assignments from 0 - r=froydnj 2016-11-10 14:11:27 +11:00
libeditor Bug 1315065 When selection is collapsed in an empty text node, Backspace/Delete key press should modify the nearest text node r=smaug 2016-11-11 12:24:21 +09:00
reftests Bug 1312951 - Add fuzzy annotation for editor/reftests/824080-3.html r=mstange 2016-11-07 17:18:08 -08:00
txmgr Bug 1316206 - Fix RefPtr assignments from 0 - r=froydnj 2016-11-08 14:34:06 +11:00
txtsvc Bug 1311606 Rename |result| of nsresult variants to |rv| in editor r=smaug 2016-10-25 00:43:49 +09:00
AsyncSpellCheckTestHelper.jsm
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
nsEditorCID.h
nsIContentFilter.idl
nsIDocumentStateListener.idl
nsIEditActionListener.idl
nsIEditor.idl
nsIEditorIMESupport.idl
nsIEditorMailSupport.idl Bug 1272893 - Remove nsISupportsArray from GetEmbeddedObjects() in editor. r=masayuki 2016-09-15 04:33:00 +02:00
nsIEditorObserver.idl
nsIEditorSpellCheck.idl Bug 1205983 - Remove all observer code from nsEditor. r=ehsan 2015-09-28 23:53:00 +02:00
nsIEditorStyleSheets.idl Bug 1244074 - Part 4: Use StyleSheetHandle instead of concrete style sheet class in most places. r=dholbert 2016-02-24 18:01:12 +11:00
nsIEditorUtils.idl Bug 1259517 - Make dropping images in editors work in e10s. r=baku 2016-06-21 15:17:37 -07:00
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1273001 - convert HTMLEditor::getLinkedObjects() to nsIArray. r=masayuki 2016-09-20 12:47:00 +02:00
nsIHTMLInlineTableEditor.idl
nsIHTMLObjectResizeListener.idl
nsIHTMLObjectResizer.idl
nsIPlaintextEditor.idl
nsITableEditor.idl
nsIURIRefObject.idl
nsPIEditorTransaction.idl