Commit Graph
16 Commits
Author SHA1 Message Date
Masayuki Nakano 44159014a2 Bug 1859245 - part 3: Make JoinNodesTransaction and SplitNodeTransaction handle only the new direction mode r=m_kato
Depends on D191606

Differential Revision: https://phabricator.services.mozilla.com/D191607
2023-10-27 01:57:29 +00:00
Masayuki Nakano 27bdbb5436 Bug 1859245 - part 2: Make HTMLEditor::DoJoinNodes and HTMLEditor::DoSplitNode handle only the new direction mode r=m_kato
Depends on D191605

Differential Revision: https://phabricator.services.mozilla.com/D191606
2023-10-27 01:57:29 +00:00
Masayuki Nakano 6873ef16fd Bug 1795061 - Stop exposing JoinSplitNodeDirection.h r=m_kato
Including it in `HTMLEditor.h` causes creating static constructors for
the modules which include `HTMLEditor.h`.  And the public methods are used
only in the `libeditor`.  Therefore, we can make `HTMLEditor.h` stop including
it and stop exposing `JoinSplitNodeDirection.h`.

Differential Revision: https://phabricator.services.mozilla.com/D159363
2022-10-19 06:40:30 +00:00
Masayuki Nakano 0b074382f7 Bug 1793694 - part 3: Move definitions of JoinNodesDirection and SplitNodeDirection into a new exposed header file r=m_kato
They are used in public inline methods of `HTMLEditor`.  Therefore, they should
be defined in an exposed header file without other internal use things for the
editor module.  Then, we can stop exposing `HTMLEditHelpers.h`.

Depends on D158632

Differential Revision: https://phabricator.services.mozilla.com/D158633
2022-10-12 02:44:18 +00:00
Masayuki Nakano af5b2b3933 Bug 1792642 - Make SplitNodeResult treated as ok type of Result r=m_kato
Depends on D158333

Differential Revision: https://phabricator.services.mozilla.com/D158334
2022-10-04 07:28:10 +00:00
Masayuki Nakano edf0546b90 Bug 1792387 - part 4: Make JoinNodesTransaction and SplitNodeTransaction support both join/split node directions r=m_kato
The reason why the changes of `SplitNodeTransaction` is smaller than
`JoinNodesTransaction` is, `HTMLEditor::DoSplitNode` does almost all things
instead.

Differential Revision: https://phabricator.services.mozilla.com/D158102
2022-09-30 22:20:21 +00:00
Masayuki Nakano 23debc5658 Bug 1792387 - part 3-1: Make HTMLEditor::DoSplitNode() adjust selection for both split node directions r=m_kato
This patch adds new path to adjust selection for the new split node direction.
So this does not change any behavior of the existing path.

Differential Revision: https://phabricator.services.mozilla.com/D158100
2022-09-30 22:20:20 +00:00
Masayuki Nakano 7ac4877bb7 Bug 1792387 - part 2-1: Make HTMLEditor::DoJoinNodes() adjust selection for both join nodes directions r=m_kato
This patch add new path to adjust selection for the new join nodes direction.
So this does not change any behavior of the existing path.

Differential Revision: https://phabricator.services.mozilla.com/D158098
2022-09-30 22:20:19 +00:00
Masayuki Nakano 96a5673280 Bug 1774114 - Make HTMLEditor and its helper classes get split/join node direction dynamically r=m_kato
Currently I'm think that the split/join node direction should be managed per
`HTMLEditor` instance because per transaction makes undo/redo handling
complicated and may require additional space to save it in each transaction
instance.  However, the direction should be changeable with new Gecko specific
`execCommand` to support both direction until creating first split/join node
transaction or anytime with clearing the transactions.

Differential Revision: https://phabricator.services.mozilla.com/D149192
2022-07-01 02:02:03 +00:00
Masayuki Nakano adea39d1ad Bug 1762115 - part 5: Make SplitNodeResult store and suggest new caret position r=m_kato
This patch allows methods which split some nodes to return new candidate
caret position and makes callers of them consider whether applying it to
the selection immediately or not.

Differential Revision: https://phabricator.services.mozilla.com/D144648
2022-05-03 00:06:16 +00:00
Masayuki Nakano 613c3e6874 Bug 1757911 - part 3: Make HTMLEditor::DoJoinNodes() notify RangeUpdater r=m_kato
Currently, it's notified by `JoinNodesTransaction::DoTransactionInternal` so
that it's `SplitNodeTransaction::UndoTransaction` cannot track the DOM point
and this might cause odd editing result if `execCommand("undo")` is called
while `HTMLEditor` handles an edit action.

For avoiding to duplicate the code, it should be handled in
`HTMLEditor::DoJoinNodes`.

Differential Revision: https://phabricator.services.mozilla.com/D140463
2022-03-10 10:27:54 +00:00
Iulian Moraru a457578a3c Backed out 4 changesets (bug 1757911) for causing build bustages on HTMLEditor.cpp.
Backed out changeset 0a12415ff7cf (bug 1757911)
Backed out changeset 1edde90f24cc (bug 1757911)
Backed out changeset 64ae36546100 (bug 1757911)
Backed out changeset e0e951dc9594 (bug 1757911)
2022-03-10 06:24:41 +02:00
Masayuki Nakano 9492284581 Bug 1757911 - part 3: Make HTMLEditor::DoJoinNodes() notify RangeUpdater r=m_kato
Currently, it's notified by `JoinNodesTransaction::DoTransactionInternal` so
that it's `SplitNodeTransaction::UndoTransaction` cannot track the DOM point
and this might cause odd editing result if `execCommand("undo")` is called
while `HTMLEditor` handles an edit action.

For avoiding to duplicate the code, it should be handled in
`HTMLEditor::DoJoinNodes`.

Depends on D140462

Differential Revision: https://phabricator.services.mozilla.com/D140463
2022-03-09 23:14:37 +00:00
Masayuki Nakano ade61a18b6 Bug 1756933 - part 3: Clean up HTMLEditor::JoinNodesWithTransaction() r=m_kato
This push some post processing of joining nodes into `JoinNodesTransaction` and
`HTMLEditor::DidJoinNodes()` to make `HTMLEditor::JoinNodesTransaction()`
simpler and the new method does not use the "left"/"right" words at post
processing.

This changes the logic a bit so that it may change some behavior if web apps
uses some legacy mutation events, but it must be rare case because the other
browsers don't fire them synchronously.

Depends on D139716

Differential Revision: https://phabricator.services.mozilla.com/D139717
2022-02-28 23:22:25 +00:00
Masayuki Nakano 3867f175da Bug 1756933 - part 2: Clean up JoinNodesTransaction members and variables r=m_kato
This patch renames members and variables in it not to use "left" and "right"
words to preparing to support both direction joining.  So this patch does not
change any behavior.

Depends on D139715

Differential Revision: https://phabricator.services.mozilla.com/D139716
2022-02-28 23:03:51 +00:00
Masayuki Nakano cef03816dc Bug 1756933 - part 1: Rename JoinNodeTransaction to JoinNodesTransaction r=m_kato
For consistency with the other things in editor module, it should be "nodes"
rather than "node" since 2 nodes are joined by it.

Differential Revision: https://phabricator.services.mozilla.com/D139715
2022-02-28 23:03:51 +00:00