Closed Bug 516076 Opened 16 years ago Closed 16 years ago

document.commandDispatcher.getControllerForCommand looks in active window

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1
Tracking Status
status1.9.2 --- beta4-fixed

People

(Reporter: neil, Assigned: enndeakin)

References

Details

(Keywords: regression)

Attachments

(1 file)

Under 1.9.1, document.commandDispatcher.getControllerForCommand always looked for the focused element within the same top-level window. However on trunk it looks for the focused element in the active window. For example, if a dialog calls a function in its opener, then it always checks the calling dialog's controller. Alternatively, if you step through goUpdateCommand using Venkman then it always checks Venkman's controllers.
I hope to get rid of the focus controller as it doesn't really have much in it anymore. For now, to fix the regression though, just pass a suitable context window to it's methods.
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Attachment #400766 - Flags: superreview?(Olli.Pettay)
Attachment #400766 - Flags: review?(neil)
Also, this patch caused some contenteditable tests to fail when run on the try server. The fix for that is in nsFocusManager::WindowHidden included in this patch.
Attachment #400766 - Flags: review?(neil) → review+
Comment on attachment 400766 [details] [diff] [review] pass the window to the focus controller methods Works with my test cases. >+ nsCOMPtr<nsPIDOMWindow> focusedWindow; >+ nsIContent* focusedContent = >+ GetRootFocusedContentAndWindow(aContextWindow, getter_AddRefs(focusedWindow)); >+ if (focusedContent) { ... >+ nsIDocument* doc = focusedContent->GetOwnerDoc(); >+ nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(doc->GetWindow()); Didn't GetRootFocusedContentAndWindow already get the right window?
> >+ nsIDocument* doc = focusedContent->GetOwnerDoc(); > >+ nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(doc->GetWindow()); > Didn't GetRootFocusedContentAndWindow already get the right window? I'll remove those lines and just refer to focusedWindow instead.
Attachment #400766 - Flags: superreview?(Olli.Pettay) → superreview+
Comment on attachment 400766 [details] [diff] [review] pass the window to the focus controller methods > // 2879DB1C-47AA-46C4-B184-2590CC39F262 > #define NS_IFOCUSCONTROLLER_IID \ > { 0x2879db1c, 0x47aa, 0x46c4, \ > { 0xb1, 0x84, 0x25, 0x90, 0xcc, 0x39, 0xf2, 0x62 } } You should update the IID
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Comment on attachment 400766 [details] [diff] [review] pass the window to the focus controller methods Regression so could affect some extensions.
Attachment #400766 - Flags: approval1.9.2?
Attachment #400766 - Flags: approval1.9.2? → approval1.9.2+
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: