Commit Graph

10106 Commits

Author SHA1 Message Date
Butkovits Atila
7a09391039 Backed out changeset 2e7e9d83e56b (bug 1655391) for bustage at HTMLEditor. CLOSED TREE 2020-08-03 14:54:27 +03:00
Masayuki Nakano
04fa88ff17 Bug 1655391 - Make new stack only class handle deletion at current block boundary r=m_kato
This patch creates new stack only class, `HTMLEditor::AutoBlockElementsJoiner`
and splits `HTMLEditor::HandleDeleteCollapsedSelectionAtCurrentBlockBoundary()`
to considering the content nodes to be joined part and doing join the nodes
part.

Differential Revision: https://phabricator.services.mozilla.com/D85567
2020-08-03 09:52:38 +00:00
Sonia Singla
34ac1b2de3 Bug 1656292 - Enable remaining ESLint rules on editor/libeditor/tests/*.xhtml files. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D85450
2020-07-31 23:58:46 +00:00
Masayuki Nakano
8147272ea7 Bug 1655706 - part 3-2: Move AutoTransactionsConserveSelection in HTMLEditor::TryToJoinBlocksWithTransaction() into each WhiteSpaceVisibilityKeeper method r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85534
2020-08-03 08:25:33 +00:00
Masayuki Nakano
92735646e3 Bug 1655706 - part 3-1: Move the last block of HTMLEditor::TryToJoinBlocksWithTransaction() into WhiteSpaceVisibilityKeeper r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85533
2020-08-03 08:25:31 +00:00
Masayuki Nakano
9ae8cf6836 Bug 1655706 - part 2-2: Move 2nd block of HTMLEditor::TryToJoinBlocksWithTransaction() into WhiteSpaceVisibilityKeeper r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85532
2020-08-03 08:24:14 +00:00
Masayuki Nakano
597a2135a9 Bug 1655706 - part 2-1: Make HTMLEditor::TryToJoinBlocksWithTransaction() stop using leftListElement and rightListElement after initializing newListElementTagNameOfRightListElement r=m_kato
`rightListElement` is not used, so, we can put it into smaller scope.

`leftListElement` is used for storing original `leftBlockElement` when
`newListElementTagNameOfRightListElement` is some.  Therefore, we can
stop using it with caching the original `leftBlockElement` before
maybe modified its value.

Differential Revision: https://phabricator.services.mozilla.com/D85531
2020-08-03 08:23:56 +00:00
Masayuki Nakano
3bc58929de Bug 1655706 - part 1-3: Get rid of WhiteSpaceVisibilityKeeper::PrepareToJoinNodes() r=m_kato
Now, the new method,
`WhiteSpaceVisibilityKeeper::MergeFirstLineOfRightBlockElementIntoLeftBlockElement()`
is the only user of the method so that we can get rid of it since it does enough
simple thing.

Differential Revision: https://phabricator.services.mozilla.com/D85530
2020-08-03 08:23:44 +00:00
Masayuki Nakano
c2315414ea Bug 1655706 - part 1-2: Move last part of HTMLEditor::TryToJoinBlocksWithTransaction() to WhiteSpaceVisibilityKeeper r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85529
2020-08-03 08:23:31 +00:00
Masayuki Nakano
f6bf4c09ab Bug 1655706 - part 1-1: Move HTMLEditor::GetInvisibleBRElementAt() to WSRunScanner r=m_kato
And the name is wrong.  It depends on `aPoint` whether the `<br>` element is
visible or invisible because it just scans preceding `<br>` element but
stop doing it when it meets a visible content.  Therefore, this patch renames
it to explain what it does.

Differential Revision: https://phabricator.services.mozilla.com/D85528
2020-08-03 08:23:13 +00:00
Sylvestre Ledru
843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +00:00
Andreas Farre
b13577d8e4 Bug 1613431 - Part 3: Handle synced setters return value. r=nika
Depends on D83646

Differential Revision: https://phabricator.services.mozilla.com/D83647
2020-07-31 13:37:13 +00:00
Nathan Froyd
e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis
a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd
bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Masayuki Nakano
d13c1f61c7 Bug 1655911 - Get rid of DidCreateNode(), DidInsertNode(), DidSplitNode() and DidDeleteSelection() of nsIEditActionListener because of unused r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D85266
2020-07-30 06:40:44 +00:00
Masayuki Nakano
1ca256c5ff Bug 1655651 - Fix end point comparison in EditorDOMRangeBase::Contains() r=m_kato
Fortunately, nobody uses this API yet.

Differential Revision: https://phabricator.services.mozilla.com/D85108
2020-07-30 03:47:40 +00:00
Masayuki Nakano
515b4fb502 Bug 1644313 - part 6: Make HTMLEditor::HandleDeleteAroundCollapsedSelection() cancel the deletion if caret position is not editable r=m_kato
The previous patch changed target of white-space normalization.  That caused
`editor/libeditor/tests/test_bug1425997.html` starting to failed with new
exception.  What happens in the test is, selection is collapsed into comment
node (I think that this behavior is also a bug though) after second
`document.execCommand("delete")`, and then, failed to delete anything
and throws the exception.  For fixing this issue, the most simple approach is
make `HTMLEditor::HandleDeleteAroundCollapsedSelection()` stop handling
deletion when caret position is not editable.  So, unfortunately, this
patch changes traditional path too.

Depends on D84948

Differential Revision: https://phabricator.services.mozilla.com/D84949
2020-07-29 17:20:01 +00:00
Masayuki Nakano
1248b55a7e Bug 1644313 - part 5: Make ExtendRangeToDeleteWithNormalizingWhiteSpaces() not normalize preceding white-spaces when deleting range all characters in first text node after start to delete r=m_kato
Blink normalizes preceding white-spaces of deleting range only when the range is
NOT remove last character or there are no following text nodes.  If removing
last character at first text node which is followed by another text node, Blink
normalize white-spaces at start of the following text node.

This behavior seems odd, but we should follow the Blink's behavior for better
compatibility.

Note that new test failures in
`white-spaces-after-execCommand-forwarddelete.tentative.html` is caused by
that forward deletion is handled by existing path instead of the new handler.
Therefore, it's no problem for now.

Additionally, this change causes a mochitest
(`editor/libeditor/tests/test_bug1425997.html`) and a crash test
(`editor/libeditor/crashtests/1424450.html`) becoming oranges since their
DOM tree becomes different after applying this patch.  The oranges will
be fixed by the following patches.

Depends on D84947

Differential Revision: https://phabricator.services.mozilla.com/D84948
2020-07-29 12:48:42 +00:00
Masayuki Nakano
dbb0ffdb8d Bug 1644313 - part 4: Make WSRunScanner::GetRangeInTextNodesTo*From() available with non-white-space characters r=m_kato
The difference between `HTMLEditor::HandleDeleteCollapsedSelectionAtTextNode()`
and `HTMLEditor::HandleDeleteCollapsedSelectionAtWhiteSpace()` is whether
it treats surrogate pair or not.  And it's easy to handle it in `WSRunScanner`.
Therefore, they can handle all deletion in a text node.

Some new failures are caused by that we normalize preceding white-spaces of
deletion range but Blink does not to it.  These failures will be fixed by
part 5.

Depends on D84946

Differential Revision: https://phabricator.services.mozilla.com/D84947
2020-07-29 22:13:46 +00:00
Masayuki Nakano
e8940879ba Bug 1644313 - part 3: Make HTMLEditor::HandleDeleteTextAroundCollapsedSelection() call HTMLEditor::DeleteTextAndNormalizeSurroundingWhiteSpaces() with TreatEmptyTextNodes::RemoveAllEmptyInlineAncestors r=m_kato
When it calls `DeleteTextAndNormalizeSurroundingWhiteSpaces()`, we need to
remove empty text nodes and newly empty inline ancestors.  Currently, empty
nodes are removed by `HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal()`:
https://searchfox.org/mozilla-central/rev/25d491b7924493b5d4bedc07841a1cd92f271100/editor/libeditor/HTMLEditSubActionHandler.cpp#510
But we should stop using this in this case for reducing transactions.

Depends on D84945

Differential Revision: https://phabricator.services.mozilla.com/D84946
2020-07-29 12:19:07 +00:00
Masayuki Nakano
8846a44f37 Bug 1644313 - part 2: Make HTMLEditor::DeleteTextAndTextNodeWithTransaction() remove empty text node or most distant empty inline ancestor optionally r=m_kato
For the following patches, it's nicer that the API has optional behavior which
removes new empty text node or empty parent elements because directly removing
parent element can reduce the number of transactions and avoid storing text
with `DeleteTextTransaction()`.

Depends on D84944

Differential Revision: https://phabricator.services.mozilla.com/D84945
2020-07-29 06:28:40 +00:00
Masayuki Nakano
a269bbe497 Bug 1644313 - part 1: Create new path to handle backspace or (forward) delete with the new normalizer r=m_kato
`InputEvent.getTargetRange()` should have actual delete range.  It means that
the range should contain the invisible leading/trailing white-spaces which
need to be removed for keep them invisible, but should not contain the range
of normalizing white-space sequence because they are not target of edit action
indicated by `InputEvent.inputType`.

So, we can use new path which uses the new white-space normalizer for
computing the value of `InputEvent.getTargetRanges()` because difference of
white-space normalizer shouldn't affect the deleting ranges (although, some
existing path calls `DeleteNodeIfInvisibleAndEditableTextNode()` later so that
the new method, `ComputeRangeInTextNodesContainingInvisibleWhiteSpaces()`, does
not exactly same thing, but the result shouldn't become different in usual
cases).  This new path can test with some WPTs under `editing/other`.

This patch creates new backspace/delete key handler when caret is at next
to a white-space as `HTMLEditor::HandleDeleteTextAroundCollapsedSelection()`
and creates helper methods of `WSRunScanner` to treat invisible leading and
trailing white-spaces.

Note that new failures are caused by the difference whether adjacent white-space
sequence at deletion is normalized or not in edge cases.  They will be fixed
by the part.5.

Depends on D84943

Differential Revision: https://phabricator.services.mozilla.com/D84944
2020-07-29 00:04:00 +00:00
tkhan
8e2aaafc76 Bug 1655424 - Add skip-if annotation for xorigin and fission timeout, r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D85030
2020-07-28 13:42:36 +00:00
Masayuki Nakano
0f69748e1a Bug 1653534 - part 5: Fix new intermittent orange of editor/libeditor/crashtests/1424450.html r=m_kato
With the previous patch, 2 bugs become visible.

One is a `MOZ_ASSERT` in
`WhiteSpaceVisibilityKeeper::MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()`
is wrong.  When `TextFragmentData::GetReplaceRangeDataAtEndOfDeletionRange()`
returns a replace range, it may set the start to inclusive next character of
end to delete.  So, start of replace range may start after end to delete when
container of end to delete is not a text node and its next editable char point
is an ASCII white-space.  Therefore, this patch rewrite it with
`MOZ_ASSERT_IF` and `EditorDOMPoint::IsInTextNode()`.

The other is `TextFragmentData::GetReplaceRangeDataAtEndOfDeletionRange()`
and `TextFragmentData::GetReplaceRangeDataAtStartOfDeletionRange()` may call
`TextFragmentData::GetFirstASCIIWhiteSpacePointCollapsedTo()` and
`TextFragmentData::GetEndOfCollapsibleASCIIWhiteSpaces()` with a point in
preformatted text node.  Therefore, this patch adds the check into them.

Depends on D84323

Differential Revision: https://phabricator.services.mozilla.com/D84943
2020-07-27 15:20:31 +00:00
Masayuki Nakano
1665d4bfb2 Bug 1653534 - part 4: Make TextFragmentData set its mIsPreformatted more carefully r=m_kato
Traditionally, `WSRunScanner` (and formerly `WSRunObject`) treats all text
nodes in its range when scan start container node has preformatted style.
This means that when starting start from start or end of preformatted text node
or inline element, it treats adjacent white-spaces which is not preformatted
as preformatted.

This patch fixes this issue.  Because of the fix of preceding patches,
`BoundaryData` stops scanning if it meets preformatted text node.  So,
`BoundaryData` can store whether the scanners found a preformatted character.
Therefore, if one of `BoundaryData`s is marked as "preformatted", it means
the range contains a preformatted character.  And keep referring the style
of scan start point if there is no visible text nodes around it.

Note that the above change causes new failures with `<listing>` element which
should be treated as `<pre>` element, but `HTMLEditUtils` treats it as
non-container inline element.
https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:listing

Therefore, this patch changes the definition of `<listing>` element and
`<xmp>` element which is also mentioned in the above link to container
element etc.  `<listing>` element is treated exactly same as `<pre>`,
therefore, the new definition is same as `<pre>`, but `<xmp>` does not
allow any tags after opens it (i.e., even if its close tag).  Therefore,
`<xmp>` definition is different from `<listing>` and `<pre>` elements'
definition.

Differential Revision: https://phabricator.services.mozilla.com/D84323
2020-07-27 23:58:04 +00:00
Masayuki Nakano
d389880eab Bug 1653534 - part 3: Make TextFragmentData::InvisibleLeadingWhiteSpaceRangeRef() and TextFragmentData::InvisibleTrailingWhiteSpaceRangeRef() stop checking whether scanning start point is preformatted or not r=m_kato
The check does not make sense because `TextFragmentData`'s range may contain
multiple text nodes which may have different style.

With the previous patch, the range won't cross characters in preformatted
text nodes.  Therefore, their result won't contain preformatted characters
right now.  So, we can just drop the unnecessary check from them.

Differential Revision: https://phabricator.services.mozilla.com/D84320
2020-07-27 07:46:22 +00:00
Masayuki Nakano
7c120ffd68 Bug 1653534 - part 2: Add text node style check in WSRunObject.cpp r=m_kato
Simply, if a white-space is in a preformatted text node, we shouldn't modify
it for normalizing.  This patch adds such checks to various points in
`WSRunObject.cpp`.

Differential Revision: https://phabricator.services.mozilla.com/D84319
2020-07-27 07:44:26 +00:00
Masayuki Nakano
1738b19f28 Bug 1653534 - part 1: Make TextFragmentData treat only collapsible white-spaces as its non-collapsed range r=m_kato
Currently, `TextFragmentData` stores whether the scan start point is
preformatted or not.  However, it does not make sense because the class
may contain other text nodes which may have different style in its range.
The main job of `TextFragmentData` is managing white-spaces as visible
sequence or invisible sequence.  So, preformatted white-space should be
treated as visible character because of not collapsible with adjacent
formatted ASCII white-spaces.

First of all, this patch its initializer stop scanning white-spaces if
it meets non-empty preformatted text node.

Note that the new failures are caused by the difference whether which
white-space sequence should be normalized when modifying text at text node
or inline element boundary.  This difference should be fixed in another
bug because our new normalizer does not handle this same as Blink for now.

Differential Revision: https://phabricator.services.mozilla.com/D84317
2020-07-27 05:56:38 +00:00
tkhan
e67129e6ad Bug 1655017 - Update xorigin and fission mochitest annotations, r=intermittent-reviewers,gbrown
Differential Revision: https://phabricator.services.mozilla.com/D84860
2020-07-27 01:16:21 +00:00
tkhan
e778811453 Bug 1653400 - Add xorigin and fission annotations, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D84006
2020-07-23 18:05:05 +00:00
Emilio Cobos Álvarez
ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Kashav Madan
ae956c4eef Bug 1653674 - Unskip passing fission tests, r=kmag
It's possible that some of these are still failing intermittently. We can't
really know without first unskipping them.

https://github.com/annygakh/audit-tests

Differential Revision: https://phabricator.services.mozilla.com/D84017
2020-07-21 15:42:48 +00:00
Masayuki Nakano
34c574b18a Bug 1653485 - part 3: Rename WSRunScanner::TextFragmentDataAtStart() to WSRunScanner::TextFragmentDataAtStartRef() r=m_kato
Depends on D83920

Differential Revision: https://phabricator.services.mozilla.com/D83921
2020-07-20 09:56:24 +00:00
Masayuki Nakano
143dc7787e Bug 1653485 - part 2: Change each lvalue which is initialized with result of *Ref() methods in WSRunObject.cpp to const Foo& r=m_kato
Depends on D83919

Differential Revision: https://phabricator.services.mozilla.com/D83920
2020-07-20 09:41:35 +00:00
Masayuki Nakano
63f1a6f5a8 Bug 1653485 - part 1: Make TextFragmentData::GetInvisibleLeadingWhiteSpaceRange() and TextFragmentData::GetInvisibleTrailingWhiteSpaceRange() return const-reference r=m_kato
They return copy of cached `EditorDOMRange` instance.  So, they can return
const-reference rather than copy of stored data.

Differential Revision: https://phabricator.services.mozilla.com/D83919
2020-07-20 09:39:00 +00:00
Mirko Brodesser
2c374acd88 Bug 1649121: part 45) Rename FindTargetNodeOfContextForPastedHTML. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D83783
2020-07-17 08:44:38 +00:00
Mirko Brodesser
76c391b27f Bug 1649121: part 44) Factor PreProcessContextDocumentFragmentForMerging out. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D83661
2020-07-17 08:44:36 +00:00
Mirko Brodesser
d8b92c4ea0 Bug 1649121: part 43) Factor PostProcessFragmentForPastedHTMLWithoutContext out. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D83660
2020-07-17 08:44:33 +00:00
Mirko Brodesser
434ad21fa9 Bug 1649121: part 42) Factor MergeAndPostProcessFragmentsForPastedHTMLAndContext out. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D83659
2020-07-17 08:44:31 +00:00
Mirko Brodesser
2edf97ca16 Bug 1649121: part 41) Add local variable for pasted HTML document fragment. r=masayuki
It's clearer and allows setting the output fragment at the end of the
method.

Differential Revision: https://phabricator.services.mozilla.com/D83658
2020-07-17 08:44:28 +00:00
Masayuki Nakano
f97dcee20c Bug 1651874 - part 10: Move GetReplaceRangeDataAtEndOfDeletionRange() and GetReplaceRangeDataAtStartOfDeletionRange() to TextFragmentData r=m_kato
With this patch, the creation cost of `TextFragmentData` is minimized, but
`MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()` can work
with the latest DOM tree information at touching start of the deleting range
even after touching end of the range.

Depends on D83228

Differential Revision: https://phabricator.services.mozilla.com/D83229
2020-07-16 16:41:00 +00:00
Masayuki Nakano
58cf70f8ca Bug 1651874 - part 9: Make MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange() correct delete range when it modifies the DOM tree at end of deleting range r=m_kato
This is what the original method should've done.  Mutation event listeners may
change the DOM tree at the first modification, but it hasn't checked whether
the range to delete or replace around start of deleting range is still valid
or not.

Depends on D83226

Differential Revision: https://phabricator.services.mozilla.com/D83228
2020-07-16 13:40:36 +00:00
Masayuki Nakano
35e5829194 Bug 1651874 - part 8: Make helper methods of MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange() return replace or delete data r=m_kato
For representing delete or replace data which have the range and replace string,
this patch creates `ReplaceRangeDataBase` class which is stack-only, has
`EditorDOMRange` or `EditorDOMRangeInTexts` as the range and has replace string
which can be empty string.

Then, `MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()` should
modify the DOM tree by itself.  With the following patch, the behavior is
corrected for multiple DOM tree changes.

Depends on D83224

Differential Revision: https://phabricator.services.mozilla.com/D83226
2020-07-16 12:24:21 +00:00
Masayuki Nakano
5cd974a324 Bug 1651874 - part 7: Rename ReplaceASCIIWhiteSpacesWithOneNBSP() to ReplaceTextAndRemoveEmptyTextNodes() r=m_kato
Depends on D83223

Differential Revision: https://phabricator.services.mozilla.com/D83224
2020-07-16 05:54:41 +00:00
Masayuki Nakano
2d02a70bfb Bug 1651874 - part 6: Make the last blocks of MakeSureToKeepVisibleStateOfWhiteSpacesAtEndOfDeletingRange() and MakeSureToKeepVisibleStateOfWhiteSpacesAtStartOfDeletingRange() use early-return style r=m_kato
Depends on D83221

Differential Revision: https://phabricator.services.mozilla.com/D83223
2020-07-16 03:41:00 +00:00
Masayuki Nakano
111b0ccc2e Bug 1651874 - part 5: Make MakeSureToKeepVisibleStateOfWhiteSpacesAtEndOfDeletingRange() and MakeSureToKeepVisibleStateOfWhiteSpacesAtStartOfDeletingRange() stop collecting all data first r=m_kato
Depends on D83220

Differential Revision: https://phabricator.services.mozilla.com/D83221
2020-07-16 03:40:23 +00:00
Masayuki Nakano
b48a53e99f Bug 1651874 - part 4: Get rid of check of out of range in MakeSureToKeepVisibleStateOfWhiteSpacesAtEndOfDeletingRange() and MakeSureToKeepVisibleStateOfWhiteSpacesAtStartOfDeletingRange() r=m_kato
Depends on D83219

Differential Revision: https://phabricator.services.mozilla.com/D83220
2020-07-16 02:12:26 +00:00
Masayuki Nakano
affa364e8c Bug 1651874 - part 3: Remove unnecessary variables in MakeSureToKeepVisibleStateOfWhiteSpacesAtEndOfDeletingRange() and MakeSureToKeepVisibleStateOfWhiteSpacesAtStartOfDeletingRange() r=m_kato
Depends on D83218

Differential Revision: https://phabricator.services.mozilla.com/D83219
2020-07-15 15:05:37 +00:00
Masayuki Nakano
f0994f25cd Bug 1651874 - part 2: Get rid of unnecessary blocks in MakeSureToKeepVisibleStateOfWhiteSpacesAtEndOfDeletingRange() and MakeSureToKeepVisibleStateOfWhiteSpacesAtStartOfDeletingRange() r=m_kato
Depends on D83217

Differential Revision: https://phabricator.services.mozilla.com/D83218
2020-07-15 15:05:12 +00:00