Created attachment 8584346
Unified patch (code + test changes + twice revised new test)
Thank you very much for the review and all the additional explanation.
I hope I could address your questions in additional comments in the test.
Sadly switching from "mousedown/up" to "click" as you had suggested makes the test fail with:
failed | uncaught exception - NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowUtils.sendMouseEvent] at chrome://specialpowers/content/specialpowersAPI.js:161
This is actually the only test I intended to submit ;-)
This is for the case where the user clicks beyond the end of the line.
There are two tests already which I had to adapt to the new selection behaviour which test the moving to the end
(editor/libeditor/tests/test_selection_move_commands.xul)
and moving from the subsequent line using left arrow
(layout/generic/test/test_movement_by_characters.html).
If you wanted to be really purist a test with a "div contenteditable" could be added where an empty line is first filled with some text, which is then removed so the range becomes empty. The code caters for this case.
Created attachment 8584346
Unified patch (code + test changes + twice revised new test)
Thank you very much for the review and all the additional explanation.
I hope I could address your questions in additional comments in the test.
Sadly switching from "mousedown/up" to "click" as you had suggested makes the test fail with: ils.sendMouseEv ent] at chrome: //specialpowers /content/ specialpowersAP I.js:161
failed | uncaught exception - NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowUt
This is actually the only test I intended to submit ;-)
This is for the case where the user clicks beyond the end of the line. libeditor/ tests/test_ selection_ move_commands. xul) generic/ test/test_ movement_ by_characters. html).
There are two tests already which I had to adapt to the new selection behaviour which test the moving to the end
(editor/
and moving from the subsequent line using left arrow
(layout/
If you wanted to be really purist a test with a "div contenteditable" could be added where an empty line is first filled with some text, which is then removed so the range becomes empty. The code caters for this case.