287
edits
(Adjust about page reference) |
(waitForFocus takes a browser) |
||
| Line 114: | Line 114: | ||
There is a separate focus manager in each process. When a child process is focused, the parent's focus manager will have its current focus on on that child's corresponding <browser> element. You can check <code>document.activeElement</code> in the parent process for this (or <code>Services.focus.focusedElement</code>). An existing test may be trying to retrieve <code>Services.focus.focusedElement</code> or using the commandDispatcher and these usages may need to be changed. To retrieve the focused element in a child process, use a ContentTask and check it from within there. | There is a separate focus manager in each process. When a child process is focused, the parent's focus manager will have its current focus on on that child's corresponding <browser> element. You can check <code>document.activeElement</code> in the parent process for this (or <code>Services.focus.focusedElement</code>). An existing test may be trying to retrieve <code>Services.focus.focusedElement</code> or using the commandDispatcher and these usages may need to be changed. To retrieve the focused element in a child process, use a ContentTask and check it from within there. | ||
SimpleTest.waitForFocus and SimpleTest.promiseFocus also accept a <browser> element as the second argument. This can be used to focus a child tab and wait for it to focused. | |||
=== Preferences === | === Preferences === | ||
edits