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

3664 Коммитов

Автор SHA1 Сообщение Дата
Mirko Brodesser 8d922ea417 Bug 1744524: part 1) Add JS code for the "Paste" menupopup to handle `ClipboardReadTextPaste` events created from the C++ side. r=edgar,Gijs
Implements showing a "Paste" popup at the last mouse position (which
overlapped the browser window) when a certain custom event is received.
Creating and dispatchting that event is implemented in one of the
following parts.

Differential Revision: https://phabricator.services.mozilla.com/D135333
2022-06-16 14:43:40 +00:00
Emilio Cobos Álvarez 255763ef57 Bug 1773070 - Unify Gecko and Servo EventState/ElementState bits. r=smaug
Add a dom/base/rust crate called just "dom" where we can share these.

Most of the changes are automatic:

  s/mozilla::EventStates/mozilla::dom::ElementState/
  s/EventStates/ElementState/
  s/NS_EVENT_STATE_/ElementState::/
  s/NS_DOCUMENT_STATE_/DocumentState::/

And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.

Differential Revision: https://phabricator.services.mozilla.com/D148537
2022-06-07 23:09:52 +00:00
Masayuki Nakano 77df1d2c4c Bug 1680611 - part 10: Mark `nsFocusManager::Flush*()` and their callers in `nsFocusManager` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147069
2022-05-26 04:37:21 +00:00
Masayuki Nakano 728f08af35 Bug 1680611 - part 8: Mark `nsFocusManager::Blur` and its callers in `nsFocusManager` as `MOZ_CAN_RUN_SCRIPT` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147067
2022-05-26 04:37:20 +00:00
Masayuki Nakano cdfbc99cdf Bug 1680611 - part 6: Mark `nsFocusManager::MoveCaretToFocus()` and its callers in `nsFocusManager` as `MOZ_CAN_RUN_SCRIPT` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147065
2022-05-26 04:37:19 +00:00
Masayuki Nakano c8fc1057ba Bug 1680611 - part 2: Mark `nsFocusManager::SetFocusedWindowWithCallerType` and its callers in `nsFocusManager` as `MOZ_CAN_RUN_SCRIPT` r=smaug,media-playback-reviewers,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D147061
2022-05-26 04:37:18 +00:00
Frederik Braun b0ac62bc86 Bug 1740263 - CSP parser and context changes for wasm-unsafe-eval. r=ckerschb,freddyb
Differential Revision: https://phabricator.services.mozilla.com/D136219
2022-05-19 14:13:48 +00:00
Iulian Moraru 4d59317ca4 Backed out 6 changesets (bug 1740263) for causing bp-hybrid bustages on nsScriptSecurityManager. CLOSED TREE
Backed out changeset 2f5ec6ad0f81 (bug 1740263)
Backed out changeset a1e7766cdb94 (bug 1740263)
Backed out changeset 3978ccb95455 (bug 1740263)
Backed out changeset e34ba774b3f8 (bug 1740263)
Backed out changeset 8365b10be28e (bug 1740263)
Backed out changeset d923462c9cd0 (bug 1740263)
2022-05-19 03:28:08 +03:00
Frederik Braun 200cb0034c Bug 1740263 - CSP parser and context changes for wasm-unsafe-eval. r=ckerschb,freddyb
Differential Revision: https://phabricator.services.mozilla.com/D136219
2022-05-18 21:39:28 +00:00
Nika Layzell e1e439a7b1 Bug 1769619 - Introduce nsIDocShellTreeOwner::primaryContentBrowsingContext, r=smaug
This is currently effectively just a helper around the existing
properties. Theoretically we could streamline things here in the future
by managing primary content entirely based on BrowsingContext rather
than docshell, but there's enough complexity there right now with other
properties like updating properties on content shells as they're
attached, that it's probably not worth trying to unify right now,
especially considering the low number of consumers.

Differential Revision: https://phabricator.services.mozilla.com/D146495
2022-05-17 22:11:33 +00:00
Emilio Cobos Álvarez 9fffb1830a Bug 1769758 - Remove window.mozPaintCount. r=webidl,peterv
We unshipped it successfully a while ago (bug 1591968).

Differential Revision: https://phabricator.services.mozilla.com/D146575
2022-05-17 14:14:10 +00:00
David Parks 030a726af8 Bug 1766082: Allow content to wait for parent screen transforms r=emilio
Content processes can provide screen coordinates in e.g. window objects and events without waiting for the proper client-to-screen transforms to be given to them from the parent process.  This poses a problem for tests that want to check the screen coordinates, so we add SpecialPowers.ContentTransformsReceived() to allow content processes to wait for these transforms.

Differential Revision: https://phabricator.services.mozilla.com/D144742
2022-05-02 20:43:12 +00:00
Makoto Kato 34944ac4bd Bug 1757031 - Don't restore previous viewport when window size isn't same. r=emilio
Fenix's Picture-In-Picture uses full screen mode. So it isn't same as Firefox
Desktop. When exiting full screen, Fenix's window may not same as before
entering full screen.

When this occurs,

1. When device is portrait orientation, user changes to full screen by content
   script.
2. Fenix enters to full screen then orientation is changed to landscape.
3. User changes that device is changed to landscape by hand.
4. Fenix enters PiP mode. Android (Home screen) change to portrait orientation.
   Then PiP window keeps landscape orientation.
5. When exiting PiP, full screen will be exited.
6. Device is landscape (by Step 3.), so Fenix window is landscape. But Gecko
   restores 1.'s viewport by `nsIDOMWindowUtils.exitFullScreen`. So viewport
   becomes portrait orientation size even if window is landscape orientation.

For PiP mode, although nsIDOMWindowUtils.exitFullScreen is used, it doesn't
consider this situation. So I would like to add non-restore option for it.

Differential Revision: https://phabricator.services.mozilla.com/D143992
2022-05-02 13:00:39 +00:00
Makoto Kato cf9e71c1d9 Bug 1757431 - Update orientation lock information in browsing context when exiting full screen. r=smaug
Orientation lock allows on full screen state only now. Then if exiting full
screen, orientation lock is unlocked without `screen.orientation.unlock` call.

Although we store orientation lock state in browsing context, we don't clear
when exiting full screen. So when current content is re-activated by switching
tab etc, we try to apply orientation lock state from browsing context
unfortunately.

So we should clear this state when exiting full screen even if `unlock` isn't
called.

Differential Revision: https://phabricator.services.mozilla.com/D142938
2022-04-11 04:11:22 +00:00
Timothy Nikkel 4cac1c7814 Bug 1763121. nsIDOMWindowUtils::sendNativeTouchpadPan should use an observer to notify when the event has been sent to the destination widget. r=hiro
Otherwise we can return without the widget even seeing the event. This is how other test functions are implemented.

We need this to make the test in bug 1757928 pass.

Differential Revision: https://phabricator.services.mozilla.com/D142943
2022-04-05 22:53:35 +00:00
Cathy Lu b5b91ffc69 Bug 1753700 - Add priorityHint to allow apps to increase process priority for background tabs r=geckoview-reviewers,mccr8,agi
Prior behavior for active tabs in an inactive app would have the process priority oom score of 15. Now it's set to a higher priority oom score of 11. This will increase priority for recently used tabs on apps and prevent Android from unloading them.

Differential Revision: https://phabricator.services.mozilla.com/D142386
2022-04-04 17:41:37 +00:00
Mike Conley dd9df31950 Bug 1762653 - Expose EventStateManager::IsKeyboardEventUserActivity on nsIDOMWindowUtils. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D142728
2022-04-04 13:33:35 +00:00
Butkovits Atila f60ac86be0 Backed out 2 changesets (bug 1728331) for causing failures at RTCPeerConnection-videoDetectorTest.html. CLOSED TREE
Backed out changeset b6649f0253c5 (bug 1728331)
Backed out changeset e9242af1224d (bug 1728331)
2022-03-29 00:04:47 +03:00
Nika Layzell 66b31a7ed2 Bug 1728331 - Part 1: Avoid cycling between processes when navigating within a tab, r=smaug
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.

This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.

I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.

Differential Revision: https://phabricator.services.mozilla.com/D126405
2022-03-28 16:18:04 +00:00
Hiroyuki Ikezoe 1bbdcb99db Bug 1760222 - Add an API for JS to tell whether the document has scroll-linked effects or not. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141456
2022-03-27 23:40:23 +00:00
Cristian Tuns f0ccbd470c Backed out 4 changesets (bug 1760222) for causing reftest failures on disable-apz-for-sle-pages.html CLOSED TREE
Backed out changeset 1bf5e1ca3746 (bug 1760222)
Backed out changeset aff6bf37365d (bug 1760222)
Backed out changeset e9b3e3f52aec (bug 1760222)
Backed out changeset f65d2d719277 (bug 1760222)
2022-03-24 02:36:42 -04:00
Hiroyuki Ikezoe cb22bc42da Bug 1760222 - Add an API for JS to tell whether the document has scroll-linked effects or not. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D141456
2022-03-24 02:20:46 +00:00
Emilio Cobos Álvarez 79f3fe026d Bug 1759962 - Don't return the DPI override in devicePixelRatio to privileged code. r=nchevobbe,webdriver-reviewers
Chrome code should be able to rely on CSS pixel * devicePixelRatio =
device pixel.

Chrome code that cares about the override should use
BrowsingContext.overrideDPPX. We were exposing the no-override value in
WindowUtils but that's unneeded now.

Differential Revision: https://phabricator.services.mozilla.com/D141323
2022-03-23 17:03:04 +00:00
Peter Van der Beken 9bef896e2f Bug 1760016 - Stop using nsIVariant for the history state object. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D141351
2022-03-17 18:35:40 +00:00
Daniel Holbert 64d51aae31 Bug 1756269: Add nsIDOMWindowUtils.refreshDriverHasPendingTick API, for use in regression tests. r=smaug
This API essentially reports whether the refresh driver is actively consuming
CPU.  This is intended for use in regression tests for bugs about the refresh
driver needlessly cycling.

Differential Revision: https://phabricator.services.mozilla.com/D139218
2022-02-24 00:30:51 +00:00
Marian-Vasile Laza 74fa81af19 Backed out 2 changesets (bug 1756118, bug 1756269) for causing linting failures.
Backed out changeset a2dbff9da48a (bug 1756118)
Backed out changeset c247f77150c2 (bug 1756269)
2022-02-23 14:55:06 -08:00
Daniel Holbert 946ecff756 Bug 1756269: Add nsIDOMWindowUtils.refreshDriverHasPendingTick API, for use in regression tests. r=smaug
This API essentially reports whether the refresh driver is actively consuming
CPU.  This is intended for use in regression tests for bugs about the refresh
driver needlessly cycling.

Differential Revision: https://phabricator.services.mozilla.com/D139218
2022-02-23 22:19:42 +00:00
Marian-Vasile Laza e190b0cbf1 Backed out changeset 996c13e87e7c (bug 1756269) for causing mochitest failures on mochitest.ini. CLOSED TREE 2022-02-23 12:12:48 -08:00
Daniel Holbert 552bed68ab Bug 1756269: Add nsIDOMWindowUtils.refreshDriverHasPendingTick API, for use in regression tests. r=smaug
This API essentially reports whether the refresh driver is actively consuming
CPU.  This is intended for use in regression tests for bugs about the refresh
driver needlessly cycling.

Differential Revision: https://phabricator.services.mozilla.com/D139218
2022-02-23 17:56:10 +00:00
Molly Howell 469e3fea9d Bug 1598312 - Support setting a custom resize margin, and apply that to Picture-in-Picture windows. r=cmartin,emilio
Differential Revision: https://phabricator.services.mozilla.com/D138725
2022-02-17 23:18:45 +00:00
Masayuki Nakano b09787841e Bug 1746104 - part 5-3: Make `SelectionChangeDataBase` treat no range case r=m_kato
Unfortunately, it cannot has `Maybe` because of used by a union.  Therefore,
it needs to manage with `bool` members of whether it's initialized with or
without error and whether it has a range.

Note that this changes `nsITextInputProcessorCallback.idl` which is currently
only for automated tests too.  The new behavior will be tested by the last
patch in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D137424
2022-02-07 22:33:38 +00:00
Emilio Cobos Álvarez b699e8cdc8 Bug 1753995 - Remove nsDOMWindowUtils.screenPixelsPerCSSPixel. r=smaug,dholbert
For all purposes, this is the same as devicePixelRatio. It was meant to
skip the resistFingerprinting check the devicePixelRatio getter does,
but we do that now using CallerType in WebIDL, so if we cared about that
for these tests (which we don't) we could just do
SpecialPowers.wrap(window).devicePixelRatio.

As a follow-up we could move the NoOverride to window for symmetry. But
it's only used by devtools touch simulation so not sure if worth it.

Differential Revision: https://phabricator.services.mozilla.com/D138021
2022-02-07 18:23:36 +00:00
Mike Conley 038eb21cc2 Bug 1749825 - Make it possible for privileged script to opt elements into mousewheel autodir/honour root behaviour. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D135914
2022-01-21 16:12:48 +00:00
Kagami Sascha Rosylight 429a324f31 Bug 1539884 - Part 21: Mark nsIDOMXULCommandDispatcher::updateCommands as can_run_script r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D134353
2021-12-23 16:27:20 +00:00
Emilio Cobos Álvarez a6fb6742a0 Bug 1744749 - Add an API to get the real canvas background color. r=jwatt
Extensions are using getComputedStyle(body).backgroundColor, which is
wrong at multiple levels.

The one that matters for this bug is that it is not color-scheme aware.

Depends on D133770

Differential Revision: https://phabricator.services.mozilla.com/D133771
2021-12-16 14:56:32 +00:00
Luca Greco fe9a6a9fa6 Bug 1728327 - Introduce a new nsIServiceWorkerManager.wakeForExtensionAPIEvent method. r=asuth
This patch includes a set of changes to the ServiceWorker internals to introduce a new
nsIServiceWorkerManager.wakeForExtensionAPIEvent method, to be used by the WebExtensions internals
to request an active background service worker to be spawned (if it is not yet) in response to
a WebExtension API event.

The new method gets as parameters:

- the scope URL for the extension background service worker to spawn
- WebExtensions API namespace and API event name which we are going to spawn an active worker for

and return a promise which would be:
- rejected if the worker could not be spawned
- resolved to a boolean if the worker was spawned successfully (or already running)

The value of the boolean value resolved is meant to represent if the worker did actually
have any listener subscribed for the given WebExtensions API event listener
(which the WebExtensions internals may then use to decide if it is worth to send that event
to be handled by the worker script or not).

In this patch the ExtensionBrowser::HasWakeupEventListener used to determine if an WebExtensions
API event was subscribed syncronously when the worker was being loaded is not implemented yet
and it is always returning false (a proposed implementation for that method is going to be
added in a separate patch part of this same bugzilla issue).

A unit test for the new proposed nsIServiceWorkerManager method is also part of a separate patch
(attached to this bugzilla issue as the child revision for this one).

Differential Revision: https://phabricator.services.mozilla.com/D130756
2021-12-15 18:29:36 +00:00
Emilio Cobos Álvarez c9d4405306 Bug 1743310 - Remove paint flashing. r=gfx-reviewers,lsalzman
It's only meaningfully read in two places:

 * WebRender fallback code.
 * Some widget DEBUG-only code, which on Linux is ifdef'd and on Windows does
   some rather sketchy things like sleeping for 30ms

So I think it should be ok to remove, since WR fallback has its own flashing
pref as well, IIUC.

Differential Revision: https://phabricator.services.mozilla.com/D132313
2021-11-30 11:46:08 +00:00
Marcos Cáceres a916f856db Bug 1735097 - Geolocation: use EpochTimeStamp instead of DOMTimeStamp r=saschanaz,peterv
Just a refactor, based on: https://github.com/w3c/geolocation-api/pull/104

Differential Revision: https://phabricator.services.mozilla.com/D128047
2021-11-17 04:01:02 +00:00
Marcos Cáceres 0f403e17c7 Bug 1735098 - Implement EpochTimeStamp from HR-Time r=edgar
Add the EpochTimeStamp, which can be used to incrementally rename/remove DOMTimeStamp. See also https://github.com/w3c/hr-time/pull/124 and https://github.com/whatwg/webidl/pull/1021

Differential Revision: https://phabricator.services.mozilla.com/D128030
2021-11-16 08:50:37 +00:00
Narcis Beleuzu 6deb8b6af5 Backed out changeset 3438d650eca8 (bug 1735098) for Linting opt failure. CLOSED TREE 2021-11-16 07:23:26 +02:00
Marcos Cáceres 04d9c2def4 Bug 1735098 - Implement EpochTimeStamp from HR-Time r=edgar
Add the EpochTimeStamp, which can be used to incrementally rename/remove DOMTimeStamp. See also https://github.com/w3c/hr-time/pull/124 and https://github.com/whatwg/webidl/pull/1021

Differential Revision: https://phabricator.services.mozilla.com/D128030
2021-11-16 05:01:49 +00:00
sotaro bf1f700f2b Bug 1739621 - Remove remaining UseAdvancedLayers() r=jrmuizel,gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D130467
2021-11-07 12:44:53 +00:00
Luca Greco 873a724d1c Bug 1728326 - Add GetRegistrationForAddonPrincipal to nsIServiceWorkerManager. r=asuth
This patch introduces a new getRegistrationForAddonPrincipal to nsIServiceWorkerManager.
This method is similar to the existing getRegistrationForPrincipal but:
- similarly to registerForAddonPrincipal it only gets the extension principal as its only
  input parameter.
- unlike getRegistrationForPrincipal, it doesn't throw if the registration has not been found
  (e.g. because it was already unregistered when the method was called).

Differential Revision: https://phabricator.services.mozilla.com/D124702
2021-11-05 21:27:04 +00:00
Marian-Vasile Laza a23f838d22 Backed out 10 changesets (bug 1728326) for causing build bustages. CLOSED TREE
Backed out changeset 39267f23ee63 (bug 1728326)
Backed out changeset 070f187c2005 (bug 1728326)
Backed out changeset f06e0af1bf81 (bug 1728326)
Backed out changeset d21475767077 (bug 1728326)
Backed out changeset 4ca5e36e3c71 (bug 1728326)
Backed out changeset fd700124d69b (bug 1728326)
Backed out changeset 5c8d87c04ac6 (bug 1728326)
Backed out changeset 247504b7ea84 (bug 1728326)
Backed out changeset de8879fc8126 (bug 1728326)
Backed out changeset ebf25d0924d6 (bug 1728326)
2021-11-05 22:48:14 +02:00
Luca Greco 3455869b8b Bug 1728326 - Add GetRegistrationForAddonPrincipal to nsIServiceWorkerManager. r=asuth
This patch introduces a new getRegistrationForAddonPrincipal to nsIServiceWorkerManager.
This method is similar to the existing getRegistrationForPrincipal but:
- similarly to registerForAddonPrincipal it only gets the extension principal as its only
  input parameter.
- unlike getRegistrationForPrincipal, it doesn't throw if the registration has not been found
  (e.g. because it was already unregistered when the method was called).

Differential Revision: https://phabricator.services.mozilla.com/D124702
2021-11-05 20:27:01 +00:00
Anny Gakhokidze 252c246034 Bug 1731613 - Move GetProcessSwitchBehavior method to C++, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D128898
2021-10-19 18:46:46 +00:00
Emilio Cobos Álvarez 4f8856c545 Bug 1730503 - Make RDM force Android-style scrollbars better. r=mstange,devtools-backward-compat-reviewers,nchevobbe
There are a few bits that still don't work with this patch but will with the
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D128083
2021-10-12 09:21:17 +00:00
Masayuki Nakano 36e01178c8 Bug 1729115 - part 1: Make it possible tests to retrieve a node being observed by `IMEContentObserver` for the following changes r=smaug
For making it possible to check whether an expected node is observed by
`IMEContentObserver` or not in mochitest, the following patches need this API.

Differential Revision: https://phabricator.services.mozilla.com/D127610
2021-10-12 04:41:13 +00:00
Timothy Nikkel 302fe551ae Bug 1733025. Convert coords correctly when sending cmd_lookUpDictionary (macOS lookup) to child process. r=hiro
this.browser in toolkit/actors/ControllersParent.jsm is the top level browser, ie the browser holding the root content document. So the conversion that happens in that file converts the coordinates to be relative to the root content document, but they need to be relative to the root of whichever child process we are sending the event to.

The best way I found out how to do this was to pass the coords down to the child process still relative to the parent process widget and then in the child process use the child to parent transform matrix to make them relative to the root widget in the child process.

I needed a new nsIDOMWindowUtils functions because I don't think there is anything existing to do this.

Differential Revision: https://phabricator.services.mozilla.com/D126861
2021-10-06 10:43:20 +00:00
Mirko Brodesser c61c10a2ce Bug 1731994: part 8) Rename `nsIContentPermissionRequest`'s `isHandlingUserInput` to `hasValidTransientUserGestureActivation`. r=edgar
It's more accurate.

Differential Revision: https://phabricator.services.mozilla.com/D126916
2021-10-04 12:16:00 +00:00