Граф коммитов

11233 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 656bb3ee88 Bug 1792387 - part 1: Make `HTMLEditor` join/split node direction switchable by a pref r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D158097
2022-09-30 22:20:19 +00:00
Andrew McCreight 2da84b8ac4 Bug 1792574, part 3 - Don't include nsMemory where it isn't needed. r=xpcom-reviewers,necko-reviewers,valentin,nika
There are only 3 places where nsMemory.h is still needed (image/RasterImage.cpp,
gfx/thebes/gfxFT2FontList.cpp, and nsMemory.cpp). Remove the rest.

Differential Revision: https://phabricator.services.mozilla.com/D158213
2022-09-28 15:17:46 +00:00
Masayuki Nakano bd1059c951 Bug 1791501 - Use `EditActionResult` as ok type of `mozilla::Result` r=m_kato
Any callers do not refer "ignored", "handled" and "cancel" state without
checking whether the method returns error or not.  Therefore, error state
can be (and should be) managed by `mozilla::Result`'s error state.

Perhaps, it should store a caret position later because deletion handlers
of `HTMLEditor` use it, but update `Selection` immediately.

Differential Revision: https://phabricator.services.mozilla.com/D158080
2022-09-28 07:21:37 +00:00
Masayuki Nakano b6c97f3d73 Bug 1791224 - Use `CreateNodeResultBase` as the ok type of `mozilla::Result` r=m_kato
Similar to the previous patch, this changes a lot of lines.  However, I think
that it's not so hard to investigate regression point in this patch because
`CreateNodeResultBase` is not used so many times at handling on edit action.

Differential Revision: https://phabricator.services.mozilla.com/D157575
2022-09-28 04:00:19 +00:00
Butkovits Atila 79b03a7594 Backed out changeset 865c5d292958 (bug 1791224) for causing build bustages at Result.h. CLOSED TREE 2022-09-27 11:55:04 +03:00
Masayuki Nakano 6513faf43f Bug 1791224 - Use `CreateNodeResultBase` as the ok type of `mozilla::Result` r=m_kato
Similar to the previous patch, this changes a lot of lines.  However, I think
that it's not so hard to investigate regression point in this patch because
`CreateNodeResultBase` is not used so many times at handling on edit action.

Differential Revision: https://phabricator.services.mozilla.com/D157575
2022-09-27 05:12:05 +00:00
Masayuki Nakano 69d7bf65c8 Bug 1791223 - Use `MoveNodeResult` as the ok type of `mozilla::Result` r=m_kato
Unfortunately, it's hard to split this (and similar) patch because we need to
touch `MoveNodeResult` itself for making it available as the ok type of
`Result`.  However, I guess that it's not so hard to investigate regression
point if something would be found later because `MoveNodeResult` is mainly
used by deletion which is the most complicated part of `HTMLEditor`, but
`MoveNodeResult` is used only in a few cases.

Differential Revision: https://phabricator.services.mozilla.com/D157574
2022-09-26 00:56:46 +00:00
Masayuki Nakano c82ba52224 Bug 1782911 - part 10: Make `HTMLEditor::MoveOneHardLineContentsWithTransaction` delete trailing linefeed if it becomes not preformatted r=m_kato
This is a hack for compatibility with the other browsers.  When we move first
line of `<pre>` to left paragraph whose `white-space` style does not make it
preformatted, they drop the last linefeed because of unnecessary.

Differential Revision: https://phabricator.services.mozilla.com/D157419
2022-09-25 12:49:47 +00:00
Masayuki Nakano c78e3e6bcd Bug 1782911 - part 9: Make `WhiteSpaceVisibilityKeeper::MergeFirstLineOfRightBlockElementIntoAncestorLeftBlockElement` stop creating empty nodes r=m_kato
It splits inline elements at the destination of first line in the right block.
However, it typically creates empty inline elements before the right block and
may be never used because it sets the insertion point to before the right node
of the splitting.

Therefore, it should stop creates empty inline elements (if they are required,
they should be created in `HTMLEditor::MoveNodeOrChildrenWithTransaction`
instead) and adjust split point after the element if it didn't split any nodes.

Differential Revision: https://phabricator.services.mozilla.com/D157418
2022-09-25 12:49:46 +00:00
Masayuki Nakano 351819c1cc Bug 1782911 - part 8: Make `HTMLEditor::MoveOneHardLineContentsWithTransaction` clean up line break before right block if its first line is moved there r=m_kato
When the first line of right block element is moved before the block element,
unnecessary line break may be moved to immediately before the right block
element.  In the case, it needs to clean it up instead of trying to find
unnecessary line break at end of the left block which is a container of the
right block element.

Differential Revision: https://phabricator.services.mozilla.com/D157417
2022-09-25 12:49:46 +00:00
Masayuki Nakano 4854c49121 Bug 1782911 - part 7: Make `HTMLEditor::MoveOneHardLineContentsWithTransaction` stop moving empty inline nodes r=m_kato
Empty inline nodes except non-container nodes are not required in the
destination paragraph.  Therefore, it should just remove the node from the
DOM tree.

Differential Revision: https://phabricator.services.mozilla.com/D157416
2022-09-25 12:49:45 +00:00
Masayuki Nakano 94fbe6ab47 Bug 1782911 - part 6: Make `HTMLEditor::MoveOneHardLineContentsWithTransaction` delete new empty inline parents if deleting unnecessary line break creates them r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D157415
2022-09-25 12:49:45 +00:00
Masayuki Nakano a7c1b47e8b Bug 1782911 - part 5: Make `HTMLEditor::AutoBlockElementsJoiner` scan previous (or next) paragraph with ignoring invisible data nodes r=m_kato
We don't ignore invisible data node at joining 2 paragraphs and this is
a different behavior from the other browsers.  When looking for a content
from current block boundary, `AutoBlockElementsJoiner` should keep scanning
visible things with ignoring invisible data nodes.  Then, it should delete
all invisible things after joining the paragraphs.

Differential Revision: https://phabricator.services.mozilla.com/D157414
2022-09-25 12:49:44 +00:00
Masayuki Nakano 7e788541b1 Bug 1782911 - part 4: Make `HTMLEditor::MoveNodeOrChildrenWithTransaction` preserve `white-space` style at moving different style node r=m_kato
Chrome and Safari preserve `white-space` with `style` attribute to keep
collapsible or preserved white-spaces as-is.  If an HTML element is moved,
`style` attribute should be set to it.  Otherwise, create `<span>` element
whose `style` attribute has the declaration for `white-space` and move
content into it.

Differential Revision: https://phabricator.services.mozilla.com/D157413
2022-09-25 12:49:44 +00:00
Masayuki Nakano bb2a35d9d7 Bug 1782911 - part 3: Make `HTMLEditor` always move first line of right block only when the blocks have different `white-space` style r=m_kato
Gecko just joins 2 blocks when editable block parents are same element, e.g.,
both are `<div>`.  However, Chrome and Safari moves only first line of the
right block into the left block, and Gecko does it when both blocks are
different elements.

Ideally, we should take same behavior as Chrome and Safari because it's
reasonable for both compatibility with the other browsers and consistency
when both blocks are different but has same style, then we don't need to
maintain different behavior paths.

However, doing it for all elements are too risky because right block will be
merged into left block if right block has no line break.  On the other hand,
without doing it, preserving `white-space` is really hard because we need to
maintain the both paths.

Therefore, I'd like to change the behavior only when both blocks have different
`white-space` styles.  Usually, web apps do not change `white-space` for each
block, so I think that this is safer than doing this in all elements,
additionally, we can revert the behavior easy since this patch is really small.

Differential Revision: https://phabricator.services.mozilla.com/D157412
2022-09-25 12:49:43 +00:00
Masayuki Nakano d1b5e4a973 Bug 1782911 - part 2: Clean up unnecessary line break at block boundary while moving first line of right paragraph to left paragraph r=m_kato
This fixes bug 503838 partially.  The new utility method scans unnecessary
`<br>` with strict check as far as possible.  Then, we can delete the node or
the preformatted line break at end of the last text node.

Differential Revision: https://phabricator.services.mozilla.com/D157411
2022-09-25 12:49:43 +00:00
Masayuki Nakano 222a330cb6 Bug 1782911 - part 1: Port most tests of test_bug772796.html to WPT r=m_kato
This patch ports most part of `editor/libeditor/tests/test_bug772796.html` to
WPT because this kind of behaviors are not tested by `editing/run/delete.html`
nor `editing/run/forwarddelete.html`. (Not ported tests are invalid HTML
structure cases and list item cases, the reason why not doing this for the
latter is, it needs a lot of cases and not important for most web apps.)

The most expectations are based on Chrome and Safari (they both behave almost
same), but they fail a lot in `join-pre-and-other-block.html` and
`white-space: pre-line` cases in the other tests.

Even though this ports a lot of cases, for making easier to compare the
behavior change in the following patches, we should keep the tests.

Differential Revision: https://phabricator.services.mozilla.com/D157410
2022-09-25 12:49:42 +00:00
Masayuki Nakano c2cfa6c82a Bug 1791136 - Make `HTMLEditor::FormatBlockContainerWithTransaction` return error state correctly r=m_kato
The line never runs in automated tests, and
`RemoveBlockContainerElementsWithTransaction` does not check whether the DOM
tree gets as expected or not.  Therefore, I have no idea how to test this.

Differential Revision: https://phabricator.services.mozilla.com/D157573
2022-09-22 22:14:35 +00:00
Andreea Pavel c538244252 Bug 1777060 - disable test_caret_move_in_vertical_content.html on android debug r=intermittent-reviewers,MasterWayZ DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D157917
2022-09-22 11:38:35 +00:00
Masayuki Nakano fc89971ea6 Bug 1789967 - part 4: Make `HTMLEditor::SelectAllInternal` work without selection range r=m_kato
It may be called even when there is no selection range and focused element.
However, it assumes that there is a selection range, and an editable element
has focus.  Therefore, now, if there is an editing host and user tries to
do "Select All" without clicking somewhere before doing it, "Select All" does
nothing.

Differential Revision: https://phabricator.services.mozilla.com/D157409
2022-09-22 06:27:38 +00:00
Masayuki Nakano a353ab7e90 Bug 1789967 - part 3: Make `HTMLEditor::CollapseSelectionToEndOfLastLeafNodeOfDocument` and `HTMLEditor::InitEditorContentAndSelection` do nothing if the document is partially editable r=m_kato
They and their callees work with the result of `GetRoot()` which is the document
element or the body element.  If the body is not editable, `Selection` should
not be updated in non-editable region nor `<br>` elements should not be
inserted in both non-focused editable elements and non-editable elements.
Therefore, they should run only when the document element or the `<body>`
element is editable.

To keep testing crashtests as reported, this patch makes tests which have
`contenteditable` except `<html>` and `<body>` initialize `Selection` as
what we've done.  And clean up the tests for helping to port them to WPT
in the future (bug 1725850).

Differential Revision: https://phabricator.services.mozilla.com/D157408
2022-09-22 06:27:37 +00:00
Masayuki Nakano 2f0ed118ae Bug 1789967 - part 2: Make `TextEditor` and `HTMLEditor` implement `EditorBase::CollapseSelectionToEndOfLastLeafNode` by themselves r=m_kato
It does different thing for `TextEditor` and `HTMLEditor`, and used almost
internally.  Therefore, it should be implemented in the sub classes and
we should name them better.

Differential Revision: https://phabricator.services.mozilla.com/D157407
2022-09-22 06:17:36 +00:00
Masayuki Nakano f1dd8bf3b5 Bug 1789967 - part 1: Make `TextEditor` and `HTMLEditor` implement `EditorBase::InitEditorContentAndSelection` by themselves r=m_kato
The method is enough simple, and uses bad cast from point of view of OOP.
Therefore, this patch make the sub classes implement the method only for each.

Differential Revision: https://phabricator.services.mozilla.com/D157406
2022-09-22 06:06:54 +00:00
Jan-Niklas Jaeschke 4265f72859 Bug 1777925: Replaced MutationObserver array container type with linked list. r=smaug
Deletion of mutation observers from a list resulted in O(n^2) behavior and could lead to massive freezes.
This is resolved by using a LinkedList instead, reducing complexity to O(n).

A safely iterable doubly linked list was implemented based on `mozilla::DoublyLinkedList`,
allowing to insert and remove elements while iterating the list.

Due to the nature of `mozilla::DoublyLinkedList`, every Mutation Observer now inherits `mozilla::DoublyLinkedListElement<T>`.
This implies that a Mutation Observer can only be part of one DoublyLinkedList.
This conflicts with some Mutation Observers, which are being added to multiple `nsINode`s.
To continue supporting this, new MutationObserver base classes `nsMultiMutationObserver` and `nsStubMultiMutationObserver` are introduced,
which create `MutationObserverWrapper` objects each time they are added to a `nsINode`.
The wrapper objects forward every call to the actual observer.

Differential Revision: https://phabricator.services.mozilla.com/D157031
2022-09-21 11:31:44 +00:00
Iulian Moraru 6af4d42518 Backed out changeset 555d2ca16477 (bug 1789967) as per dev request. CLOSED TREE 2022-09-21 06:48:30 +03:00
Masayuki Nakano f3ce7840c7 Bug 1789967 - part 1: Make `TextEditor` and `HTMLEditor` implement `EditorBase::InitEditorContentAndSelection` by themselves r=m_kato CLOSED TREE
The method is enough simple, and uses bad cast from point of view of OOP.
Therefore, this patch make the sub classes implement the method only for each.

Differential Revision: https://phabricator.services.mozilla.com/D157406
2022-09-21 00:20:26 +00:00
Iulian Moraru 52da19beca Backed out 2 changesets (bug 1789967) for causing wd failures on content_editable.py. CLOSED TREE
Backed out changeset f2f431ee78a3 (bug 1789967)
Backed out changeset edac234f1eba (bug 1789967)
2022-09-21 04:40:46 +03:00
Masayuki Nakano 7f5b2e7242 Bug 1789967 - part 2: Make `TextEditor` and `HTMLEditor` implement `EditorBase::CollapseSelectionToEndOfLastLeafNode` by themselves r=m_kato
It does different thing for `TextEditor` and `HTMLEditor`, and used almost
internally.  Therefore, it should be implemented in the sub classes and
we should name them better.

Differential Revision: https://phabricator.services.mozilla.com/D157407
2022-09-21 00:38:23 +00:00
Masayuki Nakano 7f5a748878 Bug 1789967 - part 1: Make `TextEditor` and `HTMLEditor` implement `EditorBase::InitEditorContentAndSelection` by themselves r=m_kato
The method is enough simple, and uses bad cast from point of view of OOP.
Therefore, this patch make the sub classes implement the method only for each.

Differential Revision: https://phabricator.services.mozilla.com/D157406
2022-09-21 00:20:26 +00:00
Masayuki Nakano 5a7f7ccb64 Bug 1788840 - Make `HTMLEditor::HandleCSSIndentAroundRanges` stop referring moved `EditorDOMPoint` r=m_kato
Unfortunately, the result is really different from the other browsers.
E.g., when `execCommand("indent")` at `<div>abc<br>{}<br></div>`, Gecko inserts
a `<div>` and set its `margin-left`.  However, Chrome splits parent `<div>`
element and wrap the `<div>` which contains the caret in new `<blockquote>`.
Therefore, this does not contain new WPT.

Depends on D157404

Differential Revision: https://phabricator.services.mozilla.com/D157405
2022-09-16 02:09:16 +00:00
Nika Layzell 0316dc51b9 Bug 1790614 - Part 2: Use {ASSERT,ENSURE}_NS_{SUCCEEEDED,FAILED} in gtests, r=ahal,necko-reviewers
These macros will produce better outputs when they fail than these existing
patterns using `ENSURE_TRUE(NS_SUCCEEDED(...))` or similar, so this is a bulk
rewrite of existing tests to use them.

It should also help with discoverability when people base their tests off of
other existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D157214
2022-09-15 14:51:50 +00:00
Magnus Melin a4024058a5 Bug 1790725 - Allow useCss for mail editor. r=masayuki
After this change, it's possible to set the pref, or use editor.document.execCommand("styleWithCSS", false, "true") to enable css in mail compose.

Differential Revision: https://phabricator.services.mozilla.com/D157276
2022-09-14 10:27:39 +00:00
Masayuki Nakano b6c7be1c68 Bug 1789344 - Make `SelectionState::DidMoveNode` track DOM points having pointed the moved content correctly r=m_kato
When selection is `abc<b>[def</b>]ghi`, `insertParagraph` command will delete
the `<b>` element first, then, `Selection` becomes `abc{}ghi`.  Then,
`HTMLEditor::InsertParagraphSeparatorAsSubAction` wraps all of the line in
the default paragraph, `<div>`, with
`HTMLEditor::FormatBlockContainerWithTransaction` (although this is incompatible
behavior with the other browsers).  At this time, new `<div>` is inserted before
the first text node and then, move the text nodes into the new `<div>`.

However, `RangeUpdater::DidMoveNode` just slides the offsets if containers of
registered DOM points are the ex-parent of the moving nodes.  Therefore, the
tracked selection range in `HTMLEditor::FormatBlockContainerWithTransaction`
become `<div></div>abc{}def`, then, `<div>abcdef</div>{}`, but the expected
behavior is of course, `<div>abc{}def</div>`, then, split the new `<div>`.

So the problem is, `DidMoveNode` assumes that DOM points won't point the moving
content node.  If the node is pointed, it should keep pointing in the new
parent.

Note that the expectations of new tests are based on Chrome, therefore, the
new known failures are incompatible with Chrome.

Differential Revision: https://phabricator.services.mozilla.com/D156798
2022-09-12 23:53:37 +00:00
Masayuki Nakano 2d65dbd85c Bug 1789345 - Make `editor/libeditor/test_bug1318312.html` easier to read r=m_kato
It's hard to know how some tests failed in test_bug1318312.html.  Therefore,
this patch makes the selection range comparison easier to read, and add
description to explain what was doing at the failure.

Differential Revision: https://phabricator.services.mozilla.com/D156526
2022-09-07 01:06:47 +00:00
Ting-Yu Lin 527e28018e Bug 1779846 - Remove an unneeded if-statement in TextServicesDocument::OffsetEntryArray::FindWordRange(). r=masayuki
This patch fixed a regression caused by Bug 1730084 Part 4
https://phabricator.services.mozilla.com/D125434, which is intended to preserve
the behavior of `WordBreaker::FindWord()`.

Before Bug 1730084 Part 4, `WordBreaker::FindWord()` returns
`[aTextLen + 1, aTextLen + 1]` only when `aOffset > aTextLen`.
But `WordBreaker::FindWord()` had an assertion `aOffset <= aTextLen`
to guarantee the caller never passes `aOffset > aTextLen`. Thus, we can never
go into the `if (res.mBegin > strLen)` in
`TextServicesDocument::OffsetEntryArray::FindWordRange()`.

However, Bug 1730084 Part 4 wrongly changes the if-statement to
`if (range.mEnd == range.mBegin)`, and makes it reachable when
`TextServicesDocument::OffsetEntryArray::FindWordRange()` passes
`aPos == aLen` into `WordBreaker::FindWord()`. This makes `InitSpellChecker()`
failed when `enableSelectionChecking=true`.

This patch deletes the originally unreachable error handling if-statement, and
adds an assertion to guarantee `strOffset` and `strLen` is valid.

Differential Revision: https://phabricator.services.mozilla.com/D156210
2022-09-02 18:52:36 +00:00
Makoto Kato fa04356be7 Bug 1787680 - Part 2. Don't create CSSEditUtils instance. r=masayuki
We can change all methods in `CSSEditUtils` to static method if we add
`HTMLEditor` parameter.

Differential Revision: https://phabricator.services.mozilla.com/D155976
2022-09-01 04:33:36 +00:00
Makoto Kato 4d903283b4 Bug 1787680 - Part 1. Move mIsCSSPrefChecked to HTMLEditor. r=masayuki
`CSSEditUtils::IsCSSPrefChecked` is used in HTMLEditor only, so we can move
`mIsCSSPrefChecked` to HTMLEditor.

Differential Revision: https://phabricator.services.mozilla.com/D155975
2022-09-01 04:33:36 +00:00
Mark Banner 4f95e6b415 Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for editor. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D155169
2022-08-26 13:39:36 +00:00
Masayuki Nakano 64fe7ed79d Bug 1784192 - part 10: Make `PendingStyles::GetTypeInState()` return an `enum class` instead of taking 2 bool out parameters r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D155319
2022-08-26 03:31:26 +00:00
Masayuki Nakano 8bbdf5e967 Bug 1784192 - part 9: Rename `TypeInState` to `PendingStyles` r=m_kato
Additionally,
* `PropItem` -> `PendingStyle`
* `StyleCache` -> `PendingStyleCache`
* `AutoStyleCacheArray` -> `AutoPendingStyleCacheArray`

And finally, `PendingStyle` (formally `PropItem`) is changed to `class` and
its members are encapsuled.

Differential Revision: https://phabricator.services.mozilla.com/D155318
2022-08-26 03:31:26 +00:00
Masayuki Nakano ef559e105f Bug 1784192 - part 8: Make scanner methods of `TypeInState` return `Maybe<size_t>` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D155317
2022-08-26 03:25:19 +00:00
Masayuki Nakano bfb3d1f8c6 Bug 1784192 - part 7: Rename `TypeInState::ClearProp` and related methods r=m_kato
For consistency with the previous patch, we should rename them too.  Then, we're
getting rid of unclear word "Prop" from the public methods.

Differential Revision: https://phabricator.services.mozilla.com/D155316
2022-08-26 03:25:19 +00:00
Masayuki Nakano 165e90f341 Bug 1784192 - part 6: Rename `TypeInState::SetProp` and `TypeInState::TakeSetProperty` r=m_kato
I usually retry to understand what they mean.  Therefore, I'd like to give new
names for them (and rename `TypeInState` class in a following patch).

Differential Revision: https://phabricator.services.mozilla.com/D155315
2022-08-26 03:20:14 +00:00
Masayuki Nakano a94d4ffd46 Bug 1784192 - part 5: Make `TypeInState` manage `PropItem` instances with `UniquePtr` r=m_kato
It's ugly to manage them as raw pointer especially when deleting the instances.
We should make it use `UniquePtr`.

Differential Revision: https://phabricator.services.mozilla.com/D155314
2022-08-26 03:20:14 +00:00
Masayuki Nakano cf8abe2061 Bug 1784192 - part 4: Change `PropItem::mSpecifiedStyle` to a constant r=m_kato
Only the value member needs to be updated when setting the prop multiple times.
Therefore, we cannot change all members to constants.

Differential Revision: https://phabricator.services.mozilla.com/D155313
2022-08-26 03:10:32 +00:00
Masayuki Nakano 100af2494d Bug 1784192 - part 3: Change other members of `PropItem` r=m_kato
According to the debug, its value can be CSS property value if in the CSS mode.
For making the value meaning easier to understand, this renames it to
mAttributeValueOrCSSValue.

Differential Revision: https://phabricator.services.mozilla.com/D155312
2022-08-26 03:10:31 +00:00
Masayuki Nakano 491bc57b81 Bug 1784192 - part 2: Change `PropItem::attr` to a strong pointer r=m_kato
It's currently no problem to manage it with a raw pointer because it may be
set to a dynamic atom only when `nsIHTMLEditor.insertLinkAroundSelection` is
called with unknown attribute, but comm-central uses it only with `href`
attribute.

I think that we should change the API just to take `href` value in the future,
but for now, it should be `RefPtr<nsAtom>`.

Differential Revision: https://phabricator.services.mozilla.com/D155311
2022-08-26 03:10:31 +00:00
Masayuki Nakano 66c9f821f0 Bug 1784192 - part 1: Change `PropItem::tag` to `nsStaticAtom*` r=m_kato
It's always a pointer to `nsStaticAtom` instance or `nullptr`.  Therefore,
it can be `nsStaticAtom*` and we can make its users treat `nsStaticAtom`
instead of `nsAtom`.

Additionally, this patch changes some pointer parameters to references if
they are never `nullptr`.

Differential Revision: https://phabricator.services.mozilla.com/D155310
2022-08-26 03:10:30 +00:00
Masayuki Nakano 76c16ceefc Bug 1785801 - Make `RangeUpdater::SelAdjJoinNodes` take the ex-offset of right node r=m_kato
In bug 1739524, I misunderstood the meaning of `aOffset` of `SelAdjJoinNodes`.

After joining 2 nodes, and a point points right node which will have ex-left
node content, the point needs to point ex-start of the right node to keep
next insertion point as-is.  Therefore, it's not useful with new join nodes
direction, it needs to know the ex-offset of the right node.

Differential Revision: https://phabricator.services.mozilla.com/D155438
2022-08-26 01:50:07 +00:00
Masayuki Nakano 94b817dc98 Bug 1785311 - Make `EditorBase::InsertTextIntoTextNodeWithTransaction` update insertion point after executing the transaction r=m_kato
Before the fix of bug 1758420, `TextComposition`'s text node and offset in it
are updated at creating `CompositionTransaction`.  However, it's now put off
until getting the mutations.  Therefore, it always unsets `pointToInsert` at
first time of the composition and fails to notify the listeners.

This patch makes it retrieve the result after calling `DoTransactionInternal`
and handle the post processing with the new point.

Differential Revision: https://phabricator.services.mozilla.com/D155052
2022-08-22 23:56:36 +00:00
Daniel Holbert 4209467c50 Bug 1786210: Remove mentions of unused pref gfx.font_loader.interval. r=emilio
This patch doesn't impact behavior.

The pref "gfx.font_loader.interval" used to control certain aspects of
font-loading behavior, but that code has evolved and we no longer read the
value of this pref anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D155183
2022-08-21 23:45:56 +00:00
Masayuki Nakano ff67736d1c Bug 1781994 - part 12: Make `HTMLEditor::SetCSSBackgroundColorWithTransaction` use similar approach as `SetInlinePropertiesAsSubAction` etc r=m_kato
It's a Gecko specific feature, and it sets background color of parent block
elements of selection ranges.  This does similar things to
`SetInlinePropertiesAsSubAction`, but still refers `Selection` directly and
uses `AutoSelectionRestorer`.  For consistency between similar methods, this
patch makes it use `AutoRangeArray`.

Depends on D154353

Differential Revision: https://phabricator.services.mozilla.com/D154354
2022-08-16 01:17:46 +00:00
Masayuki Nakano 0f6bbf324c Bug 1781994 - part 11: Clean up `HTMLEditor::RelativeFontChange` r=m_kato
It should use `AutoRangeArray` to stop using `AutoSelectionRestorer`.

Depends on D154352

Differential Revision: https://phabricator.services.mozilla.com/D154353
2022-08-16 01:17:45 +00:00
Masayuki Nakano d1c4c5d8e2 Bug 1781994 - part 10: Make `HTMLEditor::RelativeFontChangeOnNode` and `HTMLEditor::RelativeFontChangeHelper` stop touching `Selection` directly r=m_kato
They are renamed to `SetFontSizeWithBigOrSmallElement` and
`SetFontSizeOfFontElementChildren`.

Depends on D154351

Differential Revision: https://phabricator.services.mozilla.com/D154352
2022-08-16 01:09:31 +00:00
Masayuki Nakano 3327432a6a Bug 1781994 - part 9: Make `HTMLEditor::RelativeFontChangeOnNode` and `HTMLEditor::RelativeFontChangeHelper` use `FontSize` r=m_kato
`HTMLEditor::RelativeFontChange()` and its helpers are based on
`SetInlinePropertiesAsSubAction()` and its helpers.  Therefore, they may have
similar problem to switch join/split direction.  Therefore, this and the
following patches clean them up too.

Depends on D154350

Differential Revision: https://phabricator.services.mozilla.com/D154351
2022-08-16 01:01:06 +00:00
Masayuki Nakano 648f892bde Bug 1781994 - part 8: Make `HTMLEditor::SetInlinePropertyAsSubAction` handle multiple styles once r=m_kato
Depends on D154349

Differential Revision: https://phabricator.services.mozilla.com/D154350
2022-08-16 01:01:05 +00:00
Masayuki Nakano d6991deecb Bug 1781994 - part 7: Make `HTMLEditor::RemoveInlinePropertyAsSubAction` handle multiple styles once r=m_kato
I think that `HTMLEditor::SetInlinePropertyAsSubAction` and
`HTMLEditor::RemoveInlinePropertyAsSubAction` should not be called multiple
times in one edit action.  Therefore, I'd like to make them take multiple
styles once.  Then, we could collect all targets before touching the DOM tree
in the future.

Depends on D154348

Differential Revision: https://phabricator.services.mozilla.com/D154349
2022-08-16 00:55:06 +00:00
Masayuki Nakano da11385641 Bug 1781994 - part 6: Make `HTMLEditor::SetInlinePropertyInternal` use `AutoRangeArray` r=m_kato
Depends on D154347

Differential Revision: https://phabricator.services.mozilla.com/D154348
2022-08-16 00:38:30 +00:00
Masayuki Nakano 9d26dd1005 Bug 1781994 - part 5: Make `HTMLEditor::RemoveInlinePropertyAsSubAction` handle correct text node after splitting a text to any direction r=m_kato
This is a pre-fix for bug 1735608.  Currently, the loop assumes that collected
nodes are always right node, but it'll be changed, therefore, it creates
new array for the follow up loops handle expected nodes.

Depends on D154346

Differential Revision: https://phabricator.services.mozilla.com/D154347
2022-08-16 00:31:45 +00:00
Masayuki Nakano 181da530ee Bug 1781994 - part 4: Make `HTMLEditor::RemoveInlinePropertyInternal` use `AutoRangeArray` r=m_kato
I'd like to get rid of `AutoSelectionRangeArray` and `AutoRestoreSelection`,
and I'd like to make it stop touching `Selection` while it is removing style
of each content nodes in the range.  Therefore, this patch rewrites it with
`AutoRangeArray`.  Then, we can reduce the indent level of the nested `for`
loops.

Note that it creates `AutoEditSubActionNotifier`, so it's a sub-edit action
handler.  Therefore, this patch renames it.

Depends on D154345

Differential Revision: https://phabricator.services.mozilla.com/D154346
2022-08-16 00:26:05 +00:00
Masayuki Nakano 55250ca5e0 Bug 1781994 - part 3: Make `HTMLEditor::SetInlinePropertyOnTextNode` stop touching `Selection` directly r=m_kato
Depends on D154344

Differential Revision: https://phabricator.services.mozilla.com/D154345
2022-08-16 00:13:40 +00:00
Masayuki Nakano fcecac970b Bug 1781994 - part 2: Make `HTMLEditor::SplitAncestorStyledInlineElementsAtRangeEdges` stop touching `Selection` directly r=m_kato
Depends on D154343

Differential Revision: https://phabricator.services.mozilla.com/D154344
2022-08-16 00:08:07 +00:00
Masayuki Nakano 9f9cd9e318 Bug 1781994 - part 1: Make `HTMLEditor::SplitAncestorStyledInlineElementsAt` and `HTMLEditor::ClearStyleAt` stop touching `Selection` directly r=m_kato
I've already made a caller of `HTMLEditor::ClearStyleAt`,
`HTMLEditor::CreateStyleForInsertText`, in bug 1770877, so this fixes a bug of
the patch.

`HTMLEditor::ClearStyleAt` is still updates `Selection` only in some cases.
And one of the caller has not handle the `Selection` update.  Therefore, once
it completely stop touching `Selection`, `ComputeEditingHost` will fail and
the other paths update `Selection`, so it should do it too.  (Without the
change, `test_dragdrop.html` fails.)

Finally, we don't need `EditResult` anymore because we have
`Result<EditorDOMPoint, nsresult>`.

Differential Revision: https://phabricator.services.mozilla.com/D154343
2022-08-16 00:02:25 +00:00
André Bargull 8c56e722b1 Bug 1784426: Call Locale::Canonicalize() on the newly parsed locale. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D154489
2022-08-15 15:34:29 +00:00
Masayuki Nakano 64e700332c Bug 1783402 - part 3: Make result of unsafe getter methods of `EditorDOMPointBase` templated r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D153842
2022-08-09 01:43:24 +00:00
Masayuki Nakano fe4e77e324 Bug 1783402 - part 2: Make result of safe getter methods of `EditorDOMPointBase` templated r=m_kato
Similar to the previous patch, and for consistency between editor helper
classes, we should make result of getter methods of `EditorDOMPointBase` too.

Differential Revision: https://phabricator.services.mozilla.com/D153841
2022-08-09 01:43:24 +00:00
Masayuki Nakano 2c1d4805a6 Bug 1783402 - part 1: Make result of the getter methods of `SplitRangeOffFromNodeResult` templated r=m_kato
We'll need the version to return `dom::Text*` in coming patches for bug 1735608.
For avoiding the class to have a lot of getters, we should make result of the
getters templated.

Differential Revision: https://phabricator.services.mozilla.com/D153840
2022-08-09 01:43:23 +00:00
Masayuki Nakano d636f57443 Bug 1783393 - Get rid of the constructor of `SplitRangeOffFromNodeResult` which takes 2 `SplitNodeResult`s r=m_kato
`GetLeftContent()` etc is explained as:
> This may return nullptr if the method didn't split at start edge of the node.

On the other hand, `SplitNodeResult::GetPreviousContent()` and
`SplitNodeResult::GetNextContent()` returns previous or next content node
of split point when the split is not performed, but not in error.

Therefore, it should check `SplitNodeResult::DidSplit()` instead of
`SplitNodeResult::isOk()`.

However, there is another problem.  The constructor cannot specify the order
of the 2 splits.  Therefore, it's hard to maintain the constructor.
Fortunately, there is only one user, so we can make the user create the
result with another constructor.

Differential Revision: https://phabricator.services.mozilla.com/D153838
2022-08-08 09:06:24 +00:00
Masayuki Nakano 982149f4f1 Bug 1782874 - part 2: Make `HTMLEditor::RemoveEmptyNodesIn` remove end container of the range if empty r=m_kato
If splitting node creates new right node instead of new left node,
`TopLevelEditSubActionData::mChangedRange` ends by start of the right node.
However, `RemoveEmptyNodesIn` uses `PostContentIterator` which collects DOM
nodes whose "end tag" appear in the range.  Therefore, for cleaning up new
empty right nodes correctly, we need to extend the range to contain the node.

Additionally, it removes unexpected element which is editable but shouldn't be
removed from the DOM tree.  Therefore, this patch adds new check such as
`HTMLEditUtils::IsRemovalNode()`.

Finally, this patch adds a check whether the editor is a mail editor or not
at considering whether a node is a "mail-cite" because `contenteditable` in
web apps do not need special handling for such Gecko-specific element.

Differential Revision: https://phabricator.services.mozilla.com/D153834
2022-08-08 08:22:44 +00:00
Masayuki Nakano 8b7fb928d3 Bug 1782628 - Make `HTMLEditor::HandleInsertBRElement` create caret position before moving its container r=m_kato
The test oddly passes without the fix in `HandleInsertBRElement`.  I guess that
post-processing in `HTMLEditor::OnEndHandlingTopLevelEditSubActionInternal()`
handles `Selection`, and anyway the insertion point of the following
`insertText` is wrong.  It seems that we don't need to uplift this.

Differential Revision: https://phabricator.services.mozilla.com/D153832
2022-08-08 01:54:47 +00:00
Masayuki Nakano bea9bf4233 Bug 1782852 - part 1: Get rid of unused editor commands in the wild r=smaug
`increaseFontSize`, `decreaseFontSize`, `gethtml`, `heading` and `readonly`
commands were disabled for a year in all channels, but no regression reports
have been filed.  Therefore, we can delete the commands and the telemetry
probes.

Note that `cmd_getContents` command which is the internal command of `gethtml`
is not used in comm-central too.  Therefore, this patch deletes the command
handler, `nsClipboardGetContentsCommand`, and `Command::GetHTML` too.

Differential Revision: https://phabricator.services.mozilla.com/D153720
2022-08-05 02:55:22 +00:00
Masayuki Nakano eddeebefce Bug 1775381 - Move `AutoRangeArray` from `EditorUtils.h` to its own header and cpp file r=m_kato
Depends on D152982

Differential Revision: https://phabricator.services.mozilla.com/D153063
2022-08-04 05:39:16 +00:00
Masayuki Nakano b938b9b105 Bug 1774704 - part 9: Get rid of `EditorBase::TopLevelEditSubActionData::mNewBlockElement` due to unused r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152982
2022-08-04 05:39:15 +00:00
Masayuki Nakano aaa97aa9d5 Bug 1774704 - part 8: Make `HTMLEditor::SetSelectionToAbsoluteAsSubAction` stop setting `TopLevelEditSubActionData::mNewBlockElement` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152981
2022-08-04 05:31:12 +00:00
Masayuki Nakano 0196645809 Bug 1774704 - part 7-7: Make `HTMLEditor::AlignNodesAndDescendants` stop touching `Selection` directly and setting `mNewBlockElement` r=m_kato
For doing that, this patch also making `HTMLEditor::AlignContentsAtSelection`
which the only caller of `HTMLEditor::AlignNodesAndDescendants` handle
`Selection` with `AutoRangeArray` because it uses `AutoSelectionRestorer` and
we need to adjust `Selection` after restored.

Differential Revision: https://phabricator.services.mozilla.com/D152980
2022-08-04 05:07:32 +00:00
Masayuki Nakano 3a9a1e4035 Bug 1774704 - part 7-6: Make `HTMLEditor::AlignContentsInAllTableCellsAndListItems` and `HTMLEditor::AlignBlockContentsWithDivElement` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152979
2022-08-04 05:00:38 +00:00
Masayuki Nakano 1da47692c5 Bug 1774704 - part 7-5: Make `HTMLEditor::AlignContentsAtSelectionWithEmptyDivElement` stop touching `Selection` directly and setting `mNewBlockElement` r=m_kato
It's only caller is `HTMLEditor::AlignContentsAtSelection` which is called only
by `HTMLEditor::AlignAsSubAction` at almost last of it.  Therefore, it's safe
to handle `mNewBlockElement` at the caller of
`AlignContentsAtSelectionWithEmptyDivElement` is safe.

Differential Revision: https://phabricator.services.mozilla.com/D152978
2022-08-04 04:53:54 +00:00
Masayuki Nakano 3f4655f24a Bug 1774704 - part 7-4: Make `HTMLEditor::SetBlockElementAlign` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152977
2022-08-04 04:40:14 +00:00
Masayuki Nakano fd641593ca Bug 1774704 - part 7-3: Make `HTMLEditor::RemoveAlignFromDescendants` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152976
2022-08-04 04:33:56 +00:00
Masayuki Nakano efd0248a4c Bug 1774704 - part 7-2: Make `CSSEditUtils::RemoveCSSInlineStyleWithTransaction` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152975
2022-08-04 04:28:13 +00:00
Masayuki Nakano 68caf865dc Bug 1774704 - part 7-1: Make `HTMLEditor::EnsureHardLineBeginsWithFirstChildOf` and `HTMLEditor::EnsureHardLineEndsWithLastChildOf` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152974
2022-08-04 04:19:46 +00:00
Masayuki Nakano b653b11028 Bug 1774704 - part 6: Make `HTMLEditor::HandleHTMLIndentAtSelectionInternal` stop touching `Selection` directly and stop setting `mNewBlockElement` r=m_kato
The change of expected assertion count in the crash test is caused by that the
test calls `execCommand` recursively from the legacy mutation event listeners.
Therefore, stopping updating `Selection` for each DOM tree change causes that
the target range in the nested edit action is changed.  However, the nested
handling has already been disabled by default, so this should not be a problem
for the users.

Differential Revision: https://phabricator.services.mozilla.com/D152973
2022-08-04 04:07:46 +00:00
Masayuki Nakano c18ae2e047 Bug 1774704 - part 5-3: Make `HTMLEditor::HandleCSSIndentAtSelectionInternal` stop touching `Selection` directly and setting `mNewBlockElement` r=m_kato
It's called only by `HTMLEditor::HandleCSSIndentAtSelection` which is called
only by `HTMLEditor::HandleIndentAtSelection`.  They don't touch `Selection`
after calling it.  Therefore, we can make it adjust collapsing selection point
by itself.

Differential Revision: https://phabricator.services.mozilla.com/D152972
2022-08-04 03:16:28 +00:00
Masayuki Nakano 2296d580e7 Bug 1774704 - part 5-2: Make `HTMLEditor::IndentListChild` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152971
2022-08-04 03:00:31 +00:00
Masayuki Nakano 49869c2825 Bug 1774704 - part 5-1: Make `HTMLEditor::ChangeMarginStart` stop touching `Selection` directly r=m_kato
And also this patch makes it and an its caller stop computing editing host
with the latest `Selection`.

Differential Revision: https://phabricator.services.mozilla.com/D152970
2022-08-04 02:40:57 +00:00
Masayuki Nakano 6a5e4e03e3 Bug 1774704 - part 4-4: Make `HTMLEditor::ChangeSelectedHardLinesToList` stop setting `TopLevelEditSubActionData::mNewBlockElement` r=m_kato
With taking an `AutoRangeArray` which is initialized with `Selection`, it can
restore selection and check if it's collapsed and if collapsed in the expected
list element.  Then, its caller can apply the returned range to `Selection`
because it's an edit sub-action handler.

Differential Revision: https://phabricator.services.mozilla.com/D152969
2022-08-04 02:28:11 +00:00
Masayuki Nakano cc6f01f78c Bug 1774704 - part 4-3: Make `HTMLEditor::MaybeSplitAncestorsForInsertWithTransaction` stop computing editing host with current selection r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152968
2022-08-04 02:12:03 +00:00
Masayuki Nakano 87542555d4 Bug 1774704 - part 4-2: Make `HTMLEditor::ChangeListElementType` stop touching `Selection` directly r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152967
2022-08-04 02:02:46 +00:00
Masayuki Nakano 7b53a68cd6 Bug 1774704 - part 4-1: Move `HTMLEditor::GetParentListElementAtSelection` into `AutoRangeArray` r=m_kato
It oddly retrieve an ancestor list element which contains one range in the
selection ranges.  So, working it with `AutoRangeArray` which is initialized
with `Selection` makes `HTMLEditor` smaller...

Differential Revision: https://phabricator.services.mozilla.com/D152966
2022-08-04 01:50:28 +00:00
Masayuki Nakano 8b65b0bbf3 Bug 1774704 - part 3: Make `HTMLEditor::InsertParagraphSeparatorAsSubAction` stop setting `TopLevelEditSubActionData::mNewBlockElement` r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152965
2022-08-04 01:00:25 +00:00
Masayuki Nakano 49774332d1 Bug 1774704 - part 2: Make `CreateOrChangeBlockContainerElement`, `FormatBlockContainerWithTransaction` and `WrapContentsInBlockquoteElementsWithTransaction` stop setting `TopLevelEditSubActionData::mNewBlockElement` r=m_kato
They set `TopLevelEditSubActionData::mNewBlockElement` and their root callers
in edit sub-action level are only `InsertParagraphSeparatorAsSubAction` and
`FormatBlockContainerAsSubAction`, and they are called each other.  Therefore,
this patch changes these 3 methods once.

Differential Revision: https://phabricator.services.mozilla.com/D152964
2022-08-04 00:39:13 +00:00
Masayuki Nakano 14dd35ea1d Bug 1774704 - part 1: Make `HTMLEditor::EnsureCaretInBlockElement` only computes new caret point in the given element r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152963
2022-08-04 00:21:53 +00:00
Masayuki Nakano 7f6f9cf71c Bug 1774704 - part 0: Add automated tests of preserving selection while handling some commands r=m_kato
The following patches touch the logic to restore selection after handling
commands.  However, it seems that they are not tested because I found some
regressions by manual testing, but didn't cause orange on tryserver.

`outdent-preserving-selection.tentative.html` causes a crash due to the
`MOZ_ASSERTION` in `HTMLEditor::HandleOutdentAtSelectionInternal`.  It means
that I misunderstand the logic and had put the assertion.  I should fix it
later with reading the complicated code again.  For now, I just change it
to `NS_WARNING_ASSERTION` instead.

And also `test_cmd_absPos.html` is the first test to check toggling `position`
between `static` and `absolute`.  Therefore, it detects wrong `MOZ_ASSERT`s
which test whether `EditActionData` or `TopLevelEditSubActionData` is created
or not **before** they create them by themselves.  So, this patch removes the
wrong assertions.

Differential Revision: https://phabricator.services.mozilla.com/D152962
2022-08-04 00:21:53 +00:00
Mark Banner 1c23a90c8e Bug 1782008 - Remove now unnecessary ESLint test definitions from other .eslintrc.js files. r=mossop,media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D153216
2022-08-03 11:16:20 +00:00
Mark Banner 7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
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
Masayuki Nakano bf2ccc8872 Bug 1780140 - Make `HTMLEditor::ClearStyleAt` clean up new empty inline elements which are not contain new text r=m_kato
Currently, `HTMLEditor` assumes that padding `<br>` element for empty last line
is outside of inline elements, but it may happen because of both:
* starting from bug 1778091, `HTMLEditor` move `<br>` element into new empty
inline elements at inserting new paragraph.
* web apps can put it into inline elements.

After splitting inline elements and which do not have meaningful content, users
cannot put caret into the empty inline elements so that the elements stay unless
delete around there.

For avoiding the leak due to meaningless elements, we should delete them at
splitting inline elements at inserting new text.

Note that Chrome does not pass the new tests of resetting ancestor bold style
because Chrome wraps the `<b>` with `<i>`, however, the `<i>` has odd
`style=""`.  Perhaps, the test framework should ignore it because it's not
important for the web-compatibility.

On the other hand, Chrome completely fails only the last testcase since it
unwraps the `<b>` from the last `<br>`, so the bold style which was applied by
the web app to the last `<br>` is lost.  This is not reasonable.

Differential Revision: https://phabricator.services.mozilla.com/D152616
2022-07-27 22:51:18 +00:00
Tooru Fujisawa a032f53a63 Bug 1780543 - Part 5: Add mozilla/chrome-script environment. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D152430
2022-07-26 02:46:30 +00:00
Masayuki Nakano a45b6d1e16 Bug 1773848 - Make the for-loop in the lambda in `HTMLEditor::InsertTableRowsWithTransaction` refer only `cellDataInLastRow` r=m_kato
It's renamed from `CellData`, but `cellData` still exists in the wider scope.
https://searchfox.org/mozilla-central/rev/f6a2ef2f028b8f1eb82fa5dc5cb1e39a3baa8feb/editor/libeditor/HTMLTableEditor.cpp#923-924

Therefore, these lines are wrong:
https://searchfox.org/mozilla-central/rev/f6a2ef2f028b8f1eb82fa5dc5cb1e39a3baa8feb/editor/libeditor/HTMLTableEditor.cpp#1049,1053

because `cellData` was in the for-loop:
https://searchfox.org/mozilla-central/rev/bc4493c72442ad55aecf6b575edb0df4ed18b113/editor/libeditor/HTMLTableEditor.cpp#1008-1009,1020,1022,1026

Differential Revision: https://phabricator.services.mozilla.com/D152144
2022-07-20 04:24:52 +00:00
Magnus Melin 2fec2a1929 Bug 1779343 - Don't crash rewrapping "> ". r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D151682
2022-07-14 13:12:29 +00:00