10817 Commits

Author SHA1 Message Date
Sandor Molnar
2594d2ac61 Backed out 2 changesets (bug 1733659) for causing build bustages. CLOSED TREE
Backed out changeset 9e23aa79fda9 (bug 1733659)
Backed out changeset e316768591c0 (bug 1733659)
2021-11-22 20:51:20 +02:00
Dan Minor
bcbfdb6d73 Bug 1733659 - Clean up naming style in Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D131511
2021-11-22 18:32:41 +00:00
Masayuki Nakano
dac29e99f8 Bug 1740872 - part 11: Make HTMLEditor::AlignContentsAtSelectionWithEmptyDivElement() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131207

Differential Revision: https://phabricator.services.mozilla.com/D131208
2021-11-17 11:32:32 +00:00
Masayuki Nakano
46279fe06e Bug 1740872 - part 10: Make HTMLEditor::MoveSelectedContentsToDivElementToMakeItAbsolutePosition() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131206

Differential Revision: https://phabricator.services.mozilla.com/D131207
2021-11-17 08:51:41 +00:00
Masayuki Nakano
dd0da96bdf Bug 1740872 - part 9: Make HTMLEditor::MoveNodesIntoNewBlockquoteElement() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131205

Differential Revision: https://phabricator.services.mozilla.com/D131206
2021-11-17 08:41:19 +00:00
Masayuki Nakano
70d1503c98 Bug 1740872 - part 8: Make HTMLEditor::AlignNodesAndDescendants() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131204

Differential Revision: https://phabricator.services.mozilla.com/D131205
2021-11-17 08:34:20 +00:00
Masayuki Nakano
bc98fa8c1b Bug 1740872 - part 7: Make HTMLEditor::HandleHTMLIndentAtSelectionInternal() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131203

Differential Revision: https://phabricator.services.mozilla.com/D131204
2021-11-17 08:28:31 +00:00
Masayuki Nakano
1e5b6b30d9 Bug 1740872 - part 6: Make HTMLEditor::HandleCSSIndentAtSelectionInternal() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131202

Differential Revision: https://phabricator.services.mozilla.com/D131203
2021-11-17 06:57:12 +00:00
Masayuki Nakano
c7c026d1d5 Bug 1740872 - part 5: Make HTMLEditor::IndentListChild() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131201

Differential Revision: https://phabricator.services.mozilla.com/D131202
2021-11-17 05:56:37 +00:00
Masayuki Nakano
8ddcf70f8d Bug 1740872 - part 4: Make HTMLEditor::FormatBlockContainerWithTransaction() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131200

Differential Revision: https://phabricator.services.mozilla.com/D131201
2021-11-17 04:49:48 +00:00
Masayuki Nakano
9285df8aea Bug 1740872 - part 3: Make HTMLEditor::ChangeSelectedHardLinesToList() use HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() r=m_kato
Depends on D131199

Differential Revision: https://phabricator.services.mozilla.com/D131200
2021-11-17 04:08:47 +00:00
Masayuki Nakano
f4e651e520 Bug 1740872 - part 2: Create HTMLEditor::InsertElementWithSplittingAncestorsWithTransaction() to wrap to call a pair of MaybeSplitAncestorsForInsertWithTransaction() and CreateAndInsertElementWithTransaction() r=m_kato
There are a lot of places which calls
`HTMLEditor::MaybeSplitAncestorsForInsertWithTransaction()` and then calls
`HTMLEditor::CreateAndInsertElementWithTransaction()` with split point of the
preceding result.  It's better to wrap them in a method for reducing the
maintenance cost.

`HTMLEditor::CreateOrChangeBlockContainerElement()` handles to calling them
safer than the others so that let's use this code for the new method.  The
additional change won't change the most web apps which don't touch the DOM
tree from legacy mutation event listeners.

Depends on D131198

Differential Revision: https://phabricator.services.mozilla.com/D131199
2021-11-17 04:08:47 +00:00
Masayuki Nakano
44969eec1c Bug 1740872 - part 1: Move EditorBase::CreateElementWithTransaction() into HTMLEditor r=m_kato
I realized that it's now used only by `HTMLEditor` so that we can move it
into `HTMLEditor` and we can make `CreateElementTransaction` treat `HTMLEditor`
directly rather than via `EditorBase`.

Differential Revision: https://phabricator.services.mozilla.com/D131198
2021-11-17 04:08:46 +00:00
Greg Tatum
ec908112f4 Bug 1738057 - Split out BidiEmbeddingLevel into its own file; r=platform-i18n-reviewers,dminor
This should speed up re-compile times, as mozilla/intl/Bidi.h will only
be included in a few places.

Differential Revision: https://phabricator.services.mozilla.com/D129662
2021-11-16 15:11:58 +00:00
Masayuki Nakano
859a7e84a5 Bug 1740859 - part 2: Make HTMLEditor::SplitNodeDeepWithTransaction() callers omit checking whether the editor is destroyed r=m_kato
It touches the DOM tree only with `SplitNodeTransaction()` and it now returns
`NS_ERROR_EDITOR_DESTROYED` so that the callers don't need to check whether
the editor is destroyed or alive by themselves.

Depends on D131043

Differential Revision: https://phabricator.services.mozilla.com/D131044
2021-11-15 02:29:48 +00:00
Masayuki Nakano
c3d57d415e Bug 1740859 - part 1: Make HTMLEditor::SplitNodeWithTransaction() return NS_ERROR_EDITOR_DESTROYED if it happens r=m_kato
For making the code simpler, this patch makes it returns
`Result<nsCOMPtr<nsIContent>, nsresult>` instead of using `ErrorResult`.
This must make the construction faster and callers simpler.

Depends on D130950

Differential Revision: https://phabricator.services.mozilla.com/D131043
2021-11-15 02:23:33 +00:00
Masayuki Nakano
334e34f0a9 Bug 1740416 - Make HTMLEditor::HandleInsertParagraphInParagraph() call WhiteSpaceVisibilityKeeper::PrepareToSplitBlockElement() before splitting a text node r=m_kato,smaug
It does the following things when caret is collapsed in a text node in a `<p>`
or `<div>` element.

1. Split the text node containing caret to insert `<br>` element
2. Insert `<br>` element after it
3. Split ancestor elements which inclusive descendants of the `<p>` or `<div>`
4. Delete the `<br>` element if unnecessary from the left paragraph

#3 and #4 are performed by `HTMLEditor::SplitParagraph()` and it calls
`WhiteSpaceVisibilityKeeper::PrepareToSplitBlockElement()` correctly before
splitting the block.  However, in the case (caret is at middle of a text node),
the text has already been split to 2 nodes because of #1.  Therefore, it fails
to handle to keep the white-space visibility.

So that I believe that the root cause of this bug is, the method does much
complicated things which are required, and doing the redundant things will
eat memory space due to undo transactions.  However, for now, I'd like to fix
this with a simple patch which just call the preparation method before splitting
the text node because I'd like to uplift this if it'd be approved (Note that
this is not a recent regression, the root cause was created by bug 92686 which
was fixed in 17 years ago:
<https://searchfox.org/mozilla-central/commit/2e66280faef73e9be218e00758d4eb738395ac83>,
but must be annoying bug for users who see this frequently).

The new WPTs are pass in Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D130950
2021-11-12 22:13:51 +00:00
Masayuki Nakano
0dcfd11fa8 Bug 1740847 - part 3: Make WhiteSpaceVisibilityKeeper::ReplaceText() track insert position in smaller block r=m_kato
Similar to the previous patch, this patch also make it track invisible
white-space ranges and clear outdated things.

And this makes it cache some information instead of tracking some changes
because of performance reason.

Depends on D131037

Differential Revision: https://phabricator.services.mozilla.com/D131038
2021-11-12 08:31:22 +00:00
Masayuki Nakano
052b897b21 Bug 1740847 - part 2: Make WhiteSpaceVisibilityKeeper::InsertBRElement() track insert position in smaller block r=m_kato
And also invisible white-space range and replacing white-space position should
also be tracked too.

Depends on D131036

Differential Revision: https://phabricator.services.mozilla.com/D131037
2021-11-12 08:04:37 +00:00
Masayuki Nakano
2c2f8ab1c6 Bug 1740847 - part 1: Track split point at replacing collapsible white-spaces r=m_kato
It `pointToSplit` should be tracked at replacing text, but I have no idea how
to test this because it replaces the text after the split point.

Differential Revision: https://phabricator.services.mozilla.com/D131036
2021-11-12 07:20:31 +00:00
Masayuki Nakano
925fc15324 Bug 1739933 - Make TopLevelEditSubActionData::DidSplitNode() handle both cases that either left or right node is a new node r=m_kato
Currently, it assumes that new node is the left node and split node is the
right node.  However, we need to make it possible to handle the case that
right node is new one for fixing bug 1735608.

Depends on D130458

Differential Revision: https://phabricator.services.mozilla.com/D130624
2021-11-09 07:11:23 +00:00
Ting-Yu Lin
f32eaad379 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-09 01:14:15 +00:00
Masayuki Nakano
dfa4091f3b Bug 1739545 - part 2: Redesign TextServicesDocument::DidJoinNodes() methods r=m_kato
There is 2 overloads.  One is `TextServicesDocument`'s method, and the latter is
for `nsIEditActionListener`.  The latter could occur if `TextServicesDocument`
is added to the editor when there is no inline spellchecker, `EditorSpellCheck`
or `mozSpellChecker`.
https://searchfox.org/mozilla-central/rev/d2f8488b6a704443a5c5bfc6d2878171b5f0d393/editor/libeditor/EditorBase.cpp#2388,2391,2393,2396,2398

I don't know whether this is possible case, but unfortunately,
`nsIEditActionListener::DidJoinNodes()` is not implemented by JS and implemented
only by `TextServicesDocument`.  Therefore, we can make it "noscript" and use
non-scriptable classes as arguments.

This patch makes them get jointed point and removed content node and the joining
direction for fixing bug 1735608.  Unfortunately, there is no test framework
to check the result in `TextServicesDocument` nor the new path.  The latter
should be tested when we fix bug 1735608 later.

Differential Revision: https://phabricator.services.mozilla.com/D130458
2021-11-09 01:09:20 +00:00
Masayuki Nakano
1034b36c49 Bug 1739545 - part 1: Get rid of mozInlineSpellChecker::DidJoinNodes() and mozInlineSpellChecker::DidSplitNode() r=m_kato
Currently, they do nothing because they specify empty range to
`SpellCheckBetweenNodes()`, and it makes the method does nothing.  This is
filed as bug 1581714.  However, they are not required because `HTMLEditor`
notifies `mozInlineSpellChecker` at ending handling the top level edit sub
action.
https://searchfox.org/mozilla-central/rev/a12c2c2e59c92d8f969d8f3f290ab16919449c9d/editor/libeditor/HTMLEditSubActionHandler.cpp#675

Therefore, these methods are not necessary anymore.

Differential Revision: https://phabricator.services.mozilla.com/D130457
2021-11-09 01:09:20 +00:00
Iulian Moraru
36283a9a3b Backed out 2 changesets (bug 1722484) for causing multiple build bustages. CLOSED TREE
Backed out changeset bef547b588ff (bug 1722484)
Backed out changeset e676fa1a0cb7 (bug 1722484)
2021-11-09 01:42:20 +02:00
Ting-Yu Lin
7310c93473 Bug 1722484 Part 2 - Replace LineBreaker::Next() and WordBreaker::Next() with the new iterators. r=m_kato
With the rewrite, we reduce the dependency of lwbrk LineBreaker::Next(),
WordBreaker::Next(), and their `int32_t` sentinel values
NS_LINEBREAKER_NEED_MORE_TEXT and NS_WORDBREAKER_NEED_MORE_TEXT.

Differential Revision: https://phabricator.services.mozilla.com/D130392
2021-11-08 22:24:19 +00:00
Masayuki Nakano
f3ce4ebc2d Bug 1739524 - part 2: Make RangeUpdater::SelAdjSplitNode() handle both cases that right/left node is a new node r=m_kato
Currently, it assumes that `aLeftNode` is new node and the other is the original
one.  However, we need the opposite case when we fix bug 1735608.

Unfortunately, we cannot test the new path until we fix bug 1735608.  Therefore,
the new path may contain some bugs.

Differential Revision: https://phabricator.services.mozilla.com/D130427
2021-11-08 09:49:33 +00:00
Masayuki Nakano
b4cbc8db19 Bug 1739524 - part 1: Make RangeUpdater::SelAdjJoinNodes() handle both cases that right/left node is joined into the other r=m_kato
Currently, it assumes that all children or text data of `aRightContent` is
moved into `aLeftContent`.  However, we need the opposite case when we fix
bug 1735608.

Unfortunately, we cannot test the new path until we fix bug 1735608.  Therefore,
the new path may contain some bugs.

Differential Revision: https://phabricator.services.mozilla.com/D130426
2021-11-08 09:49:33 +00:00
ssummar
e519897f5a Bug 1738837 - Replaced usages of mozilla::Tuple with std::tuple in editor/ r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D130146
2021-11-06 13:25:27 +00:00
Masayuki Nakano
635539b0e5 Bug 1706266 - part 2: Disable some Gecko specific edit commands in release and beta channel, and all of them in nightly channel r=smaug
The telemetry result is written in bug 1706266 comment 1:
https://bugzilla.mozilla.org/show_bug.cgi?id=1706266#c1

`increasefontsize`, `decreasefontsize`, `gethtml`, `heading` and `readonly` are
obviously not used by web apps in the wild.  Therefore, they can be disabled
in all channels.

`contentReadOnly` and `insertBrOnReturn` are odd.  The usage is really low (less
than 1% of beta users).  However, the number of documents which used the command
is about 1k samples.  The result of the commands are not tiny (making the editor
not editable or changing the behavior at typing `Enter` key in `<div>`, `<p>`,
etc).  Therefore, it's hard to use them in web apps which supports not only
Gecko.  So I guess that they are collected the number of used by automated
tests of somebody because of the constant number in other beta versions.
Perhaps, we should disable it only in Nightly channel for now, and after a
couple of releases, we should try to disable those commands too later.

Depends on D130328

Differential Revision: https://phabricator.services.mozilla.com/D130329
2021-11-05 14:29:25 +00:00
Masayuki Nakano
524a98b4f2 Bug 1739526 - Move some trivial classes defined in EditorUtils.h but used only by HTMEditor or its helper classes to `HTMLEditHelpers.h" r=m_kato
I'd like to split utilities for all editors and only for `HTMLEditor`.

This moves some trivial classes into new `HTMLEditHelpers.h`.  Perhaps, it's
better if we can move them into `HTMLEditUtils.h`, but it has too many inline
method definitions so that adding new classes into it makes it much bigger.

Depends on D130349

Differential Revision: https://phabricator.services.mozilla.com/D130425
2021-11-05 14:10:49 +00:00
Masayuki Nakano
354375158b Bug 1739315 - part 2: Make HTMLEditor::JoinNodesWithTransaction() return error if failed r=m_kato
Now, it does not notify nobody before joining the nodes.  Therefore, it can
return error immediately if it fails to create a transaction to join the given
nodes.

Additionally, this patch makes it return `NS_ERROR_EDITOR_DESTROYED` if the
editor is destroyed while it handles to join nodes.  Therefore, we can get rid
of the check by the callers.

Differential Revision: https://phabricator.services.mozilla.com/D130349
2021-11-05 10:14:35 +00:00
Masayuki Nakano
94cfff6b9a Bug 1739315 - part 1: Make HTMLEditor::JoinNodesWithTransaction() directly notify TopLevelEditSubActionData::DidJoinNodes() of joined position r=m_kato
`TopLevelEditSubActionData::WillJoinNodes()` and
`TopLevelEditSubActionData::DidJoinNodes()` are called only by
`HTMLEditor::JoinNodesWithTransaction()`.  `WillJoinNodes()` assumes that
all children or text data in `aLeftContent` is moved to head of `aRightContent`.
Therefore, it just stores length of `aLeftContent` and `DidJoinNodes()` lets
`AddPointToChangedRange()` know the joined point.

Same value is stored by `HTMLEditor::JoinNodesWithTransaction()`.  Therefore,
it can create same DOM point at calling `DidJoinNodes()` so that we can get
rid of `WillJoinNodes()`.

Differential Revision: https://phabricator.services.mozilla.com/D130348
2021-11-05 10:14:35 +00:00
Cristian Tuns
bdf50d3542 Backed out 2 changesets (bug 1739315) for causing android wpt failures.
Backed out changeset cef70047defb (bug 1739315)
Backed out changeset c50c8ac11ff7 (bug 1739315)
2021-11-05 07:18:22 -04:00
Masayuki Nakano
f182946a8b Bug 1739315 - part 2: Make HTMLEditor::JoinNodesWithTransaction() return error if failed r=m_kato
Now, it does not notify nobody before joining the nodes.  Therefore, it can
return error immediately if it fails to create a transaction to join the given
nodes.

Additionally, this patch makes it return `NS_ERROR_EDITOR_DESTROYED` if the
editor is destroyed while it handles to join nodes.  Therefore, we can get rid
of the check by the callers.

Differential Revision: https://phabricator.services.mozilla.com/D130349
2021-11-05 10:14:35 +00:00
Masayuki Nakano
fdb27c99f9 Bug 1739315 - part 1: Make HTMLEditor::JoinNodesWithTransaction() directly notify TopLevelEditSubActionData::DidJoinNodes() of joined position r=m_kato
`TopLevelEditSubActionData::WillJoinNodes()` and
`TopLevelEditSubActionData::DidJoinNodes()` are called only by
`HTMLEditor::JoinNodesWithTransaction()`.  `WillJoinNodes()` assumes that
all children or text data in `aLeftContent` is moved to head of `aRightContent`.
Therefore, it just stores length of `aLeftContent` and `DidJoinNodes()` lets
`AddPointToChangedRange()` know the joined point.

Same value is stored by `HTMLEditor::JoinNodesWithTransaction()`.  Therefore,
it can create same DOM point at calling `DidJoinNodes()` so that we can get
rid of `WillJoinNodes()`.

Differential Revision: https://phabricator.services.mozilla.com/D130348
2021-11-05 10:14:35 +00:00
Dan Minor
ab5afa4f54 Bug 1736017 - Replace MozLocale with Locale in EditorSpellCheck.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129207
2021-11-04 16:36:03 +00:00
Masayuki Nakano
a04544da9e Bug 1737540 - Make AutoBlockElementsJoiner::PrepareToDeleteNonCollapsedRanges() consider to delete given range when there is no editable block parent r=m_kato
Currently, it assumes that first range is always in editable block parent,
but if the range is in an inline editing host, it's not true.

The given ranges should always be in same editing host at this time because of:
* https://searchfox.org/mozilla-central/rev/011ed92913b38e950977ab3fc56ae68a8f3bca12/editor/libeditor/HTMLEditorDeleteHandler.cpp#1031,1064
* https://searchfox.org/mozilla-central/rev/011ed92913b38e950977ab3fc56ae68a8f3bca12/editor/libeditor/HTMLEditorDeleteHandler.cpp#1080,1117

Therefore, it's enough to check whether the range crosses or not editing host
boundaries only with `MOZ_ASSERT(_IF)`.

Differential Revision: https://phabricator.services.mozilla.com/D130153
2021-11-04 08:05:02 +00:00
Masayuki Nakano
4341d6fb0c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve nsINode or its concrete classes from EventTarget r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Masayuki Nakano
73429d31ba Bug 1725850 - part 30: Port editor/libeditor/crashtests/716456-1.html to WPT r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D129586
2021-10-29 09:29:24 +00:00
Masayuki Nakano
053ad7574e Bug 1725850 - part 29: Port editor/libeditor/crashtests/713427-1.html to WPT r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D129585
2021-10-29 09:29:23 +00:00
Masayuki Nakano
6b5396e5e0 Bug 1725850 - part 28: Port editor/libeditor/crashtests/682650-1.html to WPT r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D129584
2021-10-29 09:29:23 +00:00
Masayuki Nakano
e6bafcbcd5 Bug 1725850 - part 27: Port editor/libeditor/crashtests/667321-1.html to WPT r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D129583
2021-10-29 09:29:23 +00:00
Masayuki Nakano
96028f5105 Bug 1725850 - part 26: Port editor/libeditor/crashtests/650572-1.html to WPT r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D129582
2021-10-29 09:29:22 +00:00
Masayuki Nakano
193c817a99 Bug 1725850 - part 25: Port editor/libeditor/crashtests/643706-1.html to WPT r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D129581
2021-10-29 09:29:22 +00:00
Noemi Erli
25dd04d4c5 Backed out 9 changesets (bug 1736017) for causing bustages in nsLineBreaker.cpp
Backed out changeset d7b7427bb29e (bug 1736017)
Backed out changeset 7249dec70600 (bug 1736017)
Backed out changeset f16572806b0c (bug 1736017)
Backed out changeset a78125c71b3e (bug 1736017)
Backed out changeset 84ba2cbd596a (bug 1736017)
Backed out changeset f771265e0930 (bug 1736017)
Backed out changeset c0cef271022d (bug 1736017)
Backed out changeset 19be73147fcc (bug 1736017)
Backed out changeset 11721cc861b0 (bug 1736017)
2021-10-28 00:06:35 +03:00
Dan Minor
726225fbfe Bug 1736017 - Replace MozLocale with Locale in EditorSpellCheck.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129207
2021-10-27 20:35:56 +00:00
Masayuki Nakano
65fc730a31 Bug 1737747 - Create automated tests for nsIHTMLEditor.insertElementAtSelection() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D129477
2021-10-26 22:03:51 +00:00
Ting-Yu Lin
c2f6ef7a09 Bug 1736938 Part 3 - Make all WordBreaker's methods static, and adapt the callers. r=jfkthame
The motivation is the same as the previous part.

Differential Revision: https://phabricator.services.mozilla.com/D129109
2021-10-25 19:00:22 +00:00
Ting-Yu Lin
427cc27771 Bug 1736938 Part 2 - Make all LineBreaker's methods static, and adapt the callers. r=jfkthame
LineBreaker has no member variables and acts like "namespaces" with
utility functions. Therefore, its methods can be static and called
directly without needing a LineBreaker instance.

Rename GetJISx4051Breaks() to ComputeBreakPositions() per review
feedbacks.

Differential Revision: https://phabricator.services.mozilla.com/D129107
2021-10-25 19:00:22 +00:00