Make `HTMLEditor::JoinNodesWithTransaction()` return error if cannot join given nodes
Categories
(Core :: DOM: Editor, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1739315 - part 2: Make `HTMLEditor::JoinNodesWithTransaction()` return error if failed r=m_kato!
48 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Comment 1•3 years ago
|
||
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()
.
Assignee | ||
Comment 2•3 years ago
|
||
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.
Depends on D130348
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/c50c8ac11ff7 part 1: Make `HTMLEditor::JoinNodesWithTransaction()` directly notify `TopLevelEditSubActionData::DidJoinNodes()` of joined position r=m_kato https://hg.mozilla.org/integration/autoland/rev/cef70047defb part 2: Make `HTMLEditor::JoinNodesWithTransaction()` return error if failed r=m_kato
Backout by ctuns@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e8f7a1b60409 Backed out 2 changesets for causing android wpt failures.
Pushed by ctuns@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8325dd6a09d part 1: Make `HTMLEditor::JoinNodesWithTransaction()` directly notify `TopLevelEditSubActionData::DidJoinNodes()` of joined position r=m_kato https://hg.mozilla.org/integration/autoland/rev/734d287e2f28 part 2: Make `HTMLEditor::JoinNodesWithTransaction()` return error if failed r=m_kato
Comment 7•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c8325dd6a09d
https://hg.mozilla.org/mozilla-central/rev/734d287e2f28
Description
•