Closed Bug 1727185 Opened 3 months ago Closed 3 months ago

Add sentries to check whether `HTMLEditor` tries to delete `<body>` or `<html>` element

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(2 files)

No description provided.

On Thunderbird, we still have a bug to delete <html> and <body> elements
(bug 1727201). However, it's hard to know where deletes the unexpected elements
from warning messages in the log. Additionally, it's really serious bug
because editor and layout code rely on the basic structure of HTML document.
Therefore, we should block the worst scenario before deleting such nodes.

Hmm, I think that it's not enough to return from the DeleteNodeTransaction users. I'll post a patch soon.

Keywords: leave-open

I just missed some callers of it. And I also make
EditorBase::DeleteNodeTransaction() a virtual method and HTMLEditor override
it. Then, even if it's called by helper classes, the HTMLEditor version is
always called.

Regressions: 1727840
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/42ed78fa08b2
part 2: Add removable node checks for more callers of `DeleteNodeTransaction::MaybeCreate()` r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.