Closed Bug 1664741 Opened 4 years ago Closed 4 years ago

`AutoBlockElementsJoiner::DeleteNodesEntirelyInRangeButKeepTableStructure()` checks whether deleting content is visible or invisible **after** deleting it

Categories

(Core :: DOM: Editor, defect, P2)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

https://searchfox.org/mozilla-central/rev/62c443a7c801ba9672de34c2867ec1665a4bbe67/editor/libeditor/HTMLEditSubActionHandler.cpp#4722,4730-4747

It deletes content in a range, and if it deletes some visible things, stop the caller joining blocks. However, the visibility check is performed after deleting the content from the DOM tree. This is really odd, but the log must be correct (i.e., only when no visible things is deleted, its caller should join adjacent blocks for making users not think nothing happens.

Oddly, it checks whether it deletes at least one visible thing after deleting
each content from the DOM tree. It should be done before deleting from the
DOM tree because all text nodes become visible if they are not in the DOM tree
anymore.

Unfortunately, this change does not fix any automated test result, but the
base logic --only when it does not delete any visible things, join the adjacent
block elements-- sounds reasonable. Therefore, let's take this change.
Note that without this change, cannot compute "affected ranges" of
getTargetRanges() in the case running this method later.

Depends on D89870

Severity: -- → S3
Priority: -- → P2
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/ca57b2951ec0 Make `AutoBlockElementsJoiner::DeleteNodesEntirelyInRangeButKeepTableStructure()` check whether it deletes a visible content or not before deleting the contents r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Regressions: 1665550
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: