Commit Graph

680 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d7560f6363 Bug 1689155 - Don't necessarily show outlines on refocus. r=edgar
Preserve the last state of when we focused the element in that window,
if the focus method is unknown.

Differential Revision: https://phabricator.services.mozilla.com/D104863
2021-02-15 12:41:23 +00:00
Emilio Cobos Álvarez
6788888da7 Bug 1689155 - Shuffle a bit the focus ring code again. r=edgar
No behavior change, just moving the decision of whether to show outlines
to slightly earlier.

Differential Revision: https://phabricator.services.mozilla.com/D104861
2021-02-15 12:41:22 +00:00
Emilio Cobos Álvarez
b73f17a865 Bug 1691214 - Take focus from window.open etc even if we're already active but not in the active window. r=hsivonen
With multiple windows, a browsing context being active doesn't guarantee
being in the active window, so we explicitly check for that. We need to
introduce an special case for the initial document because the initial
document in the active window requesting focus breaks focusing the
urlbar on a new window.

Differential Revision: https://phabricator.services.mozilla.com/D104326
2021-02-09 13:03:32 +00:00
Makoto Kato
b6500ecef3 Bug 1681800 - Don't notify of refocus when element is non focusable root. r=masayuki
It is unnecessary to notify of IME re-focus when element is root element and
not focusable.

Differential Revision: https://phabricator.services.mozilla.com/D103980
2021-02-04 04:52:49 +00:00
Emilio Cobos Álvarez
e30835a18c Bug 1690225 - Remove focus-visible feature flag. r=edgar
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-02 23:45:25 +00:00
Mihai Alexandru Michis
26f31ed584 Backed out 2 changesets (bug 1690225) for causing multiple bc failures.
CLOSED TREE

Backed out changeset 381ee01f5034 (bug 1690225)
Backed out changeset cde1d10aae1c (bug 1690225)
2021-02-03 01:42:37 +02:00
Emilio Cobos Álvarez
2a81634e0d Bug 1690225 - Remove focus-visible feature flag. r=edgar
This shipped in 85, we can remove the feature flag now. Keep
:-moz-focusring as an alias to :focus-visible at parse time.

Differential Revision: https://phabricator.services.mozilla.com/D103752
2021-02-02 22:28:40 +00:00
Edgar Chen
f2d1dd6927 Bug 1672330 - Move pointer lock code to PointerLockManager; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101054
2021-01-27 16:38:29 +00:00
Dorel Luca
f0ee4e0ca9 Backed out changeset 4e317086de97 (bug 1672330) for Mochitest failures in dom/tests/mochitest/pointerlock/test_pointerlock_focus.html. CLOSED TREE 2021-01-27 14:05:29 +02:00
Edgar Chen
07607bcc37 Bug 1672330 - Move pointer lock code to PointerLockManager; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101054
2021-01-27 10:08:29 +00:00
Mats Palmgren
35a8dbdbd9 Bug 1687239 part 2 - Remove plugin support from layout/. r=emilio
Note that there's still a little plugin related code in
widget/ and gfx/ etc after this.  That can be removed
once we remove plugin support from dom/ etc.
The removal from layout/ should be pretty complete though.

Differential Revision: https://phabricator.services.mozilla.com/D102140
2021-01-25 11:53:49 +00:00
Emilio Cobos Álvarez
6f77a5fb7c Bug 1351248 - Simplify nsIFrame::IsFocusable API. r=layout-reviewers,mats
We always compute the tabindex value, so just return it to the caller
all the time. This allows us to use early-returns which makes the code a
bit easier to follow.

This patch shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D100423
2021-01-03 23:30:51 +00:00
Edgar Chen
644595c5f9 Bug 582459 - Reset the focused element when a frame loses document focus; r=mikedeboer,NeilDeakin,hsivonen,jaws
Resetting focus would also clear selection on editable element, so get
current selected text before moving focus to findbar to make
prefill-with-selection work if the content is loaded in chrome process.

Differential Revision: https://phabricator.services.mozilla.com/D89557
2020-12-21 21:35:49 +00:00
Dorel Luca
920da558dc Backed out changeset 2ac614e69ecb (bug 582459) for Mochitest failures in dom/tests/mochitest/chrome/test_focus.xhtml. CLOSED TREE 2020-12-16 03:44:13 +02:00
Edgar Chen
c16c3af36b Bug 582459 - Reset the focused element when a frame loses document focus; r=mikedeboer,NeilDeakin,hsivonen,jaws
Resetting focus would also clear selection on editable element, so get
current selected text before moving focus to findbar to make
prefill-with-selection work if the content is loaded in chrome process.

Differential Revision: https://phabricator.services.mozilla.com/D89557
2020-12-15 19:55:35 +00:00
Henri Sivonen
d8d156940d Bug 1663853 - Assume that different-origin iframes are focusable even in the in-process case. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D98044
2020-12-07 16:38:17 +00:00
Henri Sivonen
caedf7851d Bug 1660805 - In OOP iframes, run window raising to completion synchronously to ensure correct order of focus and mouseup when focusing an OOP iframe by click. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D97553
2020-12-07 16:29:16 +00:00
Kagami Sascha Rosylight
949c6feb7f Bug 1680167 - Part 3: MOZ_CAN_RUN_SCRIPT_BOUNDARY in dom/base r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D98626
2020-12-03 22:08:36 +00:00
Edgar Chen
6fc7a0778a Bug 1678349 - Part 2: Suppress additional blur/focus event on OOP iframe; r=hsivonen
for the case that framer calls iframe.focus() on OOP iframe and the OOP iframe
already has the focus.

Differential Revision: https://phabricator.services.mozilla.com/D98304
2020-12-02 13:03:58 +00:00
Edgar Chen
ce709abd8f Bug 1678349 - Part 1: Compute focus-in-other-content-process flag in nsFocusManager::Focus; r=hsivonen
This simplify the code a bit and also fix FocusIsOutOfProcess isn't set correctly
for a certain case, e.g. framer calls iframe.focus() on a OOP iframe.

Differential Revision: https://phabricator.services.mozilla.com/D96720
2020-12-02 12:59:59 +00:00
Emilio Cobos Álvarez
34619aec20 Bug 1680158 - Expose focused content browsing context to chrome code. r=hsivonen
This is useful for printing. Naming is confusing IMO, but my read of the
docs and experimentation agree this is what we want :)

Differential Revision: https://phabricator.services.mozilla.com/D98415
2020-12-02 08:50:45 +00:00
Edgar Chen
e2dd8556f4 Bug 1679526 - Make focus restriction in keyboard event handler working on OOP iframe; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D98090
2020-11-30 15:46:25 +00:00
Steven MacLeod
a8a5d5d11c Bug 1585070 - move nsPIDOMWindowOuter::mIsActive to BrowsingContext. r=kmag
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.

With this change `:-moz-window-inactive` is now fission compatible.

Differential Revision: https://phabricator.services.mozilla.com/D86422
2020-11-20 15:16:58 +00:00
Edgar Chen
6c84893395 Bug 1674702 - Do not bounce IPC message to framer if focus is handled synchronously in OOP iframe; r=hsivonen
This suppress unnecessary blur and focus actions in the framer, we would need
to find a way to notify framer that the focus has moved to OOP iframe to
dispatch corresponding blur event, see bug 1677474.

Differential Revision: https://phabricator.services.mozilla.com/D97158
2020-11-17 11:47:27 +00:00
Noemi Erli
bc4586b638 Backed out changeset 18448a7ebf82 (bug 1585070) for causing failures in test_cocoa_window_focus.html CLOSED TREE 2020-11-17 06:09:50 +02:00
Steven MacLeod
9727243f2f Bug 1585070 - move nsPIDOMWindowOuter::mIsActive to BrowsingContext. r=kmag
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.

With this change `:-moz-window-inactive` is now fission compatible.

Differential Revision: https://phabricator.services.mozilla.com/D86422
2020-11-16 22:37:51 +00:00
Henri Sivonen
a26db683e0 Bug 1618386 - Add action ids to filter out stale active browsing context updates. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D94969
2020-11-16 19:16:20 +00:00
Emilio Cobos Álvarez
436e516d9c Bug 1618639 - Make focus-visible match the spec more closely. r=edgar
The spec text has been improved a while ago, so I think we should do
this. This keeps the current moz-focusring behavior when the pref is
disabled, but when enabled it becomes effectively an alias of
focus-visible.

Differential Revision: https://phabricator.services.mozilla.com/D96697
2020-11-13 12:53:45 +00:00
Edgar Chen
bf73f40759 Bug 1674743 - Synchronously raise window when window.focus() called in OOP iframe; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D96184
2020-11-11 11:19:15 +00:00
Edgar Chen
a48d7f0e8c Bug 1676127 - Don't deactivate top-level remote browser twice when browser window is lowered; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D96404
2020-11-09 14:57:54 +00:00
Edgar Chen
25c8ba3962 Bug 1675397 - Part 2: Use AutoRestore to reset nsFocusManager::mFirst{Blur|Focus}Event; r=hsivonen
Depends on D95946

Differential Revision: https://phabricator.services.mozilla.com/D95947
2020-11-05 09:05:05 +00:00
Edgar Chen
9214920e7e Bug 1675397 - Part 1: Use RefPtr<Element> for nsFocusManager::mFirst{Blur|Focus}Event; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D95946
2020-11-05 09:04:38 +00:00
Chris H-C
8b3e3294cc Bug 1672579 - Remove probes and instrumentation for FOG lifecycle evaluation r=janerik
We got the data we need to make a decision.

(( This is a combined revert of the four commits that added the instrumentation ))

Differential Revision: https://phabricator.services.mozilla.com/D94620
2020-10-26 08:37:00 +00:00
Makoto Kato
2840e253b0 Bug 1658948 - Ace editor doesn't show software keyboard. r=masayuki
Actually software keyboard is opened by the following situations.
- Click event in editor
- Get new focus event.

Ace editor has small <textarea> element to handles some input events.
When clicking editable-like area (but this isn't ediable on Ace editor),
mousedown handler calls `event.preventDefault()` then set focus to
<textarea> element. So editor doesn't get click event and focus is still
keep in <textarea> element. At finally, we cannot open software keyboard
again since focus isn't changed.

So even if focus isn't changed, we should call SetInputContext to open
software keyboard.

Also, actually we doesn't have generic test code for notification of
software keyboard change (bug 1670539). I will add the test by bug 1670539.

Differential Revision: https://phabricator.services.mozilla.com/D93326
2020-10-14 02:27:22 +00:00
Edgar Chen
15ac27c24f Bug 1666843 - Clear mFocusedWindow while burring; r=hsivonen
The expectation is that the blurring would eventually result in an IPC message
doing this anyway, but this doesn't happen if the focus is in OOP iframe which
won't try to bounce an IPC message to its parent frame.

Differential Revision: https://phabricator.services.mozilla.com/D93210
2020-10-12 11:58:50 +00:00
Edgar Chen
12cf33f58a Bug 1667081 - Part 9: Remove SetFocusedWindowWithCallerType in nsIFocusManager; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D91346
2020-09-29 07:22:45 +00:00
Edgar Chen
042068e1d4 Bug 1667081 - Part 8: Remove parentActivated in nsIFocusManager; r=hsivonen
And make nsFocusManager::ParentActivated just returning void given all caller
doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91294
2020-09-29 07:22:32 +00:00
Edgar Chen
3219e12ceb Bug 1667081 - Part 7: Remove focusPlugin in nsIFocusManager; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D91293
2020-09-29 07:22:25 +00:00
Edgar Chen
fc12d40b81 Bug 1667081 - Part 6: Remove fireDelayedEvents in nsIFocusManager; r=hsivonen
This patch also does following changes,
- Assert aDocument instead of early return given all caller passes a non-null document.
- Make it returning void given all caller doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91292
2020-09-29 07:22:12 +00:00
Edgar Chen
50867034e7 Bug 1667081 - Part 5: Remove windowHidden in nsIFocusManager; r=hsivonen
And make nsFocusManager::WindowHidden just returning void given all caller
doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91291
2020-09-29 07:21:59 +00:00
Edgar Chen
d67ddfd730 Bug 1667081 - Part 4: Remove windowShown in nsIFocusManager; r=hsivonen
And make nsFocusManager::WindowShown just returning void given all caller
doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91290
2020-09-29 07:21:47 +00:00
Edgar Chen
371bf1841b Bug 1667081 - Part 3: Remove windowLowered in nsIFocusManager; r=hsivonen
And make nsFocusManager::WindowLowered just returning void given all caller
doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91289
2020-09-29 07:21:34 +00:00
Edgar Chen
7105edba6b Bug 1667081 - Part 2: Remove windowRaised in nsIFocusManager; r=hsivonen
And make nsFocusManager::WindowRaised just returning void given all caller
doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91288
2020-09-29 07:21:22 +00:00
Bogdan Tara
65af1066d4 Backed out 9 changesets (bug 1667081) for assertion failure on nsFocusManager CLOSED TREE
Backed out changeset 156ab3eba505 (bug 1667081)
Backed out changeset 2e37f347082c (bug 1667081)
Backed out changeset 8f59cef879ae (bug 1667081)
Backed out changeset 1298ff140218 (bug 1667081)
Backed out changeset 91342c822425 (bug 1667081)
Backed out changeset aafb1878c590 (bug 1667081)
Backed out changeset 2252e975f0d7 (bug 1667081)
Backed out changeset c3bac5f407d2 (bug 1667081)
Backed out changeset b1e6e81396ae (bug 1667081)
2020-09-28 20:02:52 +03:00
Edgar Chen
ab031bbefd Bug 1667081 - Part 9: Remove SetFocusedWindowWithCallerType in nsIFocusManager; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D91346
2020-09-28 14:05:53 +00:00
Edgar Chen
263bae57a6 Bug 1667081 - Part 8: Remove parentActivated in nsIFocusManager; r=hsivonen
And make nsFocusManager::ParentActivated just returning void given all caller
doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91294
2020-09-28 14:05:40 +00:00
Edgar Chen
96817a1047 Bug 1667081 - Part 7: Remove focusPlugin in nsIFocusManager; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D91293
2020-09-28 14:05:28 +00:00
Edgar Chen
3b09aa5968 Bug 1667081 - Part 6: Remove fireDelayedEvents in nsIFocusManager; r=hsivonen
This patch also does following changes,
- Assert aDocument instead of early return given all caller passes a non-null document.
- Make it returning void given all caller doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91292
2020-09-28 14:05:20 +00:00
Edgar Chen
11c31c123b Bug 1667081 - Part 5: Remove windowHidden in nsIFocusManager; r=hsivonen
This patch also does following changes,
- Assert aWindow instead of early return and ensure that caller pass a non-null window.
- Make it returning void given all caller doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91291
2020-09-28 14:05:07 +00:00
Edgar Chen
7c3135ec84 Bug 1667081 - Part 4: Remove windowShown in nsIFocusManager; r=hsivonen
This patch also does following changes,
- Assert aWindow instead of early return and ensure that caller pass a non-null window.
- Make it returning void given all caller doesn't actaully check the return value.

Differential Revision: https://phabricator.services.mozilla.com/D91290
2020-09-28 14:04:50 +00:00