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)
(deleted),
text/x-phabricator-request
|
Details | |
Bug 1739315 - part 2: Make `HTMLEditor::JoinNodesWithTransaction()` return error if failed r=m_kato!
(deleted),
text/x-phabricator-request
|
Details |
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
Comment 7•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c8325dd6a09d
https://hg.mozilla.org/mozilla-central/rev/734d287e2f28
Description
•