Although GetGoodSelPointForNode only supports ePrevious or eNext as action, we use other action. So we should add aseetion for it.
MozReview-Commit-ID: 3gLFFTAdNxU
--HG--
extra : rebase_source : b22cd532b6072e19fe1bff7f90a0e4a4ae4236e1
extra : histedit_source : 117509f1b76a382e8b23c5fa3345b81460385e56
When using CompositionTransaction, text node will be inserted into IMETextNode, not aTextNode of parameter. So we should use it for listener.
MozReview-Commit-ID: 72a3ZjF1wsz
--HG--
extra : rebase_source : 325909c0d141c238ab41e33d7f3959f4db27339e
extra : histedit_source : 52d6fc9d2668e4e41783e524276d7041eec0301c
Although PlaceholderTransaction will use the selection on Merge, it is too late to use UpdateRange. Because RangeUpdater will be used after DoTransaction is finished. So we should update selection on DoTransaction.
Also, part 1 fix doesn't update selection correctly via RangeUpdater when IME composition is multiple node.
MozReview-Commit-ID: 9so9tR8uQ6t
--HG--
extra : rebase_source : 02a8bebe6c89ceb023bd598b77b40c5817cd4007
extra : histedit_source : d114420552779d3352637c5554bf9e90e6e9cd40
Since the selection into PlaceholderTransaction isn't updated via RangeUpdater, UndoTransaction may return error when selection/caret position is changed. Then, redo is failed.
So we should add selection into PlaceholderTrancation to RangeUpdater.
MozReview-Commit-ID: LcUIiUExNhx
--HG--
extra : rebase_source : 9e1a71a7f497181171209ac05edcbddae227ab93
extra : histedit_source : 200dfd7957bf1b4dc92af72bb8b864cb457d62ab
We need skip this test on Android. Although mochitest doesn't use native IME data, Android's GeckoEditable.java wants to access native IME composition. See bug 1315898.
MozReview-Commit-ID: BNCKmDEmwKw
--HG--
extra : rebase_source : e7be1cb9e5c7c0fb4283f81541fc7441f52a1101
Google Keep uses range.insertNode on input event. So, text node will be inserted into current caret position.
Microsoft IME's caret is after composition string, but ATOK's caret is before it. So when using ATOK, this issue occurs. By range.insertNode, text nodes that have IME attribute becomes multiple text nodes. But CompositionTransanction doesn't consider that IME range isn't single text node. Although it replaces current composition string with new string on first text node, it doesn't delete composition string on other text node.
MozReview-Commit-ID: 9uRx0A9mppx
--HG--
extra : rebase_source : fe0754cee2197822ca6ac9ebed13013a8f13b606
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
Giving '0' (literal zero) to nsCOMPtr is now ambiguous, as both
nsCOMPtr(decltype(nullptr)) and nsCOMPtr(T*) could be used.
In any case, our coding standards mandate the use of 'nullptr' for pointers.
So I'm changing all zeroes into nullptr's where necessary.
MozReview-Commit-ID: LXiZTu87Ck6
--HG--
extra : rebase_source : f9dcc6b06e9ebf9c30a576f9319f76a51b6dc26f
Giving '0' (literal zero) to RefPtr is now ambiguous, as both
RefPtr(decltype(nullptr)) and RefPtr(T*) could be used.
In any case, our coding standards mandate the use of 'nullptr' for pointers.
So I'm changing all zeroes into nullptr's where necessary.
MozReview-Commit-ID: A458A4e9for
--HG--
extra : rebase_source : bc4107ce1767329e3dddfe34c55ba79202192e06
Even when editor receives eCompositionStart event, the active composition may have gone since web contents can listen to composition events before editor (so, web contents can commit the composition before "compositionstart" reaching focused editor).
Therefore, editor shouldn't crash as unexpected scenario. Instead, it should do nothing in such case.
Note that when editor receives 2nd or later "compositionupdate" or "text" event, it should not modify composition. However, currently, it does that. This patch does NOT fix it since it's really rare case. It should be fixed in another bug because this should be uplifted (crashing with some IMEs on Android is serious).
MozReview-Commit-ID: HIbMy4eFRMw
--HG--
extra : rebase_source : a98661ab2c1c8ee67ef551af3d1770b61cd25c84
The main targets of this refactor are:
1. Move most of the logic of distinguishing properties and custom
properties from nsDOMCSSDeclaration into css::Declaration, which
gives ServoDeclarationBlock more flexibility to implement.
2. Rename those methods of css::Declaration to provide a clear interface
which makes sense for implementing in ServoDeclarationBlock, and also
avoid method overload, which can impede the forward macro, on them.
MozReview-Commit-ID: 2cCqF855TVK
--HG--
extra : source : 3837e1e558caac4f2901e838371e97c17821530e
The change from ok() to is() in tests is so that the failure message is
more informative -- it now tells you the returned exception.
This commit omits test_contenteditable_text_input_handling.html because of test
failures that I haven't figured out.
MozReview-Commit-ID: 37cYlQlJZm7
I added an extra check to ensure that the test wasn't passing because
doCommand() was throwing some unrelated exception, in case porting from
chrome to plain changed behavior of doCommand().
MozReview-Commit-ID: LOo8yN8jkZo
Possible issue: the previous version saved document.popupNode and
restored it after copying the image, and the new version does not
(because I don't know how). The test seems to pass anyway.
MozReview-Commit-ID: 7g0JCYxI7x8
--HG--
rename : editor/libeditor/tests/test_bug1140617.xul => editor/libeditor/tests/test_bug1140617.html
Possible issue: the previous version saved document.popupNode and
restored it after copying the image, and the new version does not
(because I don't know how). The test seems to pass anyway.
It seems I had to use doCommand instead of execCommand to carry out the
paste, presumably because of permissions differences between plain and
chrome mochitests.
MozReview-Commit-ID: CdPUCmEtgwO
--HG--
rename : editor/libeditor/tests/test_bug490879.xul => editor/libeditor/tests/test_bug490879.html
Filed bug 1299574 for the Android todo. (Chrome tests in this directory
are disabled for Android, so all this porting enables them.)
MozReview-Commit-ID: 6FAioabxq0a
--HG--
rename : editor/libeditor/tests/test_selection_move_commands.xul => editor/libeditor/tests/test_selection_move_commands.html