Commit graph

22 commits

Author SHA1 Message Date
Marc Durdin
b05fda1c6a fix(web): selection direction and tests
Selection direction was not maintained in mutations, which could have
unexpected consequences. Added support for selection direction to input
and textarea.

The functions `getTextBeforeCaret()` and `getTextAfterCaret()` are named
somewhat incorrectly, as they actually get the text before and after the
active selection (and a collapsed zero-length selection is equivalent to
the caret). It would be worth renaming these in a future refactor.

This PR fixes the unit tests so that caret position is tested correctly
with an active selection -- the caret can be at either the start or the
end of the selection, corresponding with the direction in which the user
originally selected the text. It also fixes the assumptions around the
above named functions for `input` and `textarea` types.

Note that selection interactions are still buggy with prediction
selections; these bugs were present in 15.0.118-alpha and I will tackle
them in an upcoming commit.
2022-02-23 15:13:07 +11:00
jahorton
f06c94485e change(web): moves KMW test resources to common/core/web/tests/ 2020-05-01 08:10:32 +07:00
jahorton
8ecacd0476 fix(web): unit test adjustments for new namespacing
fix(web): missed resource
2020-03-26 13:00:45 +07:00
jahorton
efe440c659 fix(web): unit test reporting stability 2019-11-27 09:53:42 +07:00
Joshua A. Horton
dfcfa2343b feat(web): bounds check unit test 2019-10-31 11:48:00 +07:00
Joshua A. Horton
92179f3b4a A little test case tidying work. 2019-02-19 15:22:04 +07:00
Joshua A. Horton
45db7ef566 Adds deadkey test for Mocks. 2019-02-08 01:03:00 +07:00
Joshua A. Horton
36e8aec6f0 Merge branch 'web-element-interface-deadkeys' into web-stub-output-target 2019-02-08 00:57:00 +07:00
Joshua A. Horton
0fc4a73834 Adds a deadkey recording + adjustment unit test for OutputTargets. 2019-02-08 00:39:20 +07:00
Joshua A. Horton
d6e8a8c043 Renames dom.EditableElement to text.OutputTarget. 2019-02-07 22:19:23 +07:00
Joshua A. Horton
11f93909e0 Brainstorming on mock-specific tests. 2019-02-07 02:01:56 +07:00
Joshua A. Horton
9e9180c6b7 Initial work on the Mock output-target type. 2019-02-07 01:53:54 +07:00
Joshua A. Horton
8aab139ef4 Adds a touch-alias element interface test. 2019-01-30 20:37:37 +07:00
Joshua A. Horton
65fbf2fc61 Implements interface for design-mode IFrames, adds related testing. 2019-01-18 13:59:26 +07:00
Joshua A. Horton
104fe77f2c Adds workaround for CI-only Firefox testing error. 2019-01-18 10:09:59 +07:00
Joshua A. Horton
29cb0d1117 Minor tweak to address error seen in CI. 2019-01-18 09:58:14 +07:00
Joshua A. Horton
f3e3f71257 Completes implementation of ContentEditable, basic testing of the same. 2019-01-18 09:41:10 +07:00
Joshua A. Horton
5a234f3968 More tweaks - still sufficient but friendlier to contentEditables. 2019-01-17 20:02:30 +07:00
Joshua A. Horton
e8ad9100e7 Better abstraction; no need to provide external caret access. 2019-01-17 16:01:31 +07:00
Joshua A. Horton
ed71f3791c Adds another abstraction method for context char deletion. 2019-01-17 15:49:15 +07:00
Joshua A. Horton
37dd55d5ee Completes development of 'wrappers' for Input and TextArea elements. 2019-01-17 13:32:04 +07:00
Joshua A. Horton
1c89d3b9dc Starts work on element interfaces and related unit-test development. 2019-01-17 09:29:22 +07:00