Граф коммитов

114 Коммитов

Автор SHA1 Сообщение Дата
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
Simon Giesecke e6422e2afd Bug 1626570 - Remove obsolete copy enabling machinery. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D72176
2020-05-11 08:23:03 +00:00
Henri Sivonen 45aad1c320 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
Simon Giesecke 58d0171406 Bug 1620632 - Ensure nsTArray_Impl only declares a copy-constructor/assignment operator if E is copy-constructible. r=froydnj
To correctly implement this, it must be known on instantiation whether E is
copy-constructible, which is not the case if only a forward declaration is
available. This can be resolved either by making sure a full definition of E is
available, which is preferable. But in cases where this is not (easily) possible,
the information can be explicitly provided by the MOZ_DECLARE_COPY_CONSTRUCTIBLE
and MOZ_DECLARE_NON_COPY_CONSTRUCTIBLE macros. In particular, declarations for
IPDL-declared types are added to nsTArray.h itself, like it was already done
for MOZ_DECLARE_RELOCATE_USING_MOVE_CONSTRUCTOR.

Differential Revision: https://phabricator.services.mozilla.com/D66244

--HG--
extra : moz-landing-system : lando
2020-03-20 17:13:51 +00:00
Henri Sivonen 1f2c022aca 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

--HG--
extra : moz-landing-system : lando
2020-03-20 11:45:49 +00:00
Mirko Brodesser ec9cb4d8ef Bug 1622199: annotate `Selection::AddRangeAndSelectFramesAndNotifyListeners` with `MOZ_CAN_RUN_SCRIPT`. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D66759

--HG--
extra : moz-landing-system : lando
2020-03-13 15:46:13 +00:00
Timothy Nikkel 2baf261d29 Bug 1616373. Handle the browsing context housing the active window moving to a different content process. r=hsivonen
My understanding of the problem is as follows. We create the main content document, first it is about:blank in a content process. When the bug happens the about:blank document has WindowRaised called on it and this makes it the active window, and then it tells the parent process that it is the active browsing context (via SendSetActiveBrowsingContext). When the bug doesn't happen this doesn't happen, perhaps because we navigate away from about:blank before it can happen.

So the browsing context navigates to the new document and it gets moved to a different content process. BrowsingContextGroup::EnsureSubscribed is called, if the parent process got told of the active document above then we call SendSetupFocusedAndActive (if it didn't then the active browsing context remains null and so it doesn't call SendSetupFocusedAndActive). When the child gets RecvSetupFocusedAndActive it calls SetActiveBrowsingContextFromOtherProcess on the focus manager.

nsFocusManager::WindowRaised is called for the new document, we bail early because of this line

https://searchfox.org/mozilla-central/rev/d5b34cc8872177d3ee071e06f787c2a14268595b/dom/base/nsFocusManager.cpp#661

because we are the browsing context that was set from another process. And so we fail to make the Focus call at the end of that function. So mFocusedWindow remains null in the child process.

The nsFocusManager::WindowShown call that happens for every new document load thus does not do anything because this line

https://searchfox.org/mozilla-central/rev/d5b34cc8872177d3ee071e06f787c2a14268595b/dom/base/nsFocusManager.cpp#906

always fails because mFocusedWindow is null and it never changes.

Differential Revision: https://phabricator.services.mozilla.com/D65302

--HG--
extra : moz-landing-system : lando
2020-03-05 03:27:57 +00:00
Henri Sivonen 8fcc291b3c Bug 1618803 - Remove nsFocusManager::SetActiveWindowWithCallerType. r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D64727

--HG--
extra : moz-landing-system : lando
2020-03-02 09:52:58 +00:00
Emilio Cobos Álvarez de54b68ce7 Bug 1617600 - Prototype :focus-visible behind a flag. r=smaug
The heuristic is that we show focus outlines for unknown or key focus, and not
for mouse / touch.

This is probably not the final heuristic we take, but this allows people to play
with it and file bugs.

Once this is mature enough we should remove :-moz-focusring in favor of
:focus-visible.

Differential Revision: https://phabricator.services.mozilla.com/D63861

--HG--
extra : moz-landing-system : lando
2020-02-26 14:16:20 +00:00
Noemi Erli 4fb19079c8 Backed out 3 changesets (bug 1617600) for causing wpt failures in focus-visible-009.html CLOSED TREE
Backed out changeset 73d1a5e10337 (bug 1617600)
Backed out changeset b722714830cd (bug 1617600)
Backed out changeset 45464d926bf0 (bug 1617600)
2020-02-26 01:46:31 +02:00
Emilio Cobos Álvarez 490c70ecc0 Bug 1617600 - Prototype :focus-visible behind a flag. r=smaug
The heuristic is that we show focus outlines for unknown or key focus, and not
for mouse / touch.

This is probably not the final heuristic we take, but this allows people to play
with it and file bugs.

Once this is mature enough we should remove :-moz-focusring in favor of
:focus-visible.

Differential Revision: https://phabricator.services.mozilla.com/D63861

--HG--
extra : moz-landing-system : lando
2020-02-25 17:58:28 +00:00
Henri Sivonen ac7d3f7b2a Bug 1556627 - Make nsFocusManager::SetFocus work in Fission. r=NeilDeakin,farre,masayuki
Differential Revision: https://phabricator.services.mozilla.com/D55651

--HG--
extra : moz-landing-system : lando
2020-02-18 13:30:04 +00:00
pbz 70e1dba79e Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55811

--HG--
extra : moz-landing-system : lando
2020-01-16 14:38:40 +00:00
Emilio Cobos Álvarez 29800f6c89 Bug 1595435 - Allow content to steal focus from a cross-origin iframe. r=masayuki
This matches other browsers.

Keep the restriction just to chrome nodes, and in that case, avoid getting into
the broken state, which is what causes the issue. I'm not sure if this even
matters anymore given e10s but...

Differential Revision: https://phabricator.services.mozilla.com/D57475

--HG--
extra : moz-landing-system : lando
2019-12-25 06:50:25 +00:00
Oana Pop Rus 661db3a39f Backed out 7 changesets (bug 1432856) for build bustages failures in nsWindow.h on a CLOSED TREE
Backed out changeset 3d08c3cce533 (bug 1432856)
Backed out changeset 49d03dd89b17 (bug 1432856)
Backed out changeset 62fc84c8ce99 (bug 1432856)
Backed out changeset a8a4fa63f5b2 (bug 1432856)
Backed out changeset c81f3d5b9bf3 (bug 1432856)
Backed out changeset 8351a8b1d96a (bug 1432856)
Backed out changeset a303b775a51b (bug 1432856)
2019-12-16 23:53:35 +02:00
pbz e03ecc2171 Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55811

--HG--
extra : moz-landing-system : lando
2019-12-16 21:06:11 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Nicholas Nethercote a518709339 Bug 1587162 - Fix UBSAN complaints about pref callbacks. r=erahm
Lots of these callbacks have a non-`void*` final parameter, which UBSAN
complains about. This commit changes them to have a `void*` parameter.

This requires undoing the machinery added in the first two commits of bug
1473631: `TypePrefChangeFunc` and `PREF_CHANGE_METHOD`. The resulting code is
simpler (which is good) and more boilerplate-y (which is bad) but avoids the
undefined behaviour (which is good).

Differential Revision: https://phabricator.services.mozilla.com/D50901

--HG--
extra : moz-landing-system : lando
2019-11-01 02:57:20 +00:00
Emilio Cobos Álvarez b6728cedb7 Bug 1553769 - Have a single way of requesting window focus and switching to a tab. r=NeilDeakin,snorp
Right now there's some duplicated code with the focus manager and the
DOMWindowFocus event.

Android didn't handle the new framefocusrequested event, so the test-cases in
bug 416771 still didn't work there.

I think using the focus manager codepath everywhere is preferable. I confirmed
manually that the stuff that sent DOMWindowFocus events still works as expected
with this patch (i.e., switching to the right tab when you click on a
notification, etc.).

This fixes it so that it works in Fennec, and it sends the focus events right in
GeckoView Example (i.e., we get here[1] properly).

The snippet that Snorp provided on IRC to implement the "bring activity to
front" stuff (`startActivity(getIntent())`) didn't actually work for me, but I
confirmed that the right message is sent when the focus is requested, and that
we get there.

[1]: https://searchfox.org/mozilla-central/rev/952521e6164ddffa3f34bc8cfa5a81afc5b859c4/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#503

Depends on D32353

Differential Revision: https://phabricator.services.mozilla.com/D32354

--HG--
extra : moz-landing-system : lando
2019-06-03 19:42:28 +00:00
Masayuki Nakano 663f37d827 Bug 1547618 - Make dom use mozilla::PresShell rather than via nsIPresShell r=smaug
Additionally, this patch makes `nsContentUtils::DispatchXULCommand()` because
it guarantees the lifetime of **only** `PresShell` in it.  So, we need to check
the lifetime of each argument at each caller here.

Differential Revision: https://phabricator.services.mozilla.com/D29199

--HG--
extra : moz-landing-system : lando
2019-04-30 01:35:30 +00:00
Emilio Cobos Álvarez ccc940508d Bug 1546019 - When a focused browser changes remoteness, make sure to activate the remote browser if needed. r=qdot
Not quite sure what's a good way to add a test for this... Ideas?

Differential Revision: https://phabricator.services.mozilla.com/D29104

--HG--
extra : moz-landing-system : lando
2019-04-29 20:06:22 +00:00
Ryan Hunt 0eeced87be Bug 1534395 - Rename TabParent to BrowserParent. r=nika
This commit renames TabParent to BrowserParent.

Differential Revision: https://phabricator.services.mozilla.com/D28133

--HG--
rename : dom/ipc/TabParent.cpp => dom/ipc/BrowserParent.cpp
rename : dom/ipc/TabParent.h => dom/ipc/BrowserParent.h
extra : rebase_source : d2706b9f42177d8de16068b7b1d088a44b8720a4
extra : histedit_source : a617ddac45c58050ef799116a67d2d983f2a8f6d%2C1d1dabd8761a32d548a6fbf1027be960698f6a5e
2019-04-09 16:38:15 -05:00
Masayuki Nakano 3bd62fb08a Bug 1543315 - part 11: Mark nsIPresShell::ScrollContentIntoView() as MOZ_CAN_RUN_SCRIPT r=smaug
This patch marks `ScrollContentIntoView()` as `MOZ_CAN_RUN_SCRIPT` and changing
some callers of them to guarantee thar their parent callers are also safe.

Additionally, this patch moves it from `nsIPresShell` to `PresShell` because
all callers can refer `PresShell` directly.

Unfortunately, this patch changes a lot of methods in autocomplete and satchel
since this patch needs to mark some interface methods as `can_run_script` and
they are called each other.  This means that autocomplete module is really
sensitive like editor module.  Perhaps, autocomplete and satchel should do
scroll asynchronously and unmark some of them as `MOZ_CAN_RUN_SCRIPT` again.

Differential Revision: https://phabricator.services.mozilla.com/D28320

--HG--
extra : moz-landing-system : lando
2019-04-23 01:34:24 +00:00
Mirko Brodesser c3de4ebcfa Bug 1057858: ensure all frames for '<input type="number">' are created before choosing the nested element to be focused. r=smaug
- Avoids undesired bluring and focusing of '<input type="number">' and its nested elements.

- Add tests for two scenarios where this could occur.

Differential Revision: https://phabricator.services.mozilla.com/D27684

--HG--
extra : moz-landing-system : lando
2019-04-17 07:01:34 +00:00
Mirko Brodesser ed491dbad1 Bug 1374045: add 'preventScroll' option to HTMLElement's, SVGElement's and XULElement's 'focus' method r=smaug
- Remove expectation that 'preventScroll.html' fails.

- Use '[NoInterfaceObject] interface' workaround to simulate missing 'mixin' support.

Differential Revision: https://phabricator.services.mozilla.com/D26922

--HG--
extra : moz-landing-system : lando
2019-04-12 08:16:47 +00:00
Makoto Kato 2b62bb223e Bug 1474902 - Part 2. Make nsFocusManager::DetermineElementToMoveFocus public. r=NeilDeakin
Actually, there is no public method to get next element/content by tabIndex or
TAB key. So I would like to use GetNextTabbableContent from IMEStateManager.

Differential Revision: https://phabricator.services.mozilla.com/D12884

--HG--
extra : rebase_source : 48fa0bb3cd834e9458ad69be1a08f3f32afd1049
extra : histedit_source : 5ce46db9caf5e970e5ed31c0a9e30bd656242684
2019-04-05 17:12:27 +09:00
Edgar Chen f502ff0c72 Bug 1519090 - Part 1: Some minor nsFocusManager cleanup; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D16848

--HG--
extra : moz-landing-system : lando
2019-01-22 07:41:36 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Emilio Cobos Álvarez 10e4c5c339 Bug 1513141 - Really minor nsFocusManager cleanup. r=edgar
I was skimming over the patch in bug 1512043 and wrote this. I think it should
not really affect that patch in any meaningful way, so I may as well land it.

Differential Revision: https://phabricator.services.mozilla.com/D14129

--HG--
extra : moz-landing-system : lando
2018-12-11 11:25:02 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Henrik Skupin 80fec61f82 Bug 1489967 - Keep active state when Firefox is moved to background and focusmanager test mode is enabled. r=enndeakin
The test mode can be used to virtually give a Chrome window the
focus even with Firefox being in the background.

Currently when such a window has the focus and another application
is moved to the foreground, the active state is lost. This means that
for example Selenium tests which are run in parallel and using
different instances of Firefox will not receive the expected
"focus" and "blur" events.

This patch checks for the test mode and if enabled doesn't
lower the window, which will keep the focused state.

--HG--
extra : rebase_source : 2ee3a9c66327875628aa62d629582ee403fc090b
2018-09-10 15:03:04 +02:00
Olli Pettay d4b83a4a08 bug 1481079, Shadow DOM hosts should be focusable, r=mrbkap 2018-08-11 02:58:23 +03:00
Kris Maglione a16a23e56f Bug 1473631: Part 4 - Replace pref observers with callbacks in FocusManager. r=njn
MozReview-Commit-ID: 533Qz2nIkmX

--HG--
extra : rebase_source : 71e32db787b150b8ef3cee3163953c0adb893c92
2018-07-05 13:36:07 -07:00
Olli Pettay 30938bcddd Bug 1430020, let sequential focus navigation in shadow DOM enter iframes, r=mrbkap
--HG--
extra : rebase_source : 0ca436dfc8b28a680bdb393f0f9ce8ae0632bd9a
2018-04-28 16:07:06 +03:00
Boris Zbarsky 25aa42d9a4 Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Boris Zbarsky dd4506eee2 Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
shindli af700315a1 Backed out 2 changesets (bug 1457155, bug 1457156) for B failures in builds/worker/workspace/build/src/dom/html/HTMLObjectElement.cpp on a CLOSED TREE
Backed out changeset 8b2a6b54336c (bug 1457155)
Backed out changeset 4e267d999797 (bug 1457156)
2018-04-27 01:34:37 +03:00
Boris Zbarsky 25cec96459 Bug 1457155. Rename various focus manager variables to make it clearer that they're Elements. r=mccr8 2018-04-26 15:28:31 -04:00
Boris Zbarsky a3a6206b20 Bug 1456588 part 5. Store an Element as the focused content in the focus manager. r=enndeakin 2018-04-26 10:37:47 -04:00
Boris Zbarsky 01c62fd5cb Bug 1456588 part 4. Change nsFocusManager guts to make it clearer that the focused thing is always an Element. r=enndeakin
I couldn't find a good way to make this incremental without adding QIs and
AsElement() in various places....
2018-04-26 10:37:47 -04:00
Boris Zbarsky b3b21fd3fa Bug 1456588 part 3. Change nsFocusManager::SetFocusInner to take Element. r=enndeakin 2018-04-26 10:37:47 -04:00
Olli Pettay fa90e156dd Bug 1453693 - Ensure sequential focus navigation works in Shadow DOM and add some tests, r=mrbkap 2018-04-22 14:25:38 +03:00
Peter Van der Beken 01a1cdcd31 Bug 1448850 - Remove nsIMessageBroadcaster. r=bz.
--HG--
extra : rebase_source : c9ef8d762347b3c71dd5cfeffafbfbb81eb6e042
2018-02-14 17:35:39 +01:00
Emilio Cobos Álvarez a4486328c8 Bug 1433671: Add MOZ_CAN_RUN_SCRIPT annotations to AccessibleCaret and other stuff. r=bz
MozReview-Commit-ID: Js0CF7WQM73
2018-03-14 23:32:22 +01:00
ben.tian@gmail.com 75dc8c6853 Bug 1413834 - part 3: Get next tabbable content in shadow DOM, r=smaug
--HG--
extra : rebase_source : 9495f3cb3cf53bb7d67e6a59de551118a7f7d77d
2018-01-26 17:49:06 +02:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00