Closed Bug 1891656 Opened 2 years ago Closed 2 years ago

`HTMLEditUtils::GetMostDistantAncestorEditableEmptyInlineElement` may return `Text`

Categories

(Core :: DOM: Editor, defect)

defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

It may use AsElement() for Text, but it's wrong. This may cause crash bugs, but fortunately, all callers use it as nsIContent*, so, this may cause only removing text node instead of nothing to do.

It uses AsElement() which always casts itself to Element*, however, the
instance may be non-element node if there is no empty parent of aEmptyContent.

Fortunately, all callers of this method uses the result as nsIContent* to
call DeleteNodeWithTransaction(). Therefore, we don't have crash bugs caused
by this.

Depends on D207687

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/53e1d98592d7 Make `HTMLEditUtils::GetMostDistantAncestorEditableEmptyInlineElement()` use `Element::FromNode()` r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: