Commit graph

162 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
f2d4b8c005 Bug 1699570 - Make mouse_focuses_formcontrol on chrome documents match the old behavior. r=mstange
For that, we make accessibility.mouse_focuses_formcontrol a static pref,
and make it work in all platforms because it's simpler and allows to
test mac-specific things on other platforms more easily.

Differential Revision: https://phabricator.services.mozilla.com/D109006
2021-03-18 23:01:45 +00:00
Emilio Cobos Álvarez
52e3823a9c Bug 1699154 - Tweak focusring heuristics for script focus. r=edgar
What we implemented before this patch was basically what the heuristics
in the spec said, which used to be normative:

  https://drafts.csswg.org/selectors/#the-focus-visible-pseudo

That has become non-normative and there's ongoing discussion on what
should happen for cases like this in:

  https://github.com/w3c/csswg-drafts/issues/5885
  https://github.com/web-platform-tests/wpt/pull/27806

There seems to be agreement on that WPT issue on cases like this one, so
let's make it work.

Differential Revision: https://phabricator.services.mozilla.com/D108805
2021-03-18 19:53:38 +00:00
smolnar
b2e94b592b Backed out changeset 74ab7aa60b1a (bug 1699154) for causing reftest failures. CLOSED TREE 2021-03-18 18:39:44 +02:00
Emilio Cobos Álvarez
b892d58030 Bug 1699154 - Tweak focusring heuristics for script focus. r=edgar
What we implemented before this patch was basically what the heuristics
in the spec said, which used to be normative:

  https://drafts.csswg.org/selectors/#the-focus-visible-pseudo

That has become non-normative and there's ongoing discussion on what
should happen for cases like this in:

  https://github.com/w3c/csswg-drafts/issues/5885
  https://github.com/web-platform-tests/wpt/pull/27806

There seems to be agreement on that WPT issue on cases like this one, so
let's make it work.

Differential Revision: https://phabricator.services.mozilla.com/D108805
2021-03-18 15:08:31 +00:00
smolnar
8b8afdb266 Backed out changeset 1c8b807651b8 (bug 1699154) for causing mochitest failures in test_focusrings.xhtml CLOSED TREE 2021-03-18 15:46:51 +02:00
Emilio Cobos Álvarez
1cad7af959 Bug 1699154 - Tweak focusring heuristics for script focus. r=edgar
What we implemented before this patch was basically what the heuristics
in the spec said, which used to be normative:

  https://drafts.csswg.org/selectors/#the-focus-visible-pseudo

That has become non-normative and there's ongoing discussion on what
should happen for cases like this in:

  https://github.com/w3c/csswg-drafts/issues/5885
  https://github.com/web-platform-tests/wpt/pull/27806

There seems to be agreement on that WPT issue on cases like this one, so
let's make it work.

Differential Revision: https://phabricator.services.mozilla.com/D108805
2021-03-18 12:34:31 +00:00
Alexandru Michis
c3d50b35db Backed out changeset e072b56f8518 (bug 1696908) for causing bc failures in browser_bug1303838.js
CLOSED TREE
2021-03-12 12:00:52 +02:00
Henri Sivonen
58b09235a5 Bug 1696908 - Ensure parent-managed order of setting the focused browsing context. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D98134
2021-03-12 07:45:36 +00:00
Henri Sivonen
4a7c55c8ad Bug 1691892 - Reject stale active browsing context setting attempts by action id in content processes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D107192
2021-03-10 05:36:48 +00:00
Edgar Chen
7ae2dc0d78 Bug 1677474 - Part 3: Trigger blur steps when window needs to adjust its focused element; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D104538
2021-03-02 10:17:16 +00:00
Edgar Chen
10cc0a11f4 Bug 1677474 - Part 2: Refine AdjustWindowFocus IPC flow; r=hsivonen
When there is two-level nested iframe, like, a.com contains an iframe b.com,
and b.com contains an iframe c.com, when script in c.com calls window.focus()
to get the focus, we need to adjust the activeElement in a.com and b.com.

Currently, it needs to bounce IPC twice to make a.com get updated. This patch
tries to make a.com could be updated sooner, so when parent process recive the
adjustWindowFocus IPC from process of c.com, it will notify process of b.com
and a.com at the same time.

Differential Revision: https://phabricator.services.mozilla.com/D105659
2021-03-02 10:17:15 +00:00
Henri Sivonen
9d6d02b341 Bug 1663931 - Avoid moving focus when changing iframe remoteness. r=nika,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D99215
2021-02-22 10:51:51 +00:00
Emilio Cobos Álvarez
ba7c09d55d 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.

Depends on D104861

Differential Revision: https://phabricator.services.mozilla.com/D104863
2021-02-15 19:08:42 +00:00
Emilio Cobos Álvarez
6e886fe86a 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 19:08:42 +00:00
Mihai Alexandru Michis
02101824c8 Backed out 2 changesets (bug 1689155) for causing bc failures in browser_outline_refocus.js
CLOSED TREE

Backed out changeset bf4ed0fa612b (bug 1689155)
Backed out changeset 78a47c967db3 (bug 1689155)
2021-02-15 19:40:05 +02:00
Emilio Cobos Álvarez
95bf7fdb4a 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
d871818995 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
Mirko Brodesser
f6f7a6f1aa Bug 1685303: part 8) Annotate nsFrameSelection::SetDragState with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 13:24:16 +00:00
Bogdan Tara
0700454a9e Backed out 4 changesets (bug 1685303) for bustage complaining about offsets CLOSED TREE
Backed out changeset a4640aac6619 (bug 1685303)
Backed out changeset bd2020c26531 (bug 1685303)
Backed out changeset 3f2e96b93f19 (bug 1685303)
Backed out changeset 8cf49a7677c9 (bug 1685303)
2021-01-14 12:58:25 +02:00
Mirko Brodesser
353996bf27 Bug 1685303: part 8) Annotate nsFrameSelection::SetDragState with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 10:20:30 +00:00
Kagami Sascha Rosylight
8ab2900b08 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
d48fbe94ab 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
Simon Giesecke
dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Steven MacLeod
6cd960cfb3 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
Noemi Erli
60669a2ed8 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
2c4c433439 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
96ae695458 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
ac6e97d5f9 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
117f50f8ce 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
Makoto Kato
a01752f95a 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
27c71b7935 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
5db823035c 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
7bab46fd53 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
70ebd88a90 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
6c22b717c7 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
e83ae66fc1 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
2a18e0fc77 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
6bf9a2e159 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
8f6c53bdf5 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
34b033f00c 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
d2446c5649 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
9afea6d181 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
88ac2b180d 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
3f33767fae 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
48aeb65d38 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
Edgar Chen
0a849192c3 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
a60331bed5 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
260bce2e82 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
Henri Sivonen
0f71e396be 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
Henri Sivonen
6ff074dacc 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