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

404 Коммитов

Автор SHA1 Сообщение Дата
Matthias Camenzind 8a4636621a Bug 1793605 - Flush layout in window.open calls with specified size. r=emilio
Without flushing the layout, new windows appear to the opener to
initially open at the size of the opener instead of the specified size.

We can flush the layout unconditionally when we have a specified size
where we otherwise would make sure that the frame loader has been
reflowed at least once.

Thanks to Emilio for providing the changes to avoid tokenizing the
window features twice.

Differential Revision: https://phabricator.services.mozilla.com/D158584
2022-10-14 16:35:49 +00:00
Pier Angelo Vendrame aa21b01cfa Bug 1768907 - Part 1: Make browser.privatebrowsing.autostart a static pref. r=handyman,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D157843
2022-09-22 00:26:17 +00:00
Nika Layzell 09b94a7412 Bug 1694993 - Part 7: Don't set LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL for chrome windows, r=smaug
Depends on D155277

Differential Revision: https://phabricator.services.mozilla.com/D157514
2022-09-20 23:29:09 +00:00
Nika Layzell 613c259d7c Bug 1694993 - Part 6: Preserve precursor principal through LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL, r=ckerschb,smaug
If we don't preserve the precursor principal in this case, we'll end up
doing an unnecessary process switch in some cases, which lead to a
test failure.

This patch also cleans up some logic around the first party origin
attribute with null principals, as the logic was only used in one place
and generally added some unnecessary complexity to NullPrincipal
itself.

Differential Revision: https://phabricator.services.mozilla.com/D155277
2022-09-20 23:29:08 +00:00
Nika Layzell 65e78832a8 Bug 1694993 - Part 4: Copy session storage before loading, and only for newly created windows, r=smaug
Previously we would copy session storage even if we were not opening a new
window, meaning that a targeted load could re-trigger a copy. This was not
specified in the standard so is being changed to only copy when a new window is
created. In addition, the copy was moved before navigaton starts, again for
more consistency with ordering for the standard, such that things like
`javascript:` URI loads will oberve the up-to-date session storage.

Differential Revision: https://phabricator.services.mozilla.com/D154566
2022-09-20 23:29:07 +00:00
Nika Layzell 068cf8381f Bug 1694993 - Part 3: Rename some variables in nsWindowWatcher for clarity, r=smaug
The `newBC` and `newDocShell` variables were potentially confusing, as they
could also be existing windows selected by named targeting or the window
provider, so they have been renamed. Some other variables were also renamed for
consistency and clarity.

Differential Revision: https://phabricator.services.mozilla.com/D154565
2022-09-20 23:29:07 +00:00
Nika Layzell 7fd619979d Bug 1694993 - Part 2: Explicitly select the principal for newly created windows in nsWindowWatcher, r=smaug
When opening a window with `noopener`, we will no longer inherit the
subject principal into the newly created window's initial about:blank
document, instead creating a new null principal.

This patch also makes the system/expanded principal -> null principal
translation happen earlier (it previously happened in
SetInitialPrincipalToSubject), so that it can be followed more easily
when reading the code.

Finally, the load started by nsWindowWatcher in new windows is updated
to specify `LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL` when noopener is
specified such that the explicit about:blank load also cannot inherit
the subject principal.

This change does make it so that the global is not re-used between the
initial and loaded about:blank document, however this shouldn't be
visible due to `noopener` being specified, preventing any references to
the initial document from existing.

Noopener loads with `javascript:` URIs will be rejected early during the
load due to the mismatch between the triggering principal and the
initial about:blank document's principal.

Differential Revision: https://phabricator.services.mozilla.com/D154564
2022-09-20 23:29:06 +00:00
Nika Layzell c195a30e63 Bug 1694993 - Part 1: Be more explicit about principals used when creating pop-up windows, r=smaug
Previously we would pull this information frequently from the subject
principal, which is unreliable. With this new approach, we more explicitly pass
the principals around as-needed into where they're going to be used.

Some assertions about the subject principal were introduced to ensure that
assumptions made about chrome windows and the system principal are not
incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D154563
2022-09-20 23:29:06 +00:00
Narcis Beleuzu 94d309143f Backed out 5 changesets (bug 1694993) for bc failure on browser_cross_process_csp_inheritance.js
Backed out changeset 1d21d911b3e7 (bug 1694993)
Backed out changeset 3b412d5fbdcf (bug 1694993)
Backed out changeset c9585ce37fe5 (bug 1694993)
Backed out changeset 05d7cbbfe9e2 (bug 1694993)
Backed out changeset 3821545ab46b (bug 1694993)
2022-08-22 20:32:02 +03:00
Nika Layzell 182e87b678 Bug 1694993 - Part 4: Copy session storage before loading, and only for newly created windows, r=smaug
Previously we would copy session storage even if we were not opening a new
window, meaning that a targeted load could re-trigger a copy. This was not
specified in the standard so is being changed to only copy when a new window is
created. In addition, the copy was moved before navigaton starts, again for
more consistency with ordering for the standard, such that things like
`javascript:` URI loads will oberve the up-to-date session storage.

Depends on D154565

Differential Revision: https://phabricator.services.mozilla.com/D154566
2022-08-22 15:35:28 +00:00
Nika Layzell 12a31a7f46 Bug 1694993 - Part 3: Rename some variables in nsWindowWatcher for clarity, r=smaug
The `newBC` and `newDocShell` variables were potentially confusing, as they
could also be existing windows selected by named targeting or the window
provider, so they have been renamed. Some other variables were also renamed for
consistency and clarity.

Depends on D154564

Differential Revision: https://phabricator.services.mozilla.com/D154565
2022-08-22 15:35:28 +00:00
Nika Layzell e245126ac8 Bug 1694993 - Part 2: Explicitly select the principal for newly created windows in nsWindowWatcher, r=smaug
When opening a window with `noopener`, we will no longer inherit the
subject principal into the newly created window's initial about:blank
document, instead creating a new null principal.

This patch also makes the system/expanded principal -> null principal
translation happen earlier (it previously happened in
SetInitialPrincipalToSubject), so that it can be followed more easily
when reading the code.

Finally, the load started by nsWindowWatcher in new windows is updated
to specify `LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL` when noopener is
specified such that the explicit about:blank load also cannot inherit
the subject principal.

This change does make it so that the global is not re-used between the
initial and loaded about:blank document, however this shouldn't be
visible due to `noopener` being specified, preventing any references to
the initial document from existing.

Noopener loads with `javascript:` URIs will be rejected early during the
load due to the mismatch between the triggering principal and the
initial about:blank document's principal.

Depends on D154563

Differential Revision: https://phabricator.services.mozilla.com/D154564
2022-08-22 15:35:27 +00:00
Nika Layzell 4c195ef117 Bug 1694993 - Part 1: Be more explicit about principals used when creating pop-up windows, r=smaug
Previously we would pull this information frequently from the subject
principal, which is unreliable. With this new approach, we more explicitly pass
the principals around as-needed into where they're going to be used.

Some assertions about the subject principal were introduced to ensure that
assumptions made about chrome windows and the system principal are not
incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D154563
2022-08-22 15:35:27 +00:00
Mark Banner 7428be4a86 Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Olli Pettay 931d43796f Bug 1777572, opener going away while opening a new window should not affect csp behavior, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D151767
2022-07-20 21:51:27 +00:00
Cristian Tuns 2f5fe88da3 Backed out 19 changesets (bug 1758745, bug 1758740, bug 1762462, bug 1779603) for causing mochitest failures on browser_partitionedConsoleMessage.js CLOSED TREE
Backed out changeset e3c8cd6f00b6 (bug 1779603)
Backed out changeset 4e46a6f209b4 (bug 1762462)
Backed out changeset 00c0c6314640 (bug 1762462)
Backed out changeset 8f11221f859f (bug 1762462)
Backed out changeset ffbf90e3bbab (bug 1762462)
Backed out changeset 0c760428dfec (bug 1762462)
Backed out changeset 7c99293cc8f9 (bug 1762462)
Backed out changeset 92bd237a95e1 (bug 1762462)
Backed out changeset 74539a3cc7fc (bug 1762462)
Backed out changeset acf08a10c6fb (bug 1762462)
Backed out changeset 0cf191a7739f (bug 1762462)
Backed out changeset 030c276d6669 (bug 1762462)
Backed out changeset a88a099c684d (bug 1762462)
Backed out changeset cbd69786a24b (bug 1762462)
Backed out changeset e5e0655206a8 (bug 1762462)
Backed out changeset 707f9dfed501 (bug 1762462)
Backed out changeset 619e4bb01a81 (bug 1762462)
Backed out changeset 02b7641683b0 (bug 1758745)
Backed out changeset a2f110442038 (bug 1758740)
2022-07-14 17:26:17 -04:00
Benjamin VanderSloot 5356255bee Bug 1762462 - Make tests in toolkit/components/antitracking/ reflect Always Partitioning Storage; r=timhuang
Depends on D148060

Differential Revision: https://phabricator.services.mozilla.com/D144731
2022-07-14 19:26:31 +00:00
Tooru Fujisawa 3f70a788b3 Bug 1667455 - Part 11: Stop importing Services.jsm from chrome-priv HTML code, other cases. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D150900
2022-07-11 12:41:53 +00:00
Tooru Fujisawa 52c95734e7 Bug 1667455 - Part 9: Stop importing Services.jsm from chrome-priv HTML code, single-line cases. r=kmag,necko-reviewers,geckoview-reviewers,extension-reviewers,m_kato,dragana
Differential Revision: https://phabricator.services.mozilla.com/D150898
2022-07-11 12:41:52 +00:00
Joel Maher 5bf232d7af Bug 1776212 - cleanup e10s in manifest conditions for bc/dt. r=aryx,necko-reviewers,extension-reviewers,preferences-reviewers,dragana,zombie
Differential Revision: https://phabricator.services.mozilla.com/D150127
2022-06-23 17:49:07 +00:00
Emilio Cobos Álvarez ee23efc9b5 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 15:01:52 +00:00
Norisz Fay 60ea7706bd Backed out changeset da5c71190673 (bug 1773813) for causing build bustages CLOSED TREE 2022-06-14 15:13:58 +03:00
Emilio Cobos Álvarez c64d0fcaa6 Bug 1773813 - Incorporate OS zoom factor in window sizing calculations. r=tnikkel
In bug 1773342 I made OS text scale factor behave like a full zoom
factor which applies to all pages (including the browser chrome). That's
generally straight forward but it makes some callsites that use unzoomed
CSS coordinates misbehave (or behave correctly accidentally actually in
some other cases).

The main fix here is making
nsIBaseWindow::UnscaledDevicePixelsPerCSSPixel() and
nsIScreen::GetDefaultCSSScaleFactor() account for OS zoom as necessary.
However, I also went through the relevant code and cleaned it up to use
typed units and operations when possible.

The setup means:

 * nsIWidget::GetDefaultScale() doesn't account for OS full zoom.
 * nsIBaseWindow and nsIScreen does.

These are the places where this should matter and stuff can get
confused, but this works surprisingly well for all callers (except one
nsDeviceContext one which we use only for PuppetWidget and we can
remove by falling back to 1.0 like all other widgets until the update
comes).

Differential Revision: https://phabricator.services.mozilla.com/D149033
2022-06-14 11:37:25 +00:00
Andrew McCreight aeaf891c07 Bug 1152440, part 2 - Only declare one variable per line in SizeOpenedWindow. r=smaug
Also remove a closing */ that snuck in somehow.

Differential Revision: https://phabricator.services.mozilla.com/D147745
2022-05-31 13:31:14 +00:00
Andrew McCreight dd8d6afdb0 Bug 1152440, part 1 - Replace 0 with nullptr in nsWindowWatcher.cpp. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D147744
2022-05-31 13:31:13 +00:00
Edgar Chen ace5a2aad1 Bug 1746448; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D143483
2022-04-20 15:37:47 +00:00
Gijs Kruitbosch 8e67201171 Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 16:16:42 +00:00
Norisz Fay acdd6851cd Backed out 2 changesets (bug 1753696) for causing multiple dt and bc failures CLOSED TREE
Backed out changeset 67fd9edfbcea (bug 1753696)
Backed out changeset a9d957ea887b (bug 1753696)
2022-03-30 12:17:55 +03:00
Gijs Kruitbosch 27039e2946 Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 08:18:51 +00:00
Randell Jesup fcaf70841e Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli 2390d257e6 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup 4b033a5256 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila 927ad62c6a Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup 7d4b5fae04 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Emilio Cobos Álvarez aa07f7fe8a Bug 1755134 - Tweak full zoom handling to match our pre-existing behavior.
MANUAL PUSH: Trivial-ish orange fix CLOSED TREE
2022-02-17 23:07:33 +01:00
Emilio Cobos Álvarez 59f9980321 Bug 1755134 - Fix a typo to fix browser_new_sized_window.js failures.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2022-02-17 22:52:29 +01:00
Emilio Cobos Álvarez 76f3c42bd0 Bug 1755134 - Fix calculation of window position and size on window.open(). r=jfkthame
Compute x and y on desktop pixels based on the old screen and use CSS
pixels for the rest.

Use well-typed units to prevent silly mistakes to the extent possible.

Differential Revision: https://phabricator.services.mozilla.com/D138646
2022-02-17 16:22:57 +00:00
Nika Layzell 14fc53518e Bug 1744352 - Part 1: Ensure we set InitialSandboxFlags when opening or replacing toplevel BrowsingContexts, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D138209
2022-02-09 17:50:51 +00:00
Butkovits Atila 1d9c37d4a5 Backed out 2 changesets (bug 1744352) for causing failures at test_javascript_sandboxed_popup.html. CLOSED TREE
Backed out changeset 1a7d29ce984c (bug 1744352)
Backed out changeset b3a8f99f0044 (bug 1744352)
2022-02-09 17:53:32 +02:00
Nika Layzell 5e17bc5cd2 Bug 1744352 - Part 1: Ensure we set InitialSandboxFlags when opening or replacing toplevel BrowsingContexts, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D138209
2022-02-09 14:44:51 +00:00
Kershaw Chang 5d806765a0 Bug 1741425 - Enable more mochitest with socket process, r=ahal,webdriver-reviewers,preferences-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D134485
2022-01-11 09:49:45 +00:00
Tooru Fujisawa 03a4d7f62c Bug 1746848 - Part 2: Split browser_popup_condition.js for each pref. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D134372
2021-12-21 12:10:05 +00:00
Tooru Fujisawa ed7dc445ef Bug 1746848 - Part 1: Reduce redundant testcase from browser_popup_condition.js. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D134371
2021-12-21 12:10:05 +00:00
Gijs Kruitbosch 1dd6c4b073 Bug 1544167 - end drag sessions when creating dialog chrome windows, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132955
2021-12-20 11:06:36 +00:00
Csoregi Natalia eddf40e132 Backed out changeset c738cce970b5 (bug 1544167) for causing permafailures on /browser_popup_condition.js. CLOSED TREE 2021-12-20 04:54:58 +02:00
Mike Hommey 8e411675ac Bug 1744877 - Remove --disable-xul. r=Gijs
Building with --disable-xul has been busted since _at least_ bug
1082579, for more than 7 years (I didn't try to track that down
further). It's time to recognize that the option serves no purpose.

Differential Revision: https://phabricator.services.mozilla.com/D133161
2021-12-08 21:37:11 +00:00
Gijs Kruitbosch e1f872d6bf Bug 1544167 - end drag sessions when creating dialog chrome windows, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132955
2021-12-08 00:50:44 +00:00
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Tooru Fujisawa 4d7bcb01be Bug 1701001 - Part 2: Add "is popup" field to browsing context. r=smaug
Add BrowsingContext::FieldValues.mIsPopupRequested, and pass "is popup"
value calculated before opening window/tab to BrowsingContext::CreateDetached.

Other code path that is unrelated to content-priv window.open uses the
default value false.

Differential Revision: https://phabricator.services.mozilla.com/D129411
2021-11-06 01:19:14 +00:00
Tooru Fujisawa f11f62dcaf Bug 1701001 - Part 1: Standardize the condition for opening popup from window.open. r=smaug
Removed "width" feature from the popup condition, and removed related parameters
(aWidthSpecified, and aSizeSpec) from functions.

Also added "popup" feature that explicitly specify whether to request popup or
not.
This is only for content context, and it behaves differently than existing
"popup" feature for chrome context that makes the window no-style.

Differential Revision: https://phabricator.services.mozilla.com/D129410
2021-11-06 01:19:14 +00:00