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

319 Коммитов

Автор SHA1 Сообщение Дата
Chris Martin 886c2c65a8 Bug 1657404 - Implement a strongly-typed, service-dependent gamepad handle r=handyman,aklotz
Currently, the gamepad code uses a uint32_t as a handle and does some trickery
with it by trying to create a unique ID and adding an offset to it for VR code.

This can (and has) led to errors where the developer forgets to perform the
arithmetic and sends the wrong number to the wrong manager.

This change created a strongly-typed handle that remembers which service it
belongs to. This should eliminate such accidents.

Differential Revision: https://phabricator.services.mozilla.com/D96273
2020-12-02 23:06:05 +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
Simon Giesecke 5bfbb2a572 Bug 1673931 - Avoid including Document.h from header files. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95046

Depends on D95045
2020-11-23 16:07:43 +00:00
Simon Giesecke fbfebfdada Bug 1673931 - Resolve Document/Element cycle. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95045

Depends on D94869
2020-11-23 16:07:21 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Emilio Cobos Álvarez a33ff60406 Bug 1676843 - Make innerWidth/innerHeight return the actual CSS size rather than a rounded version of it. r=heycam
On Nightly, for now. This allows websites to get the real viewport size.

The rounded size has caused problems in the past (see bug 1648298 / bug
1648265), and changing it would be ideal.

I told the CSSWG that we can experiment with this on Nightly to
alleviate (or prove) compat concerns, in which case we'd need to use a
different solution, see https://github.com/w3c/csswg-drafts/issues/5260.

Differential Revision: https://phabricator.services.mozilla.com/D96826
2020-11-13 12:44:01 +00:00
Jan-Erik Rediger eeb5f1a8c2 Bug 1646165 - Implement FOG's JavaScript API via WebIDL. r=chutten,webidl,emilio,smaug
This is only the basic outline.
It doesn't do anything yet, but compile.
As there are no metrics generated for it it can't look up anything.

To note: Actual metric types are implemented in XPIDL later.

The following (priviliged) JavaScript code will soon work (if the
corresponding metrics would be defined):

const { Glean } = ChromeUtils.import("resource://gre/modules/Glean.jsm");
Glean.shared.test_only.count_things.add(1);

Differential Revision: https://phabricator.services.mozilla.com/D92211
2020-10-21 11:36:46 +00:00
Andrew McCreight c185e29336 Bug 1666621 - Remove nsGlobalWindowInner::mPendingPromises. r=kashav
It is no longer used.

Differential Revision: https://phabricator.services.mozilla.com/D91061
2020-09-22 20:58:42 +00:00
alwu bf59a9f003 Bug 1634494 - part3 : make content media controller per inner window. r=chunmin,smaug
Before applying this patch, `ContentMediaController` is per process, it might contains `ContentMediaControlKeyReceiver` coming from different browsing context, and we are not able to treat those receivers differently based on the browsing context they exist in.

The goal to change `ContentMediaController` per inner window is to allow us to have an ability to treat receivers in different browsing context with different operations without interering each other.

As the `ContentMediaController` control the media playback in web context, which life cycle is tight to the inner window, that is why I choose to create `ContentMediaController` on the inner window.

In addition, update the comment to make its up-to-date.

Differential Revision: https://phabricator.services.mozilla.com/D87142
2020-08-24 04:27:08 +00:00
Emilio Cobos Álvarez 044b3c4332 Bug 1636728 - Centralize printing entry points in nsGlobalWindowOuter, and move cloning out of nsPrintJob. r=jwatt,geckoview-reviewers,smaug,agi
This centralizes our print and preview setup in nsGlobalWindowOuter so
that we never re-clone a clone, and so that we reuse the window.open()
codepath to create the browsing context to clone into.

For window.print, for both old print dialog / silent printing and new
print preview UI, we now create a hidden browser (as in with visibility:
collapse, which takes no space but still gets a layout box).

 * In the modern UI case, this browser is swapped with the actual print
   preview clone, and the UI takes care of removing the browser.

 * In the print dialog / silent printing case, the printing code calls
   window.close() from nsDocumentViewer::OnDonePrinting().

 * We don't need to care about the old print preview UI for this case
   because it can't be open from window.print().

We need to fall back to an actual window when there's no
nsIBrowserDOMWindow around for WPT print tests and the like, which don't
have one. That seems fine, we could special-case this code path more if
needed but it doesn't seem worth it.

Differential Revision: https://phabricator.services.mozilla.com/D87063
2020-08-25 17:45:12 +00:00
Andreas Farre 2f88f75c98 Bug 1646539 - Part 2: Add field on WindowContext tracking popup permission. r=nika
Popup permissions initialized with the result of checking if the
constructing WindowContext's principal is allowed to open a popup. The
field is updated for all WindowContexts sharing a principal whenever
the popup permission for that nsIPrincipal changes.

Differential Revision: https://phabricator.services.mozilla.com/D86378
2020-08-12 15:38:12 +00:00
Simon Giesecke 1e6ec7ec86 Bug 1656117 - Reduce include dependencies on nsRefreshDriver.h. r=mstange
The abstract observer base classes are moved to a separate header file
nsRefreshObservers.h and the includes are adjusted accordingly.

Some method implementations are moved to the corresponding implementation files
to avoid the need to include the nsRefreshDriver.h file in the header.

Differential Revision: https://phabricator.services.mozilla.com/D85764
2020-08-04 21:17:50 +00:00
Steven MacLeod baee2f562d Bug 1587418 - cache shortcuts permission on WindowContext. r=farre
We now cache the shortcuts permission in a synced field on
`WindowContext`. This will allow checking the permission quickly and
without IPC when Fission is enabled and the top-level document is
in another process.

Differential Revision: https://phabricator.services.mozilla.com/D84182
2020-07-30 12:26:24 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Gijs Kruitbosch 90ef37ddc1 Bug 1652613 - report slow script hang durations and only clear hang data after the observer notification, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D83989
2020-07-24 00:01:57 +00:00
Dorel Luca 54d5f1c9ed Backed out 4 changesets (bug 1652613) for Browser-chrome failures in browser/browser_ProcessHangNotifications.js. CLOSED TREE
Backed out changeset 76b5a5d243d1 (bug 1652613)
Backed out changeset 6f98c9b01920 (bug 1652613)
Backed out changeset 1255237ce2e7 (bug 1652613)
Backed out changeset bdf59854c900 (bug 1652613)
2020-07-24 02:58:22 +03:00
Gijs Kruitbosch a75ccccec2 Bug 1652613 - report slow script hang durations and only clear hang data after the observer notification, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D83989
2020-07-23 22:12:16 +00:00
Doug Thayer 8f54209ef6 Bug 1651165 - Rename idle service r=Gijs,geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83413
2020-07-20 16:06:59 +00:00
Dorel Luca 4681060e62 Backed out 3 changesets (bug 1367251) for Mda failures in /test_background_video_tainted_by_createimagebitmap.html. CLOSED TREE
Backed out changeset 871379f9b194 (bug 1367251)
Backed out changeset a76c2c98b33c (bug 1367251)
Backed out changeset a55cda2431fc (bug 1367251)
2020-07-15 16:37:32 +03:00
aardgoose b01831ccc4 Bug 1367251 - add bindings for options to createImageBitmap and support flipY r=bzbarsky,aosmond,baku
implementation of imageOrientation: none|flipY.
implementation of premultiplyAlpha: none|premultiply|default.

Differential Revision: https://phabricator.services.mozilla.com/D29562
2020-07-15 11:03:51 +00:00
Kris Maglione 316de88922 Bug 1642425: Part 2 - Remove IsFrame() from GlobalWindow(Inner|Outer). r=smaug
It does not return sensible values under Fission.

Differential Revision: https://phabricator.services.mozilla.com/D77701
2020-06-17 18:01:02 +00:00
Andrea Marchesini f8f4d7b9c9 Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 3 - Cleanup storage access methods, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D76916
2020-06-03 06:10:58 +00:00
Andrea Marchesini 22d905d24e Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 2 - Expose PartitionedPrincipal, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D76915
2020-06-03 06:09:52 +00:00
Csoregi Natalia 2d5cafc841 Backed out 5 changesets (bug 1639833) for failures on browser_blockingIndexedDbInWorkers.js. CLOSED TREE
Backed out changeset 6b4f76d65540 (bug 1639833)
Backed out changeset c77acba1aacb (bug 1639833)
Backed out changeset 30c97666919e (bug 1639833)
Backed out changeset d769b313441a (bug 1639833)
Backed out changeset ed41b41d1b03 (bug 1639833)
2020-06-02 15:02:31 +03:00
Andrea Marchesini 2e5c69b85f Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 3 - Cleanup storage access methods, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D76916
2020-06-02 08:29:15 +00:00
Andrea Marchesini e31c7313ca Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 2 - Expose PartitionedPrincipal, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D76915
2020-06-02 08:28:05 +00:00
Noemi Erli f08b043cf6 Backed out 5 changesets (bug 1639833) for causing sessionstorage related failures CLOSED TREE
Backed out changeset b36af8d9db34 (bug 1639833)
Backed out changeset 712c11904dbe (bug 1639833)
Backed out changeset 14f1e4783582 (bug 1639833)
Backed out changeset b7f14c4cfe5d (bug 1639833)
Backed out changeset b4b25034dd83 (bug 1639833)
2020-06-01 19:31:50 +03:00
Andrea Marchesini 6172ec2b3e Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 3 - Cleanup storage access methods, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D76916
2020-06-01 11:07:36 +00:00
Andrea Marchesini 8c0df411d1 Bug 1639833 - IntrisincStoragePrincipal should always be partitioned - part 2 - Expose PartitionedPrincipal, r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D76915
2020-06-01 11:57:46 +00:00
Peter Van der Beken af82496fc7 Bug 1639310 - Remove unnecessary implicitJSContext annotations. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D76020
2020-05-19 20:48:21 +00:00
Dimi Lee 3cd4188086 Bug 1624269 - P3. Inform all the windows whose storage permission is granted. r=timhuang,baku
Before this patch, we only call StorageAccessGranted on windows that
triggers the storage heuristics. So even if we sync storage permission to the
other frames, their data will not be refreshed. For example, if a document
has a worker, we don't propagate the permission to the worker.

In this patch, we call ::StorageAccessGranted as long as we update
the window's storage permission.

Differential Revision: https://phabricator.services.mozilla.com/D74321
2020-05-18 11:58:25 +00:00
Csoregi Natalia 88ab085eff Backed out 5 changesets (bug 1624269) for browser-chrome failures on browser_storageAccessWithHeuristics.js. CLOSED TREE
Backed out changeset 59cdba115447 (bug 1624269)
Backed out changeset 23b5c53f4be8 (bug 1624269)
Backed out changeset be697a5bc0fd (bug 1624269)
Backed out changeset 81420bca683c (bug 1624269)
Backed out changeset 599db5acefe1 (bug 1624269)
2020-05-18 13:59:44 +03:00
Dimi Lee 1f96287d53 Bug 1624269 - P3. Inform all the windows whose storage permission is granted. r=timhuang,baku
Before this patch, we only call StorageAccessGranted on windows that
triggers the storage heuristics. So even if we sync storage permission to the
other frames, their data will not be refreshed. For example, if a document
has a worker, we don't propagate the permission to the worker.

In this patch, we call ::StorageAccessGranted as long as we update
the window's storage permission.

Differential Revision: https://phabricator.services.mozilla.com/D74321
2020-05-18 09:09:57 +00:00
Emilio Cobos Álvarez 74f2dc7de8 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
alwu f9e89ee7ae Bug 1597450 - part1 : store autoplay permission on the WindowContext. r=nika
This patch will do :
- create a sync field `AutoplayPermission` on WindowContext
- update the field whenever site's the autoplay permission changes

The advantage of doing so :
- to help determine the result of the blocking autoplay correctly.

More details :
As the field would be automatically synced between processes, then we can know the correct site's autoplay permission for the whole page even if we're in the different process if the iframe is in different origin after we enable Fission.

Differential Revision: https://phabricator.services.mozilla.com/D74511
2020-05-15 21:18:07 +00:00
Csoregi Natalia 4302fa80f7 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 f1b1884de4 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
Liang-Heng Chen 9d2d8bbeb9 Bug 1629707 - add `IntrinsicStoragePrincipal` to `nsIScriptObjectPrincipal`; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D73132
2020-04-30 05:24:10 +00:00
Kagami Sascha Rosylight 6da77fced9 Bug 1632116 - Introduce dom.window.content.untrusted.enabled r=emilio
`window.content` is currently disabled only in Nightly by C preprecessor, and this patch replaces it with a new flag to allow users to manipulate.

Differential Revision: https://phabricator.services.mozilla.com/D71775
2020-04-22 13:08:25 +00:00
Kagami Sascha Rosylight e92d0e2a79 Bug 1597267 - Remove dom.registerProtocolHandler.insecure.enabled r=annevk,emilio
Differential Revision: https://phabricator.services.mozilla.com/D69400
2020-04-17 12:06:19 +00:00
Mike de Boer 1ebc8eec6b Bug 890125 - Part 1 - Change Window widget base classes to return and use strings for workspace IDs, rather than integers. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D67822

--HG--
extra : moz-landing-system : lando
2020-04-07 11:01:47 +00:00
Nika Layzell 349de0b692 Bug 1616353 - Part 7.7: Remove window initialization properties which are redundant with nsOpenWindowInfo, r=kmag
These properties used to be passed to newly created content windows in many
different ways, but are now unified under nsOpenWindowInfo. This patch cleans up
the remaining properties.

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

--HG--
extra : moz-landing-system : lando
2020-04-07 21:39:44 +00:00
Tom Tung 40713479b2 Bug 1586761 - P1 - Expose CrossOriginIsolated to nsIGlobalObject; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D63238

--HG--
extra : moz-landing-system : lando
2020-03-25 13:53:46 +00:00
Andreas Farre 25ca8d7890 Bug 1620594 - Part 7: Remove TabGroup and SystemGroup. r=nika,bas
TabGroup never really made any difference in which thread something go
dispatched to. This was the intended use, but development of TabGroups
with abstract main threads never made it that far. The good thing is
that thish makes it safe to also remove to the SystemGroup and instead
switch all SystemGroup dispatches to dispatches to main thread.

Timers for setTimeout and workers were the sole users of wrapped and
throttled event targets, that those throttled queues have been moved
to the BrowsingContextGroup and are now accessed explicitly.

The SchedulerEventTarget has been removed, since there are no longer a
separate event target for every TaskCategory. Instead a
LabellingEventTarget has been added to DocGroup to handle the case
where an event is dispatched do DocGroup or when an AbstractThread is
created using a DocGroup. This means that we'll actually label more
events correctly with the DocGroup that they belong to.

DocGroups have also been moved to BrowsingContextGroup.

Depends on D67636

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

--HG--
extra : moz-landing-system : lando
2020-04-07 15:17:47 +00:00
Olli Pettay a2961d74e7 Bug 1625789, optimize CustomElement constructors out from cycle collection graph, r=mccr8
Using the method name GetExistingCustomElements() to match CustomElements(), even though
they both return CustomElementRegistry.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 18:21:59 +00:00
Bogdan Tara 86041bd513 Backed out 4 changesets (bug 890125) for central bustages complaining about nsWindow.cpp
Backed out changeset 68475f12d4f1 (bug 890125)
Backed out changeset 6e2c1facb7e0 (bug 890125)
Backed out changeset 17b15e227d3b (bug 890125)
Backed out changeset 6e71761c1018 (bug 890125)
2020-04-07 01:31:47 +03:00
Cosmin Sabou aefb5f9c88 Backed out 24 changesets (bug 1616353) for fission assertion failures nsGlobalWindowOuter.cpp.
Backed out changeset 3a43210e4900 (bug 1616353)
Backed out changeset cb77e9149cf8 (bug 1616353)
Backed out changeset 3aacc7cfe33f (bug 1616353)
Backed out changeset c026b06063a5 (bug 1616353)
Backed out changeset 580e790c5d17 (bug 1616353)
Backed out changeset 6f09bc1c476d (bug 1616353)
Backed out changeset 6955906262c0 (bug 1616353)
Backed out changeset a7700472807a (bug 1616353)
Backed out changeset a4735096e01b (bug 1616353)
Backed out changeset bd1706c57d91 (bug 1616353)
Backed out changeset 363c13296fda (bug 1616353)
Backed out changeset e414df387524 (bug 1616353)
Backed out changeset 765d3364cca0 (bug 1616353)
Backed out changeset 8a13355b4ac4 (bug 1616353)
Backed out changeset ada17fb8fca7 (bug 1616353)
Backed out changeset 6b6b99af186d (bug 1616353)
Backed out changeset ea966e78b296 (bug 1616353)
Backed out changeset cb88e0bbb3b9 (bug 1616353)
Backed out changeset f89a89015114 (bug 1616353)
Backed out changeset ae6058552969 (bug 1616353)
Backed out changeset f42bb5b48c1b (bug 1616353)
Backed out changeset 1ab9d22c73bb (bug 1616353)
Backed out changeset 2692c2c1396b (bug 1616353)
Backed out changeset 11a279c8da08 (bug 1616353)
2020-04-06 20:03:02 +03:00
Nika Layzell 102f99bbee Bug 1616353 - Part 7.7: Remove window initialization properties which are redundant with nsOpenWindowInfo, r=kmag
These properties used to be passed to newly created content windows in many
different ways, but are now unified under nsOpenWindowInfo. This patch cleans up
the remaining properties.

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

--HG--
extra : moz-landing-system : lando
2020-04-06 14:30:19 +00:00