gecko-dev/editor
Nika Layzell c15823d075 Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret
The biggest set of APIs from ns[T]StringObsolete which are still heavily used
are the string searching APIs. It appears the intention was for these to be
replaced by the `FindInReadable` APIs, however that doesn't appear to have
happened.

In addition, the APIs have some quirks around their handling of mixed character
widths. These APIs generally supported both narrow strings and the native
string type, probably because char16_t string literals weren't available until
c++11. Finally they also used easy-to-confuse unlabeled boolean and integer
optional arguments to control behaviour.

These patches do the following major changes to the searching APIs:

1. The ASCII case-insensitive search method was split out as
   LowerCaseFindASCII, rather than using a boolean. This should be less
   error-prone and more explicit, and allows the method to continue to use
   narrow string literals for all string types (as only ASCII is supported).
2. The other [R]Find methods were restricted to only support arguments with
   matching character types. I considered adding a FindASCII method which would
   use narrow string literals for both wide and narrow strings but it would've
   been the same amount of work as changing all of the literals to unicode
   literals.
   This ends up being the bulk of the changes in the patch.
3. All find methods were re-implemented using std::basic_string_view's find
   algorithm or stl algorithms to reduce code complexity, and avoid the need to
   carry around the logic from nsStringObsolete.cpp.
4. The implementations were moved to nsTStringRepr.cpp.
5. An overload of Find was added to try to catch callers which previously
   called `Find(..., false)` or `Find(..., true)` to set case-sensitivity, due
   to booleans normally implicitly coercing to `index_type`. This should
   probably be removed at some point, but may be useful during the transition.

Differential Revision: https://phabricator.services.mozilla.com/D148300
2022-07-30 00:12:48 +00:00
..
composer Bug 1776207: Part 1 - Remove obsolete _xpcom_factory definitions. r=mccr8 2022-06-27 21:19:51 +00:00
docs Bug 1687167 - Move IME handling guide to source tree. r=masayuki DONTBUILD 2021-01-19 06:07:27 +00:00
libeditor Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret 2022-07-30 00:12:48 +00:00
reftests Bug 1761160: Disable spellechecking in the textarea for the blur-focus test. r=masayuki 2022-06-25 18:45:09 +00:00
spellchecker Bug 1780543 - Part 5: Add mozilla/chrome-script environment. r=Standard8 2022-07-26 02:46:30 +00:00
txmgr Bug 1767876 - part 3: Get rid of `nsITransactionListener` interface r=m_kato 2022-05-09 12:13:11 +00:00
AsyncSpellCheckTestHelper.jsm Bug 1761273 - Check for multiple dictionaries when saving site preferences; r=smaug 2022-03-24 22:29:42 +00:00
moz.build Bug 1769128 - Enable '-ftrivial-auto-var-init=pattern' in editor. r=glandium 2022-05-26 06:15:36 +00:00
nsIDocumentStateListener.idl
nsIEditActionListener.idl Bug 1739545 - part 2: Redesign `TextServicesDocument::DidJoinNodes()` methods r=m_kato 2021-11-09 01:09:20 +00:00
nsIEditor.idl Bug 1764684 - part 2: Make editor use methods of `EditorBase` to collapse `Selection` r=m_kato 2022-04-20 14:36:52 +00:00
nsIEditorMailSupport.idl Bug 1768057 - Make nsIEditorMailSupport::insertTextWithQuotations available to JS callers. r=masayuki 2022-05-11 14:49:29 +00:00
nsIEditorSpellCheck.idl Bug 1402822 - Support multiple dictionaries in EditorSpellCheck; r=smaug 2022-03-23 13:53:38 +00:00
nsIHTMLAbsPosEditor.idl Bug 1717178 - part 2: Get rid of `nsIHTMLAbsPosEditor.refreshGrabber()` because of unused r=m_kato 2021-06-28 12:08:49 +00:00
nsIHTMLEditor.idl Bug 1717178 - part 6: Get rid of `nsIHTMLEditor.setCaretAfterElement()` because of unused r=m_kato 2021-06-28 12:08:51 +00:00
nsIHTMLInlineTableEditor.idl Bug 1717178 - part 1: Get rid of `nsIHTMLInlineTableEditor.refreshInlineTableEditingUI()` because of unused r=m_kato 2021-06-28 12:08:49 +00:00
nsIHTMLObjectResizer.idl Bug 1717178 - part 3: Get rid of `nsIHTMLObjectResizer.refreshResizers()` because of unused r=m_kato 2021-06-28 12:08:49 +00:00
nsITableEditor.idl Bug 1730442 - part 1: Make all `nsITableEditor` features flush pending layout at start to handle their jobs r=m_kato 2022-05-20 07:39:51 +00:00