gecko-dev/widget/tests
Masayuki Nakano a50a0700d4 Bug 1530649 - Improve composition string handling which ends with whitespaces r=m_kato
If insertion string ends with ASCII whitespace and there is no following
content in the block, `HTMLEditRules::AdjustWhitespaces()` needs to insert
`<br>` element.  It's called only by `HTMLEditRules::AfterEditInner()` and
that does only simple things with `WSRunObject`.  Therefore, this moves the
code into `AfterEditInner()`.

For making it adjust the whitespaces, `HTMLEditRules::WillInsertText()` needs
to notify `AfterEditInner()` of dirty range with `mDocChangeRange`.  Therefore,
this patch makes it set `mDocChangeRange` manually after inserting composition
string.

On the other hand, there is another bug.  `WSRunObject` was designed to treat
only inserting text for `WSRunObject::InsertText()`.  I.e., not designed to
treat replacing existing composition string with new string.  Therefore,
`WSRunObject::InsertText()` adjusts whitespaces only around start of
composition string.  Therefore, if composition string ends with an ASCII
whitespace, it's not replaced with NBSP and that causes:
- failing `WSRunObject::AdjustWhitespaces()` inserts `<br>` element at
  `AfterEditInner()` of committing composition.
- then, next composition's first `WSRunObject::InsertText()` removes the
  last whitespace due to not followed by `<br>` nor any other content.
Therefore, this patch makes `WSRunObject` takes 2 DOM points to be able to
treat replaced range.

In strictly speaking, the latter change require more changes and tests for
supporting replacement with any other methods.  However, it's risky and out
of scope of this bug.

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

--HG--
extra : moz-landing-system : lando
2019-04-09 05:28:38 +00:00
..
browser Bug 1415265 - Remove now unnecessary .eslintrc.js files or entries. r=mossop 2019-03-28 09:38:14 +00:00
unit Bug 1415265 - Remove now unnecessary .eslintrc.js files or entries. r=mossop 2019-03-28 09:38:14 +00:00
.eslintrc.js Bug 1512052 - Add more .eslintrc.js files for test directories. r=mossop 2018-12-11 13:15:08 +00:00
bug586713_window.xul
chrome_context_menus_win.xul
chrome.ini
empty_window.xul
file_bug596600.html
file_input_events_on_deactive_window.html
file_secure_input.html
mochitest.ini Bug 1474902 - Part 5. Add mochitest. r=masayuki 2019-04-05 17:15:15 +09:00
moz.build Bug 1535353 - update Core :: DOM: * bugzilla product and component meta data in moz.build files after reorganization in bug 1533440 r=hsinyi 2019-03-17 23:13:22 +00:00
native_menus_window.xul
native_mouse_mac_window.xul
standalone_native_menu_window.xul
system_font_changes.xul
taskbar_previews.xul
test_actionhint.html Bug 1474902 - Part 5. Add mochitest. r=masayuki 2019-04-05 17:15:15 +09:00
test_AltGr_key_events_in_web_content_on_windows.html
test_assign_event_data.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_bug343416.xul
test_bug413277.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_bug428405.xul Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
test_bug429954.xul
test_bug444800.xul Bug 1503588 - Remove aDataLen parameter from nsITransferable.getAnyTransferData. r=smaug 2018-11-02 11:02:25 +00:00
test_bug466599.xul Bug 1493292 - Remove aDataLen parameters from nsITransferable.getTransferData. r=smaug 2018-11-20 16:59:56 +00:00
test_bug478536.xul
test_bug485118.xul
test_bug517396.xul
test_bug522217.xul
test_bug538242.xul
test_bug565392.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_bug586713.xul
test_bug593307.xul
test_bug596600.xul Bug 1519905 - Always return false in NodeAllowsClickThrough for browser elements;r=mstange 2019-01-14 20:42:50 +00:00
test_bug673301.xul
test_bug760802.xul
test_bug1123480.xul Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
test_bug1151186.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_chrome_context_menus_win.xul
test_clipboard.xul Bug 1493292 - Remove aDataLen parameters from nsITransferable.getTransferData. r=smaug 2018-11-20 16:59:56 +00:00
test_composition_text_querycontent.xul
test_imestate.html Bug 1521928 - Changing addObserver to removeObserver. r=Standard8 2019-02-18 13:55:06 +00:00
test_input_events_on_deactive_window.xul
test_key_event_counts.xul
test_keycodes.xul
test_keypress_event_with_alt_on_mac.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_mouse_scroll.xul
test_native_key_bindings_mac.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_native_menus.xul
test_native_mouse_mac.xul
test_panel_mouse_coords.xul
test_picker_no_crash.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_platform_colors.xul
test_plugin_input_event.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_plugin_scroll_consistency.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_position_on_resize.xul
test_scrollbar_colors.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_secure_input.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
test_sizemode_events.xul
test_standalone_native_menu.xul
test_system_font_changes.xul
test_system_status_bar.xul
test_taskbar_progress.xul
test_transferable_overflow.xul Bug 1514594: Part 3 - Change ChromeUtils.import API. 2019-01-17 10:18:31 -08:00
test_wheeltransaction.xul
TestAppShellSteadyState.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
TestChromeMargin.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
utils.js
window_bug429954.xul
window_bug478536.xul
window_bug522217.xul
window_bug538242.xul
window_bug593307_centerscreen.xul
window_bug593307_offscreen.xul
window_composition_text_querycontent.xul Bug 1530649 - Improve composition string handling which ends with whitespaces r=m_kato 2019-04-09 05:28:38 +00:00
window_imestate_iframes.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
window_mouse_scroll_win.html Bug 1521928 - Enable ESLint for widget (automatic changes). r=Standard8,jmathies 2019-02-14 20:20:20 +00:00
window_picker_no_crash_child.html
window_state_windows.xul
window_wheeltransaction.xul