Closed Bug 1193988 Opened 9 years ago Closed 9 years ago

nsFrameSelection::TakeFocus notifies listeners twice on some branches

Categories

(Core :: DOM: Selection, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(1 file)

In the last branch of nsFrameSelection::TakeFocus, Selection::Extend is called. Selection::Extend handles calling NotifySelectionListeners() when the selection is changed, however nsFrameSelection::TakeFocus will also call it after Extend returns. The function should be changed such that NotifySelectionListeners() is only called once when this branch is taken.
This needs a test too. :)
(In reply to (Ask others for review please; out most of the week) from comment #2) > This needs a test too. :) Indeed it does! I'm currently having a bunch of issues with us notifying selection listeners very overzealously, so I haven't really finalized this patch yet. For example, we fire a NotifySelectionListener every time you move your selection a pixel, even if it doesn't change the actual range which you selected.
Do we still need this, given your new approach? If not, I prefer to not change the behavior here.
Flags: needinfo?(michael)
Nope, we don't. I was thinking of closing this but wanted to talk to you first.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(michael)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: