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

350 Коммитов

Автор SHA1 Сообщение Дата
Olli Pettay dd5347ded5 Bug 1698549 - Call FireDelayedDOMEvents when restoring a bfcached page, r=peterv
The test isn't testing anything mApplicationCache related, since appcache is basically
no-op code.

Depends on D107930

Differential Revision: https://phabricator.services.mozilla.com/D108487
2021-03-21 21:46:25 +00:00
Alexandru Michis c3da6488ee Backed out changeset f588378316fd (bug 1699259) for causing mochitest failures in test_focusrings.xhtml
CLOSED TREE
2021-03-20 03:10:02 +02:00
Emilio Cobos Álvarez 9d854aa834 Bug 1699259 - Add a ChromeOnly FocusOptions.preventFocusRing to opt out of focus ring heuristics. r=edgar,Gijs
This seems easier than making those heuristics work across processes
somehow.

Differential Revision: https://phabricator.services.mozilla.com/D108931
2021-03-19 23:10:35 +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
Edgar Chen c5688b603e Bug 1640766 - Make nsGlobalWindowInner::Suspend/Resume suspend/resume all in-process descendants; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D107762
2021-03-12 16:23:10 +00:00
Simon Giesecke 91fdeec18c Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 16:14:58 +00:00
Alexandru Michis c691800cb0 Backed out changeset fd03162e726d (bug 1695162) for causing bustages in Document.cpp
CLOSED TREE
2021-03-12 17:10:02 +02:00
Simon Giesecke 2fb6095f16 Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 14:54:08 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Jan-Erik Rediger 4a219f294b Bug 1695197 - Remove MOZ_GLEAN constant, introduce MOZ_GLEAN_ANDROID. r=chutten,emilio
We enable compilation of FOG/Glean on _all_ platforms.
We disable Glean initialization and metric recording on Android (GeckoView) by respecting MOZ_GLEAN_ANDROID.
This way GeckoView just works, consumers don't need to think about it (except in tests, these need to be disabled for Android builds).

Stubbing out the metric implementations will happen in the commits after
this one.

Differential Revision: https://phabricator.services.mozilla.com/D106766
2021-03-04 11:15:12 +00:00
Olli Pettay bba6b348ae Bug 1689601, nested freeze/thaw, r=peterv
Non-SHIP bfcache seems to be rather complicated here, since it needs to explicitly store inner windows and what not.
SHIP should be able to handle this in a simpler way.
It is possible that some ordering needs still tweaking.

Differential Revision: https://phabricator.services.mozilla.com/D105360
2021-03-02 12:13:20 +00:00
Mihai Alexandru Michis 87f481bf9a Backed out 16 changesets (bug 1689601) for causing cpp bustages in nsFrameLoader.
CLOSED TREE

Backed out changeset 6e5523a7210d (bug 1689601)
Backed out changeset 745eaa468c74 (bug 1689601)
Backed out changeset a594bd02b8b6 (bug 1689601)
Backed out changeset 0c5fe977ced6 (bug 1689601)
Backed out changeset 2fca23521891 (bug 1689601)
Backed out changeset 334aeb627855 (bug 1689601)
Backed out changeset 2b2081a15d67 (bug 1689601)
Backed out changeset 307bde43cc96 (bug 1689601)
Backed out changeset 04aadec67ce2 (bug 1689601)
Backed out changeset 701eccb34772 (bug 1689601)
Backed out changeset 278db692aa8b (bug 1689601)
Backed out changeset c261c243a64d (bug 1689601)
Backed out changeset 7e8022e5696a (bug 1689601)
Backed out changeset 6138bfc6c08d (bug 1689601)
Backed out changeset 63295b3a62d0 (bug 1689601)
Backed out changeset 6d02e59ddc51 (bug 1689601)
2021-03-02 13:15:10 +02:00
Olli Pettay 9a08f751a4 Bug 1689601, nested freeze/thaw, r=peterv
Non-SHIP bfcache seems to be rather complicated here, since it needs to explicitly store inner windows and what not.
SHIP should be able to handle this in a simpler way.
It is possible that some ordering needs still tweaking.

Differential Revision: https://phabricator.services.mozilla.com/D105360
2021-03-02 09:44:13 +00:00
Simon Giesecke f4f7c593e0 Bug 1692835 - Remove nsJSThingHashtable. r=xpcom-reviewers,nika
The only use of nsJSThingHashtable is replaced by a direct use of
nsBaseHashtable.

Differential Revision: https://phabricator.services.mozilla.com/D105971
2021-03-02 09:02:19 +00:00
Edgar Chen 25e174233c Bug 1694152 - Remove unused nsGlobalWindowInner::IsPopupSpamWindow; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D105975
2021-02-23 07:12:21 +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
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 c804929923 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.

Differential Revision: https://phabricator.services.mozilla.com/D104863
2021-02-15 12:41:23 +00:00
Edgar Chen 0916876268 Bug 1690747 - Should also check blur is allowed in BrowsingContext::Blur(); r=hsivonen
When binding delegates blur() to BrowsingContext::Blur, the remote side skips
the check given that there is no js on the stack, but we should not skip the
check. This only affects design-mode which allows the focus moving to the root
element.

Differential Revision: https://phabricator.services.mozilla.com/D104008
2021-02-09 14:56:56 +00:00
Andreea Pavel c546ab6198 Backed out changeset ebb61065ad47 (bug 1690747) for failing mochitests at test_focus_design_mode.html on a CLOSED TREE 2021-02-09 15:11:05 +02:00
Edgar Chen 486af881a2 Bug 1690747 - Should also check blur is allowed in BrowsingContext::Blur(); r=hsivonen
When binding delegates blur() to BrowsingContext::Blur, the remote side skips
the check given that there is no js on the stack, but we should not skip the
check. This only affects design-mode which allows the focus moving to the root
element.

Differential Revision: https://phabricator.services.mozilla.com/D104008
2021-02-09 12:18:15 +00:00
Neil Deakin ca5dfb7222 Bug 259640, add chrome only method to add scrollbar tick marks to a window, r=smaug,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D100938
2021-02-03 17:35:41 +00:00
Emilio Cobos Álvarez 039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Chris H-C a0efcbcf74 Bug 1673660 - C++ and JS API for Glean Custom Pings r=janerik,webidl,smaug
Covers adding the new JS global `GleanPings` for JS, the new structs for C++ at
mozilla::glean_pings, ping-id and string-table-index codegen, the usual
boilerplate for JS and C++ stuff, and tests.

Unresolved:
* What happens if we call this on a non-parent process?
  (This isn't a supported mode of operation)

Differential Revision: https://phabricator.services.mozilla.com/D98671
2020-12-14 16:50:07 +00:00
Chris H-C 8a65ae0861 Bug 1673660 - Move FOG C++ and JS API scaffolding headers to subdir r=janerik
Headers we want our consumers to use remain in mozilla/glean,
but scaffolding now lives in mozilla/glean/bindings.

This will allow me to have a binding for the GleanPings global in GleanPings.h
AS WELL AS a GleanPings.h which is the C++ consumer API for custom pings.

Differential Revision: https://phabricator.services.mozilla.com/D98670
2020-12-14 16:49:43 +00:00
Simon Giesecke 7499023887 Bug 1673931 - Avoid including DebuggerNotificationBinding.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D97611
2020-12-10 11:09:32 +00:00
Emilio Cobos Álvarez 4fd5d13610 Bug 1680721 - Grant a single iframe without user interaction to top windows. r=smaug,johannh
Only for top windows because for nested iframes they could get around
this without being noticed by reloading themselves which is not great.

Differential Revision: https://phabricator.services.mozilla.com/D98775
2020-12-08 10:15:18 +00:00
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