Commit Graph

680 Commits

Author SHA1 Message Date
Edgar Chen
d47f2956d1 Bug 1667081 - Part 3: Remove windowLowered in nsIFocusManager; r=hsivonen
This patch also does following changes,
- Assert aWindow instead of early return given all caller passes 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/D91289
2020-09-28 14:04:37 +00:00
Edgar Chen
c909206bc9 Bug 1667081 - Part 2: Remove windowRaised in nsIFocusManager; r=hsivonen
This patch also does following changes,
- Assert aWindow instead of early return given all caller passes 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/D91288
2020-09-28 14:04:25 +00:00
Edgar Chen
4959591727 Bug 1667050 - Convert nsFocusManager::sInstance into a StaticRefPtr; r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D91263
2020-09-25 00:06:45 +00:00
Edgar Chen
70952b3d57 Bug 1646493 - Make pointer auto-unlocking for active top-level document changes fission compatible; r=hsivonen
Unfortunately, this change makes content process and chrome process doesn't go
through the same code path because nsFocusManager handles their state
separately on purpose.

Differential Revision: https://phabricator.services.mozilla.com/D90033
2020-09-16 08:18:21 +00:00
Henri Sivonen
14ec224330 Bug 1613054 part 2 - On iframe.focus() create the initial about:blank for in-process case and treat the iframe as focusable for OOP case. r=nika
Test cases in https://bugzilla.mozilla.org/show_bug.cgi?id=1649099

Differential Revision: https://phabricator.services.mozilla.com/D88978
2020-09-10 10:44:34 +00:00
Razvan Maries
5348740250 Backed out changeset 5194d31bb88d (bug 1613054) for perma failures on browser_abort_visibility.js. CLOSED TREE 2020-09-09 21:11:25 +03:00
Henri Sivonen
35af3b9c37 Bug 1613054 part 2 - On iframe.focus() create the initial about:blank for in-process case and treat the iframe as focusable for OOP case. r=nika
Test cases in https://bugzilla.mozilla.org/show_bug.cgi?id=1649099

Differential Revision: https://phabricator.services.mozilla.com/D88978
2020-09-09 15:08:24 +00:00
Mihai Alexandru Michis
d33a3d0772 Backed out changeset 73f6874cb3dd (bug 1613054) for causing bc failures in browser_abort_visibility.js
CLOSED TREE
2020-09-09 16:40:24 +03:00
Henri Sivonen
c76004770f Bug 1613054 part 2 - On iframe.focus() create the initial about:blank for in-process case and treat the iframe as focusable for OOP case. r=nika
Test cases in https://bugzilla.mozilla.org/show_bug.cgi?id=1649099

Differential Revision: https://phabricator.services.mozilla.com/D88978
2020-09-09 12:09:44 +00:00
Henri Sivonen
1a9ba86cae Bug 1661281 - Use standard if formatting in nsFocusManager.cpp. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D88297
2020-08-26 15:48:13 +00:00
Henri Sivonen
8696b965aa Bug 1653160 - Avoid re-raising the PuppetWidget of an already-focused OOP iframe upon click. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87859
2020-08-26 15:53:31 +00:00
James Teh
e36939513d Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-27 00:41:42 +00:00
Narcis Beleuzu
532c44c109 Backed out changeset d8a3ede94c32 (bug 1660363) for bc failures on browser_modal_print.js . CLOSED TREE 2020-08-27 06:08:03 +03:00
James Teh
c81cf73c0c Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-27 00:41:42 +00:00
Mihai Alexandru Michis
4e637c9fe8 Backed out changeset 44d25518ea20 (bug 1660363) for causing bc failures in browser_modal_print.js
CLOSED TREE
2020-08-26 09:07:18 +03:00
James Teh
e718671a18 Bug 1660363: Don't treat elements inside print preview documents as focusable. r=emilio,mstriemer
Previously, IsFocusable returned true on elements in print preview documents, but the element wouldn't accept focus.
This meant that when you tried to tab, focus would get stuck on the document.
Now, IsFocusable returns false.
Thus, tab doesn't try to stop on these elements and can move out of the document.

Differential Revision: https://phabricator.services.mozilla.com/D88000
2020-08-26 04:59:27 +00:00
Henri Sivonen
42ebe26057 Bug 1656858 - Obtain principals differently in the parent process in SetFocusInner(). r=farre
Differential Revision: https://phabricator.services.mozilla.com/D85747
2020-08-05 06:30:44 +00:00
Kris Maglione
9e21e1bca7 Bug 1653922: Add missing null check. r=nika
IsSameOrAncestor used to accidentally do this when it walked the parent chain
using docshells rather than BrowsingContexts.

Differential Revision: https://phabricator.services.mozilla.com/D84237
2020-07-20 20:39:11 +00:00
Kris Maglione
ef1eed7bfd Bug 1646542: Fix GetInProcessParent usage in IsSameOrAncestor. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D80097
2020-07-15 20:17:52 +00:00
Chris H-C
ba58637cbb Bug 1647876 - Instrument window raised and lowered for FOG r=janerik,NeilDeakin
Depends on D81188

Differential Revision: https://phabricator.services.mozilla.com/D82417
2020-07-09 15:39:52 +00:00
Kagami Sascha Rosylight
54a7a45d7b Bug 1649931 - Part 3: Add nsIFrameEnumerator::Traverse() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81954
2020-07-03 00:48:59 +00:00
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Emilio Cobos Álvarez
a67b218bd4 Bug 1644366 - Restore behavior of selection into view to keep scrolling ancestors on focus. r=smaug
... yet keep respecting the preventScroll flag.

Differential Revision: https://phabricator.services.mozilla.com/D78900
2020-06-22 15:31:34 +00:00
Kris Maglione
b3de2b5b10 Bug 1644439: Don't force frame loader initialization during reflow from focus manager. r=hsivonen
When trying to get the current focused element during reflow, when the current
focused element in the document is a frame which has yet to be initialized,
attempting to walk through that frame's BrowsingContext causes immediate frame
loader initialization. Since frame loader initialization often requires running
scripts, that's unsafe, which is why we defer initialization until the end of
any in-progress reflow or document update.

This patch fixes the focus manager code to ignore any uninitialized frame
loaders it comes across, since by definition they cannot have any
currently-focused element until their subdocuments have been created.

Differential Revision: https://phabricator.services.mozilla.com/D79392
2020-06-12 10:22:56 +00:00
Emilio Cobos Álvarez
f998ecc386 Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
Csoregi Natalia
cdb2fbc2bc Backed out changeset 1884e1c2ccf4 (bug 1644366) for scrolling failures. CLOSED TREE 2020-06-09 21:18:42 +03:00
Emilio Cobos Álvarez
7bd2b63548 Bug 1644366 - Restore behavior of selection into view to keep scrolling ancestors on focus. r=smaug
... yet keep respecting the preventScroll flag.

Differential Revision: https://phabricator.services.mozilla.com/D78900
2020-06-09 16:15:04 +00:00
Henri Sivonen
54b79c6d2f Bug 1643618 - Stylistic fixes for bug 1634363. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D78464
2020-06-08 11:13:38 +00:00
Simon Giesecke
f2ebaa3c94 Bug 1642991 - Use RemoveElementsBy where easily possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78055
2020-06-08 09:01:48 +00:00
Henri Sivonen
eb33c51aeb Bug 1634363 - Avoid firing focus on iframe when raising window if actual focus out-of-process. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D75527
2020-06-04 19:02:38 +00:00
Emilio Cobos Álvarez
e973ef7275 Bug 1638127 - Fix a typo in an ifdef on a CLOSED TREE.
MANUAL PUSH: Mac bustage
2020-05-18 15:26:10 +02:00
Emilio Cobos Álvarez
ff5f360448 Bug 1638127 - Make Linux focus ring behavior match Windows, rather than Mac. r=karlt
The Mac focus model is a bit different (mouse doesn't focus form
controls for example).

This matches GTK3 to my knowledge, where outlines are not shown until
you've navigated with the keyboard.

We should maybe consider changing Android as well (and maybe all
platforms, actually), but that's a bit of a bigger endeavour.

Differential Revision: https://phabricator.services.mozilla.com/D75505
2020-05-18 10:33:14 +00:00
Emilio Cobos Álvarez
315c36ced8 Bug 1638127 - Remove nsGlobalWindowInner::mShowFocusRingForContent. r=edgar
Instead move the check to the focus manager, more similar to how
focus-visible works.

Now nsGlobalWindowInner::ShouldShowFocusRing means "Should we show focus
ring for anything in this window", that is: Have we keyboard-navigated
in this window, or do we have a pref that says that we should always
show focus rings.

Fix some callers appropriately (some of them that were not properly
accounting for the element being focused in the first place...).

Differential Revision: https://phabricator.services.mozilla.com/D75504
2020-05-16 18:03:54 +00:00
Csoregi Natalia
91624289d1 Backed out changeset a8850a0ffab1 (bug 1638127) for failures on test_focusrings.xhtml. CLOSED TREE 2020-05-16 00:44:59 +03:00
Emilio Cobos Álvarez
68c783aa87 Bug 1638127 - Remove nsGlobalWindowInner::mShowFocusRingForContent. r=edgar
Instead move the check to the focus manager, more similar to how
focus-visible works.

Now nsGlobalWindowInner::ShouldShowFocusRing means "Should we show focus
ring for anything in this window", that is: Have we keyboard-navigated
in this window, or do we have a pref that says that we should always
show focus rings.

Fix some callers appropriately (some of them that were not properly
accounting for the element being focused in the first place...).

Differential Revision: https://phabricator.services.mozilla.com/D75504
2020-05-15 20:12:14 +00:00
Sylvestre Ledru
f3c69f480a Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D73347
2020-05-09 14:51:53 +00:00
Henri Sivonen
62bd777560 Bug 1617788 - Restore focus in out-of-focus iframe after switching to another app and back even for non-keyboard causes. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D67878
2020-05-08 00:20:51 +00:00
Mirko Brodesser
12c86b26f7 Bug 1634663: part 1) Declare Selection::GetRangeAt's callers const around dom/ code. r=masayuki
Only where possible, of course.

Differential Revision: https://phabricator.services.mozilla.com/D73444
2020-05-02 23:43:02 +00:00
Kris Maglione
d040e38be1 Bug 1630691: Part 1 - Get rid of most of the remaining mozbrowser API. r=nika,mtigley,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D71226
2020-04-29 19:29:06 +00:00
Emilio Cobos Álvarez
82e251826d Bug 1627986 - Minor cleanup in the document navigation code. r=hsivonen
Just use early returns and such to simplify a bit.

Differential Revision: https://phabricator.services.mozilla.com/D70539
2020-04-14 09:58:42 +00:00
Emilio Cobos Álvarez
e36413c4d7 Bug 1629096 - Always honor scroll-margin / scroll-padding from nsFocusManager. r=masayuki
We should always do this, otherwise stuff may not end up being visible which is
not acceptable for focus navigation.

Differential Revision: https://phabricator.services.mozilla.com/D70541
2020-04-13 11:34:48 +00:00
Henri Sivonen
6263c9f929 Bug 1623092 - Avoid setting mActiveWindow in content processes. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D67191
2020-04-01 12:01:51 +00:00
Henri Sivonen
c4e039b829 Bug 1618539 - Remove content-process use of nsIFocusManager::GetActiveWindow. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D66416
2020-04-01 12:01:51 +00:00
Henri Sivonen
6c29aeb436 Bug 1620173 - Avoid reading mActiveWindow in a content process in WindowHidden. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D66184
2020-04-01 09:24:23 +00:00
Henri Sivonen
c6ecc76f39 Bug 1625465 - Hack GeckoViewUtils not to read activeWindow. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D68565
2020-03-30 16:10:41 +00:00
Henri Sivonen
09bb9be804 Bug 1572233 - Avoid moving the focus as if by keyboard when IME code merely probes for the next focusable. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D67462
2020-03-20 11:45:49 +00:00
Bogdan Tara
2333615f8b Backed out changeset e50cbce87f8d (bug 1618539) for nsFocusManager related crashes CLOSED TREE 2020-03-20 11:25:11 +02:00
Henri Sivonen
f4e0c8291e Bug 1618539 - Remove content-process use of nsIFocusManager::GetActiveWindow. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D66416
2020-03-20 08:25:58 +00:00
Henri Sivonen
b8a4f383ac Bug 1621903 - Avoid reading mActiveWindow from a content process in RaiseWindow in test mode. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D66194
2020-03-17 10:53:24 +00:00
Henri Sivonen
dcd0c75524 Bug 1620174 - Avoid reading mActiveWindow from a content process in RaiseWindow. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D66193
2020-03-11 15:10:33 +00:00