Closed Bug 1898408 Opened 2 years ago Closed 2 years ago

Updating `<br>` to a padding one cannot cause text change notification to IME

Categories

(Core :: DOM: Editor, defect)

defect

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: inputmethod)

Attachments

(1 external file)

When <br> element is set to a padding one, ContentEventHandler treats it as hidden. However, updating the type from or to padding one is not observable from IMEContentObserver. Therefore, when a connect <br> element becomes a padding <br>, it's not notified IME but it should cause a removing text notification.

This might cause bug 1824143.

Currently, the <br> element type -- whether normal <br> element or padding
<br> element for empty editor or last line -- is managed by the flags of
nsINode. Therefore, changing the flag does not cause mutation, so
IMEContentObserver cannot observe the type changes. However,
ContentEventHandler treats the padding <br> elements as invisible.
Therefore, when a <br> element becomes a padding one, IMEContentObserver
needs to notify IME of atext removed notification, and also when a <br>
element becomes a normal one (i.e., visible), IMEContentObserver needs to
notify IME of a text added notification.

Therefore, this patch makes EditorBase disconnect the <br> element
temporarily to make IMEContentObserver observable the type change.

Depends on D211698

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/ef63f8e565ed Make our editor disconnect `<br>` element temporarily when its type is changed from or to padding one r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: