Closed Bug 1815621 Opened 2 years ago Closed 2 years ago

Some concrete selection listeners are not notified of selection changes if there is no listeners inheriting `nsISelectionListener`

Categories

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

defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox110 --- wontfix
firefox111 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

This is a silly regression of mine.

I made some selection listeners are concrete ones for the performance (bug 1486370, bug 1487591 and bug 1487659), but I didn't remove the early return.

If the Selection is for a text control, TextEditor adds itself as a selection listener. Therefore, this never becomes a problem in text controls.

If the Selection is for a document, nsDocumentViewer adds its owning selection listener. I guess that this never becomes a problem in the usual normal Selection too.

According to the latter fact, we could make the latter a concrete class listener though.

In bug 1486370, bug 1487591 and bug 1487659, we made Selection handle some
selection listeners with pointers to concrete classes for the performance (for
saving virtual call cost, allocation cost of the selection listener array and
copy cost of the array before notifying). However, at that time, I forgot to
change the condition of early return. Therefore, current Selection does not
notify concrete class listeners of selection changes if there is no active
nsISelectionListener instances for the Selection instance.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/203f88869b35 Make `Selection::NotifySelectionListeners` check concrete class listeners too when it wants to return early r=smaug
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: