Commit Graph

10660 Commits

Author SHA1 Message Date
Gijs Kruitbosch
d90c0bb57f Bug 1724718 - skip some XUL-y tests on android, r=emilio,agi
Depends on D122663

Differential Revision: https://phabricator.services.mozilla.com/D122664
2021-08-19 12:13:01 +00:00
Masayuki Nakano
11ff3c8e0d Bug 1726064 - part 3: Make HTMLEditor::MaybeCollapseSelectionAtFirstEditableNode() use HTMLEditUtils::GetAncestorElement() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D122941
2021-08-19 10:39:44 +00:00
Masayuki Nakano
2a6f988711 Bug 1726064 - part 2: Get rid of HTMLEditUtils::GetInclusiveAncestorBlockElementExceptHRElement r=m_kato
It does not check whether it meets a non-editable parent or not.  Therefore,
it may cross another editing host boundary when `aContent` is in a nested
editing host.

So, this patch fixes some edge cases when editing hosts are nested and
scanning from inner editing host.

Differential Revision: https://phabricator.services.mozilla.com/D122940
2021-08-19 06:55:13 +00:00
Masayuki Nakano
15cd88ce28 Bug 1726064 - part 1: Redesign HTMLEditUtils::ClosestEditableBlockElementOrEditingHost() with enum class r=m_kato
There are a lot of ancestor scanners in `HTMLEditUtils`.  This is good thing
for the performance, but it makes us hard to maintain.  Therefore, we should
merge them as far as possible.

Differential Revision: https://phabricator.services.mozilla.com/D122939
2021-08-19 05:39:16 +00:00
Masayuki Nakano
60811c73f8 Bug 1726080 - Make TextServicesDocument and OffsetEntryArray use raw pointer of OffsetEntry instead of reference to UniquePtr r=m_kato
If array size grows up, the array data may be reallocated.  Therefore, after
getting a reference of an array item, we shouldn't modify array.

This makes them use raw pointer if they need to modify the array.  Otherwise,
keep using the reference, but adds a stack class to detect the bug only in debug
build.

Differential Revision: https://phabricator.services.mozilla.com/D122920
2021-08-18 11:49:50 +00:00
Masayuki Nakano
6a5aa08b3c Bug 1725930 - Make TextServicesDocument::HasSameBlockNodeParent refer 2nd text node as expected r=m_kato
This is just a simple mistake, but I'm not sure how this break the callers.
Therefore, I don't have a testcase for this.

Differential Revision: https://phabricator.services.mozilla.com/D122705
2021-08-17 09:39:13 +00:00
Masayuki Nakano
13e75af6ad Bug 1725291 - part 3: Make WhiteSpaceVisibilityKeeper::MergeFirstLineOf(Right|Left)BlockElementIntoDescendant(Left|Right)BlockElement() abort handling it if joining elements become non-editable r=m_kato
They clean up the tail of descendant block first.  At this time, running script
may change one of or both of the left block element and the right block element.
In such situation, they should stop handling to join the blocks because of
unexpected case.

Depends on D122562

Differential Revision: https://phabricator.services.mozilla.com/D122565
2021-08-17 00:45:45 +00:00
Masayuki Nakano
0fb8b7b602 Bug 1725291 - part 2: Make HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal() guarantee that WhiteSpaceVisibilityKeeper::NormalizeVisibleWhiteSpacesAt() is called with editable point r=m_kato
If the point is not editable, white-spaces around it shouldn't be normalized.

Differential Revision: https://phabricator.services.mozilla.com/D122562
2021-08-17 00:04:16 +00:00
Masayuki Nakano
b3793d04e4 Bug 1725291 - part 1: Make HTMLEditor::AutoDeleteRangesHandler::DeleteUnnecessaryNodesAndCollapseSelection() try to delete same text node twice r=m_kato
It tries to delete a text node if it's invisible both selection start and
selection end.  However, the selection range may be in a text node.  If it's
an invisible, the node is deleted at first call of
`DeleteNodeIfInvisibleAndEditableTextNode()`, but it keep trying to remove
again with same method.

Differential Revision: https://phabricator.services.mozilla.com/D122561
2021-08-16 13:04:21 +00:00
Masayuki Nakano
2b288fd8d0 Bug 1636541 - Add reported testcase into the tree r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D122548
2021-08-13 12:16:33 +00:00
Masayuki Nakano
8f7d5cd728 Bug 1626002 - Add reported testcase into the tree r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D122547
2021-08-13 12:16:32 +00:00
Masayuki Nakano
ba5f5f3c5d Bug 1623166 - Add reported testcase into the tree r=m_kato
The test causes different assertion count between platforms.  As the comment in
crashtests.list, the difference is whether "removeList" command enabled check
is run at getting focus or not.  Perhaps, the difference is caused by whether
HTML commands are initialized before or after executing "indent" command.

Differential Revision: https://phabricator.services.mozilla.com/D122546
2021-08-13 12:16:32 +00:00
Masayuki Nakano
e7e6a469c6 Bug 1725323 - Make HTMLEditor::MaybeCollapseSelectionAtFirstEditableNode() not use WSRunScanner::ScanNextVisibleNodeOrBlockBoundary() for searching editable content r=m_kato
`WSRunScanner::ScanNextVisibleNodeOrBlockBoundary()` is designed for scanning
editable content so that it's wrong to use it for scanning first editable leaf
node.

Differential Revision: https://phabricator.services.mozilla.com/D122479
2021-08-13 07:39:13 +00:00
Masayuki Nakano
91fed01266 Bug 1723895 - Make WhiteSpaceVisibilityKeeper::ReplaceText() call GetInclusiveNextNBSPPointIfNeedToReplaceWithASCIIWhiteSpace with end of the replacing range instead of start of it r=m_kato
It tries to replace a following NBSP with an ASCII white-space if there is.
However, it calls the scan method with start of the replacing range.  Therefore,
the assertion in `GetInclusiveNextNBSPPointIfNeedToReplaceWithASCIIWhiteSpace()`
detects this bug.

Note that this occurs only when updating composition string because it's
called with non-collapsed range only for doing it.  Otherwise, selected range
has already been deleted by `HTMLEditor::DeleteSelectionAsSubAction()`.

Unfortunately, I don't have how to make this bug appear.  It seems that the
path does nothing in the wild because it tries to replace a first character
of composition string from an NBSP to a normal white-space, but it'll be
replaced with new composition string anyway.  Therefore, this patch does not
have new tests.

Differential Revision: https://phabricator.services.mozilla.com/D122182
2021-08-10 23:41:19 +00:00
Gijs Kruitbosch
3355c934ef Bug 1724718 - forget AddTask.js ever existed as bug 1544051 already removed it, r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D122166
2021-08-10 22:33:06 +00:00
Makoto Kato
a6944a1428 Bug 1719110 - Add nsIEditorSpellCheck.suggest to get rid of PRemoteSpellcheckEngine.CheckAndSuggest. r=masayuki
When getting suggestions from spellchecker's result, we use sync IPC
(`PRemoteSpellcheckEngine.CheckAndSuggest`). This is used by showing context
menu only on Gecko. So I think that we can remove this IPC if we add async API
to get spellchecker suggestions.

And in comm-central's code, `CheckCurrentWord` and `GetSuggestedWord` seems to
use on spellchecker dialog (content/dialogs/EdSpellCheck.js in mail and suite)
that runs on parent process. So c-c won't use this IPC method.

So I would like to add the promise version of getting spellchecker's
suggestion.

Differential Revision: https://phabricator.services.mozilla.com/D119936
2021-08-10 03:55:25 +00:00
Masayuki Nakano
53bef623bf Bug 1717760 - Stop using KeyEvent.initKeyEvent in our tests r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121028
2021-08-10 03:51:37 +00:00
Emilio Cobos Álvarez
baf18c5198 Bug 1723921 - Throw on invalid pseudo-elements in getComputedStyle() as per spec. r=dholbert,layout-reviewers
I need to update tests, try incoming.

Depends on D121705

Differential Revision: https://phabricator.services.mozilla.com/D121706
2021-08-07 09:55:55 +00:00
Emilio Cobos Álvarez
2d0a072174 Bug 1723921 - Cleanup nsComputedDOMStyle and related APIs. r=layout-reviewers,jfkthame
This will make implementing the new behavior behind a pref
really straight-forward, and is generally nicer.

Depends on D121858

Differential Revision: https://phabricator.services.mozilla.com/D121705
2021-08-07 09:47:15 +00:00
Kagami Sascha Rosylight
948c17135b Bug 1724225 - Part 1: Replace dragexit with dragleave in editor/libeditor/ r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D121193
2021-08-07 09:29:18 +00:00
Geoff Brown
1bc378075c Bug 1724296 - Remove many skip-if(verify) test annotations (reftest-plain); r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D121920
2021-08-06 13:25:49 +00:00
Masayuki Nakano
1d519835ab Bug 1722748 - Make TextServicesDocument::OffsetEntryArray::RemoveInvalidElements() adjust selection indexes when middle of the selection start and end entry is removed r=m_kato
It handles selection indexes really roughly since it does it only when
start index is same or greater then removing index.  So, only end index
may be greater than the removing index, and if the start index is 0, it
sets `-1` to selection start.

I don't find any other issues around setting selection indexes.  However,
for detecting wrong selection index management, this patch adds
`MOZ_DIAGNOSTIC_ASSERT` to every setter.

Differential Revision: https://phabricator.services.mozilla.com/D121592
2021-08-04 04:40:38 +00:00
Masayuki Nakano
6122a660a0 Bug 1723125 - Ignore normal selection when updating composition string r=m_kato
Web apps can modify normal selection even during IME composition and no
browsers stop composition by it.  However, our editor tries to delete
non-collapsed selected range before updating composition.  Therefore,
we need additional state at handling inserting text whether selection
should be deleted or ignored.

Depends on D121371

Differential Revision: https://phabricator.services.mozilla.com/D121372
2021-08-02 08:23:50 +00:00
Masayuki Nakano
c177665684 Bug 1722535 - Make HTMLEditor call HTMLEditUtils::GetBetterInsertionPoint() with an editing host which is not limited in the <body> r=m_kato
Previously, `HTMLEditor::GetBetterInsertionPoint()` didn't check whether
given point is in an editing host or not.  However, now
`HTMLEditUtils::GetBetterInsertionPoint()` does it with editing host which
is returned by `HTMLEditor::GetActiveEditingHost(LimitInBodyElement::No)`.
However, the old behavior is exactly same as
`HTMLEditor::GetActiveEditingHost(LimitInBodyElement::Yes)` if editing host
is outside the `<body>` element.

For taking back the original behavior, we should call the method with the
result of the latter.

Differential Revision: https://phabricator.services.mozilla.com/D121370
2021-08-02 08:23:49 +00:00
Andrew Osmond
6f3d06c7cb Bug 1722726 - Move Linux tsan tests to WebRender. r=jmaher
autoland

--- target_task_set@32af9322f9bf
+++ target_task_set@ao_ci_linux_tsan
-test-linux1804-64-tsan/opt-crashtest-e10s
-test-linux1804-64-tsan/opt-mochitest-a11y-1proc
-test-linux1804-64-tsan/opt-mochitest-browser-chrome-e10s
-test-linux1804-64-tsan/opt-mochitest-media-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-spi-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-fis-e10s
-test-linux1804-64-tsan/opt-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-fis-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-fis-e10s
-test-linux1804-64-tsan/opt-xpcshell-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-a11y-1proc
+test-linux1804-64-tsan-qr/opt-mochitest-browser-chrome-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-spi-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-fis-e10s
+test-linux1804-64-tsan-qr/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-reftest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-swr-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-fis-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-fis-e10s
+test-linux1804-64-tsan-qr/opt-xpcshell-e10s

mozilla-central

--- target_task_set@32af9322f9bf
+++ target_task_set@ao_ci_linux_tsan
-test-linux1804-64-tsan/opt-crashtest-e10s
-test-linux1804-64-tsan/opt-mochitest-a11y-1proc
-test-linux1804-64-tsan/opt-mochitest-browser-chrome-e10s
-test-linux1804-64-tsan/opt-mochitest-media-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-e10s
-test-linux1804-64-tsan/opt-mochitest-media-fis-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-gli-e10s
-test-linux1804-64-tsan/opt-mochitest-media-spi-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-e10s
-test-linux1804-64-tsan/opt-mochitest-plain-fis-e10s
-test-linux1804-64-tsan/opt-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-fis-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-e10s
-test-linux1804-64-tsan/opt-web-platform-tests-reftest-fis-e10s
-test-linux1804-64-tsan/opt-xpcshell-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-a11y-1proc
+test-linux1804-64-tsan-qr/opt-mochitest-browser-chrome-swr-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-fis-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-gli-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-media-spi-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-e10s
+test-linux1804-64-tsan-qr/opt-mochitest-plain-fis-e10s
+test-linux1804-64-tsan-qr/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-reftest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-swr-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-fis-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-e10s
+test-linux1804-64-tsan-qr/opt-web-platform-tests-reftest-fis-e10s
+test-linux1804-64-tsan-qr/opt-xpcshell-e10s

mozilla-release

--- target_task_set@32af9322f9bf
+++ target_task_set@ao_ci_linux_tsan
-test-linux1804-64-tsan/opt-crashtest-e10s
-test-linux1804-64-tsan/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-crashtest-swr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-e10s
+test-linux1804-64-tsan-qr/opt-reftest-noqr-e10s
+test-linux1804-64-tsan-qr/opt-reftest-swr-e10s

Differential Revision: https://phabricator.services.mozilla.com/D121099
2021-07-30 12:23:36 +00:00
Masayuki Nakano
dbc4e0135e Bug 1721317 - part 2: Make _pasteToTargetElement() sync r=m_kato
The function tests whether `input` event whose `inputType` is `insertFromPaste`
or not and it waits the event until timeout.  This sometimes fails in my
environment, and `input` event should be fired synchronously in this case.
Therefore, it should just fail if the event isn't fired.

Depends on D120424

Differential Revision: https://phabricator.services.mozilla.com/D120425
2021-07-21 23:22:04 +00:00
Masayuki Nakano
e21daf33c3 Bug 1721317 - part 1: Make test_pasting_table_rows.html abort remaining tests if unexpected exception is thrown r=m_kato
Oddly, clipboard related test randomly (and frequently) fails in my environment.
And `test_pasting_table_rows.html` does not handle exception which is thrown
by `SimpleTest.promiseClipboardChange`.  Therefore, I'm always waiting 5 mins
when I run all tests under `editor/libeditor/tests`.

Therefore, I'd like to make it abort remaning tests if it fails due to
an unexpected exception.

Additionally, this fixes a bug in `_copyToClipboard#validatorFn`.  This method
modifies the variable of the parent function, `aExpectedPastedHTML`, with
itself.  Therefore, when the function is called multiple times, the expected
string will be re-wrapped with `kTextHtmlPrefixClipboardDataWindows` and
`kTextHtmlSuffixClipboardDataWindows` again and again...

Differential Revision: https://phabricator.services.mozilla.com/D120424
2021-07-21 23:22:03 +00:00
Masayuki Nakano
7448c66839 Bug 1721323 - Move some tests under editor/libeditor/tests which mainly test spellchecker behavior to editor/spellchecker/tests r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D120421
2021-07-21 05:39:16 +00:00
Masayuki Nakano
45b115a2d0 Bug 1311934 - Replace TextServicesDocument::IsBlockNode() with HTMLEditUtils::IsBlockElement() r=m_kato
For consistency, between `TextServicesDocument` and `HTMLEditor`,
`TextServicesDocument::IsBlockNode()` should be replaced with
`HTMLEditUtils::IsBlockElement()` for making same consideration for each
element type.

Differential Revision: https://phabricator.services.mozilla.com/D119870
2021-07-19 23:11:25 +00:00
Masayuki Nakano
b5ce8cc8c4 Bug 1720436 - Make test_bug408231.html specify default font-familiy explicitly r=m_kato
It checks default `font-family` with editing commands, but it depends on the
system locale. ("serif" vs. "sans-serif").  So, its `<body>` should be styled
as `font-family: serif` for consistent behavior in any environment.

Differential Revision: https://phabricator.services.mozilla.com/D119871
2021-07-15 10:46:55 +00:00
Masayuki Nakano
04b41051dd Bug 1665550 - part 4: Make EventStateManager update mGestureDownFrameOwner when anonymous nodes in <input> or <textarea> are replaced r=smaug
`EventStateManager` gives up to track gesture to start a drag if mouse down
content which is stored in `mGestureDownFrameOwner` gets lost its primary frame.

When user tries to start to drag selected text in `<input>` or `<textarea>`
element, mouse down content is an anonymous node in `TextControlElement`. So,
if a reflow occurs after `mousedown` event, the anonymous `<div>` element
is replaced with new one and `EventStateManager` gives up to track it.

Therefore, this patch makes `EventStateManager` do similar things as
`nsBaseDragService`.  When `nsTextControlFrame` notifies of remove/add
the anonymous nodes, `EventStateManager` tries to keep tracking gesture with
a new anonymous node.

Differential Revision: https://phabricator.services.mozilla.com/D119488
2021-07-14 01:20:20 +00:00
Masayuki Nakano
a171e12db6 Bug 1665550 - part 3: Make nsTextControlFrame set the source node and selection of drag session to new ones when it's reframed r=smaug
When `nsTextControlFrame` is reframed, `TextEditor`, anonymous `<div>`, its
`Text` and the independent `Selection`s are deleted temporarily and recreated
them.

If users are dragging text in `<input>` or `<textarea>`, the drag session's
source node is set to the anonymous text node in the element and the selection
is set to the independent selection.  So, if the element is reframed during a
drag, the source node is disconnected from the document and `EndDragSession`
failed to dispatch `eDragEnd` event.

Therefore, this patch makes `nsTextControlFrame` replaces the source node and
selection when it's recreated and only when the drag session's original source
node was in the text control element.  For checking which text control had the
anonymous text node, this patch makes `nsTextControlFrame` replaces source
node with the `<input>` or `<textarea>` element when the frame is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D119487
2021-07-14 01:20:19 +00:00
Masayuki Nakano
e577d75b11 Bug 1665550 - part 2: Rewrite test_dragdrop.html with IIEF r=m_kato
With IIEF, we can guarantee each test block isolated.  So, without declaring
semi-global variables a lot for all tests, developers can comment out every
tests to debug only one thing.

Differential Revision: https://phabricator.services.mozilla.com/D119486
2021-07-14 01:20:19 +00:00
Masayuki Nakano
0324a4e4ef Bug 1665550 - part 1: Make test_dragdrop.html handle exception from synthesizePlainDragAndDrop r=m_kato
When the test is timed out, there is a JS error which is thrown by
`synthesizePlainDragAndDrop`.  So, first, make the test handle exception
with `try-catch` and assert the error.

Differential Revision: https://phabricator.services.mozilla.com/D119485
2021-07-14 01:20:18 +00:00
Masayuki Nakano
886c96059e Bug 1718924 - part 18: Move some blocks which work with TextServicesDocument::mOffsetTable into new separated methods r=m_kato
Depends on D119164

Differential Revision: https://phabricator.services.mozilla.com/D119165
2021-07-13 11:19:22 +00:00
Masayuki Nakano
1fbcf183f9 Bug 1718924 - part 17: Move TextServicesDocument::mSelectionStartOffsetInTexInBlock and TextServicesDocument::mSelectionEndOffsetInTextInBlock into OffsetEntryTable r=m_kato
Depends on D119163

Differential Revision: https://phabricator.services.mozilla.com/D119164
2021-07-13 11:09:57 +00:00
Masayuki Nakano
abfa8fead9 Bug 1718924 - part 16: Move TextServicesDocument::RemoveInvalidOffsetEntries() to OffsetEntry r=m_kato
Depends on D119162

Differential Revision: https://phabricator.services.mozilla.com/D119163
2021-07-13 11:03:56 +00:00
Masayuki Nakano
d3e59b2f42 Bug 1718924 - part 15: Move TextServicesDocument::mSelStartIndex and TextServicesDocument::mSelEndIndex into OffsetEntryArray r=m_kato
They are indices of `OffsetEntryArray`. Therefore, they should be managed in it.

Depends on D119161

Differential Revision: https://phabricator.services.mozilla.com/D119162
2021-07-13 10:57:48 +00:00
Masayuki Nakano
987147357a Bug 1718924 - part 14: Move TextServicesDocument::SplitOffsetEntry to OffsetEntryArray r=m_kato
Depends on D119160

Differential Revision: https://phabricator.services.mozilla.com/D119161
2021-07-13 10:51:46 +00:00
Masayuki Nakano
f4d6fde8cd Bug 1718924 - part 13: Move TextServicesDocument::NodeHasOffsetEntry() into OffsetEntryArray r=m_kato
Depends on D119159

Differential Revision: https://phabricator.services.mozilla.com/D119160
2021-07-13 10:46:40 +00:00
Masayuki Nakano
5f44d6166c Bug 1718924 - part 12: Move TextServicesDocument::FindWordBounds() to OffsetEntryArray r=m_kato
Depends on D119158

Differential Revision: https://phabricator.services.mozilla.com/D119159
2021-07-13 10:19:40 +00:00
Masayuki Nakano
e2aec22fef Bug 1718924 - part 11: Create custom class of nsTArray<UniquePtr<OffsetEntry>> r=m_kato
There are some methods in `TextServicesDocument` which work only with
`TextServicesDocument::mOffsetTable`.  Once we move such methods to custom
class of `nsTArray<UniquePtr<OffsetEntry>>`, we can make `TextServicesDocument`
simpler.

Depends on D119157

Differential Revision: https://phabricator.services.mozilla.com/D119158
2021-07-13 10:11:06 +00:00
Masayuki Nakano
3169bc5de5 Bug 1720252 - Get rid of "dom.input_events.beforeinput.enabled" from tests r=smaug
`beforeinput` event was shipped and it won't be disabled for avoiding confusion
of web developers. So, we can drop the pref setting of
"dom.input_events.beforeinput.enabled" in our tests.

Depends on D119716

Differential Revision: https://phabricator.services.mozilla.com/D119729
2021-07-13 10:02:12 +00:00
Masayuki Nakano
afce03d9c7 Bug 1718924 - part 10: Make all OffsetEntry instances unique pointers r=m_kato
Now, it stores `dom::Text` with `OwningNonNull`.  So, once it's leaked, it
wastes a lot of memory spaces.  Therefore, we should make `mOffsetTable`
store `UniquePtr<OffsetEntry>` instead of `OffsetEntry*`.

Depends on D119156

Differential Revision: https://phabricator.services.mozilla.com/D119157
2021-07-13 09:55:59 +00:00
Masayuki Nakano
b8ea33dddf Bug 1718924 - part 9: Rename TextServicesDocument::mSel(Start|End)Offset r=m_kato
Now, the meaning of `OffsetEntry` is clear.  Therefore, this patch adds comment
explaining the class and its members.

Then, the meaning of `TextServicesDocument::mSelStartOffset` and
`TextServicesDocument::mSelEndOffset` becomes clearer since they are used to
create `OffsetEntry` instances.  Therefore, this patch renames them.

Depends on D119155

Differential Revision: https://phabricator.services.mozilla.com/D119156
2021-07-13 09:42:34 +00:00
Masayuki Nakano
9ccb5fd526 Bug 1718924 - part 8: Add OffsetEntry::OffsetInTextInBlockIsInRangeOrEndOffset() r=m_kato
Depends on D119154

Differential Revision: https://phabricator.services.mozilla.com/D119155
2021-07-13 09:06:04 +00:00
Masayuki Nakano
36c6e61f3c Bug 1718924 - part 7: Add OffsetEntry::EndOffsetInTextInBlock() r=m_kato
Depends on D119153

Differential Revision: https://phabricator.services.mozilla.com/D119154
2021-07-13 08:49:47 +00:00
Masayuki Nakano
91272b59bb Bug 1718924 - part 6: Rename OffsetEntry::mStrOffset to mOffsetInTextInBlock r=m_kato
Depends on D119152

Differential Revision: https://phabricator.services.mozilla.com/D119153
2021-07-13 08:42:01 +00:00
Masayuki Nakano
d1c80af6c8 Bug 1718924 - part 5: Add OffsetEntry::OffsetInTextNodeIsInRangeOrEndOffset() r=m_kato
Depends on D119151

Differential Revision: https://phabricator.services.mozilla.com/D119152
2021-07-13 08:42:00 +00:00
Masayuki Nakano
84f8568e67 Bug 1718924 - part 4: Add OffsetEntry::EndOffsetInTextNode() r=m_kato
Depends on D119150

Differential Revision: https://phabricator.services.mozilla.com/D119151
2021-07-13 08:35:32 +00:00