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

257 Коммитов

Автор SHA1 Сообщение Дата
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
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
Henri Sivonen 172b8e6584 Bug 1677899 - Trust the process where where focus() is called for focusability. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D104393
2021-02-09 08:03:03 +00:00
Henri Sivonen 0e936b95f1 Bug 1659383 - Check if focus() is allowed even when Window_Binding::focus() delegates to BrowsingContext::Focus(). r=nika
Differential Revision: https://phabricator.services.mozilla.com/D100005
2021-01-18 12:48:42 +00:00
Csoregi Natalia 76177ae407 Backed out changeset d2c7360e9d01 (bug 1659383) for failures on iframe-focuses-parent-different-site.html. CLOSED TREE 2021-01-18 12:36:49 +02:00
Henri Sivonen 5a70da036b Bug 1659383 - Check if focus() is allowed even when Window_Binding::focus() delegates to BrowsingContext::Focus(). r=nika
Differential Revision: https://phabricator.services.mozilla.com/D100005
2021-01-18 07:45:29 +00:00
Nika Layzell e3097163dd Bug 1597437 - Handle 'window.content' legacy getter better with Fission, r=farre,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D100167
2020-12-21 12:08:08 +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
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 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
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
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
alwu 1c7f393a54 Bug 1667439 - remove invalid wakelock for 'DOM_Fullscreen'. r=saschanaz
Remove this invalid wakelock because our wakelock system doesn't handle this topic.

Differential Revision: https://phabricator.services.mozilla.com/D94394
2020-10-22 13:45:30 +00:00
Emilio Cobos Álvarez 4e68e78542 Bug 1669925 - Add a printing.trigger keyed scalar to record what triggers a particular print dialog. r=jwatt,marionette-reviewers,maja_zf
In order to avoid over/under-counting, we need to treat window.print()
specially. The new UI was using aOpenWindowInfo.isForPrintPreview for
that, but that doesn't quite work for the old UI (because it will
trigger a regular print, not a preview).

But since isForPrintPreview was only really needed to distinguish
window.print(), just rename it and set it to true when the old UI is
triggered by window.print() as well.

Differential Revision: https://phabricator.services.mozilla.com/D92925
2020-10-09 14:59:46 +00:00
Sylvestre Ledru d9cd198ba1 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D92459
2020-10-06 16:12:00 +00:00
Emilio Cobos Álvarez 2c3d952fc7 Bug 1667342 - Make the "deferred window close" keep making sense after bug 1636728. r=smaug
This was only being checked on OnDonePrinting() which isn't called in
the original docshell. Move it to the window because we don't need to
care about document viewers getting closed during print operations,
they're top level browsers that don't run script.

Differential Revision: https://phabricator.services.mozilla.com/D91416
2020-09-25 13:39:01 +00:00
Andrea Marchesini e733096393 Bug 444222 - Update the window.name when doing the navigation, r=smaug,nika
This patch implements the window.name updating in the spec
https://html.spec.whatwg.org/#history-traversal.

Differential Revision: https://phabricator.services.mozilla.com/D81361
2020-09-15 17:51:05 +00:00
Emilio Cobos Álvarez c0f4091be3 Bug 1662975 - Don't return from window.print() until the print dialog is closed. r=jwatt
As much as I hate nested event loops, I think we need to do it for this
case :)

Hopefully print() already assumes nested event loops can happen because
of the native dialog so it's already properly set up for this.

Differential Revision: https://phabricator.services.mozilla.com/D89254
2020-09-03 17:03:06 +00:00
Bogdan Tara 473f41370a Backed out changeset 52d0f9a901a9 (bug 1662975) for nested_fullscreen.https.html failures CLOSED TREE 2020-09-03 23:41:38 +03:00
Emilio Cobos Álvarez 0d73b10ab3 Bug 1662975 - Don't return from window.print() until the print dialog is closed. r=jwatt
As much as I hate nested event loops, I think we need to do it for this
case :)

Hopefully print() already assumes nested event loops can happen because
of the native dialog so it's already properly set up for this.

Differential Revision: https://phabricator.services.mozilla.com/D89254
2020-09-03 17:03:06 +00:00
Jonathan Watt ad76c1dcba Bug 1653340. Add new FrameLoader.printPreview() API. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88703
2020-09-01 11:00:36 +00:00
Emilio Cobos Álvarez 72730e8e3d Bug 1636728 - Make calling window.print() before load keep deferring the actual printing and closing the window until load. r=smaug
Other engines also do this, but with my previous patch breaks it
(because we only hit print() on the print-content-viewer _after_ doing
the clone).

So move it before triggering all the machinery, and only for
window.print().  Given we didn't check this for print preview etc, I
think it's fine to carry on for user-triggered loads.

Trivial test-case (which I'm not quite sure how to turn into an
automated test...)

    <!doctype html>
    <h1>I do get printed but...</h1>

    <script>
      window.print();
    </script>

    <h2>Do I?</h2>

Note that this is broken with the new print preview UI already, this
fixes it.

Differential Revision: https://phabricator.services.mozilla.com/D87898
2020-08-25 17:45:24 +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
Sylvestre Ledru 843f943758 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D85678
2020-08-02 15:29:15 +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
Emilio Cobos Álvarez 29d1c62b2a Bug 1654402 - Move window.matchMedia to the inner window. r=nika,smaug
Differential Revision: https://phabricator.services.mozilla.com/D84442
2020-07-22 10:09:50 +00:00
Dimi Lee 714f0b63ec Bug 1622212 - P1. Always use ContentBlocking::ShouldAllowAccessFor to set mStorageAccessPermissionGranted flag r=baku
The mStorageAccessPermissionGranted variable determins the result of
HasStorageAccess API, which should sync with the result of the
ContentBlocking::ShouldAllowAccessFor.

This patch removes using nsGloWindowOuter's logic and alwasys use
ShouldAllowAccessFor while creating a new document.

Differential Revision: https://phabricator.services.mozilla.com/D78634
2020-06-30 23:40:57 +00:00
Cosmin Sabou 16c941758d Backed out 3 changesets (bug 1622212) for causing wpt failures on requestStorageAccess.sub.window.html on central.
Backed out changeset a20db87bec25 (bug 1622212)
Backed out changeset 783ef2b63ef8 (bug 1622212)
Backed out changeset ece4c5394185 (bug 1622212)
2020-07-01 02:33:27 +03:00
Dimi Lee 70cfab7554 Bug 1622212 - P1. Always use ContentBlocking::ShouldAllowAccessFor to set mStorageAccessPermissionGranted flag r=baku
The mStorageAccessPermissionGranted variable determins the result of
HasStorageAccess API, which should sync with the result of the
ContentBlocking::ShouldAllowAccessFor.

This patch removes using nsGloWindowOuter's logic and alwasys use
ShouldAllowAccessFor while creating a new document.

Differential Revision: https://phabricator.services.mozilla.com/D78634
2020-06-30 14:39:36 +00:00
Eden Chuang a383fd6b63 Bug 1637035 - Do not inherit COEP from opener for non-http or non-initial-about:blank documents r=nika
Differential Revision: https://phabricator.services.mozilla.com/D80414
2020-06-25 02:14:29 +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
Kris Maglione 4b1ac04706 Bug 1642425: Part 1 - Remove IsTopLevelWindow() method. r=baku
It doesn't do anything sensible under Fission.

Differential Revision: https://phabricator.services.mozilla.com/D77700
2020-06-17 18:01:00 +00:00
Csoregi Natalia bb23e38274 Backed out 2 changesets (bug 1622212) for failures on browser_blockingCookies.js. CLOSED TREE
Backed out changeset 7cf837020c1d (bug 1622212)
Backed out changeset 433bce375811 (bug 1622212)
2020-06-17 09:58:34 +03:00
Dimi Lee b2e3877d99 Bug 1622212 - P1. Always use ContentBlocking::ShouldAllowAccessFor to set mStorageAccessPermissionGranted flag r=baku
The mStorageAccessPermissionGranted variable determins the result of
HasStorageAccess API, which should sync with the result of the
ContentBlocking::ShouldAllowAccessFor.

This patch removes using nsGloWindowOuter's logic and alwasys use
ShouldAllowAccessFor while creating a new document.

Differential Revision: https://phabricator.services.mozilla.com/D78634
2020-06-17 05:06:37 +00:00
Coroiu Cristina b1dfdc31c5 Backed out 2 changesets (bug 1622212) for build bustage at /dom/base/nsGlobalWindowOuter.cpp on a CLOSED TREE
Backed out changeset 9ab804814442 (bug 1622212)
Backed out changeset 07a08a71e259 (bug 1622212)
2020-06-16 10:38:40 +03:00
Dimi Lee 805fdac0ad Bug 1622212 - P1. Always use ContentBlocking::ShouldAllowAccessFor to set mStorageAccessPermissionGranted flag r=baku
The mStorageAccessPermissionGranted variable determins the result of
HasStorageAccess API, which should sync with the result of the
ContentBlocking::ShouldAllowAccessFor.

This patch removes using nsGloWindowOuter's logic and alwasys use
ShouldAllowAccessFor while creating a new document.

Differential Revision: https://phabricator.services.mozilla.com/D78634
2020-06-16 07:15:52 +00:00
Nika Layzell cde53b3bec Bug 1508306 - Part 1: Migate the Large-Allocation handler to DocumentLoadListener, r=mattwoodrow,necko-reviewers,geckoview-reviewers,agi,valentin
This removes the diagnostic warnings which used to be logged when the
Large-Allocation header was present, but failed to switch into a
Large-Allocation process. Due to the low adoption of the header, this shouldn't
be too large of a problem, but we can look into re-adding the diagnostics if
needed in the future.

The new codepath no longer performs multiple network requests for
Large-Allocation resources, and now relies on the battle-tested
DocumentLoadListener codepath for process switching.

Differential Revision: https://phabricator.services.mozilla.com/D78998
2020-06-15 23:24:07 +00:00