Commit Graph

258 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1d3d68c79f 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
d314336f6d 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
a53d3515de 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
0ac9d7016c 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
61617d602a 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
1a923f1aee 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
Gijs Kruitbosch
7b8f825961 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
77cf6412d0 Backed out changeset c738cce970b5 (bug 1544167) for causing permafailures on /browser_popup_condition.js. CLOSED TREE 2021-12-20 04:54:58 +02:00
Gijs Kruitbosch
dc8909ad02 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
Tooru Fujisawa
688a5da5c5 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
2023605d86 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
Tooru Fujisawa
38c2b7620d Bug 1737832 - Simplify the chromeFlag calculation in window.open for nsGlobalWindowOuter::Print and nsDocShell::PerformRetargeting. r=smaug
This simplifies the chromeFlag calculation for:
  * chrome-priv case, by removing not-fully-chrome-priv case
  * content case, by removing presenceFlag calculation
both by removing the special case for
nsGlobalWindowOuter::Print and nsDocShell::PerformRetargeting,
that has chrome caller but no chrome parent.

Code path for nsGlobalWindowOuter::Print and nsDocShell::PerformRetargeting
now uses the content case instead of the chrome-priv case, but the resulting
flag doesn't change (CHROME_ALL) for those 2 consumers.

Differential Revision: https://phabricator.services.mozilla.com/D129530
2021-11-06 01:19:13 +00:00
Marian-Vasile Laza
1ad5e0f00b Backed out 4 changesets (bug 1737832, bug 1701001) for causing geckoview failures on noopener-noreferrer-BarProp.window.html. CLOSED TREE
Backed out changeset ff439d9c0391 (bug 1701001)
Backed out changeset b0e47b1f4d39 (bug 1701001)
Backed out changeset 0e2ca3cc650e (bug 1701001)
Backed out changeset 712b897cbc76 (bug 1737832)
2021-11-06 02:44:46 +02:00
Tooru Fujisawa
4b4b4f1547 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-05 23:07:40 +00:00
Tooru Fujisawa
b55930f157 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-05 23:07:40 +00:00
Tooru Fujisawa
c8a91c525d Bug 1737832 - Simplify the chromeFlag calculation in window.open for nsGlobalWindowOuter::Print and nsDocShell::PerformRetargeting. r=smaug
This simplifies the chromeFlag calculation for:
  * chrome-priv case, by removing not-fully-chrome-priv case
  * content case, by removing presenceFlag calculation
both by removing the special case for
nsGlobalWindowOuter::Print and nsDocShell::PerformRetargeting,
that has chrome caller but no chrome parent.

Code path for nsGlobalWindowOuter::Print and nsDocShell::PerformRetargeting
now uses the content case instead of the chrome-priv case, but the resulting
flag doesn't change (CHROME_ALL) for those 2 consumers.

Differential Revision: https://phabricator.services.mozilla.com/D129530
2021-11-05 23:07:40 +00:00
Sandor Molnar
f3e00231c0 Backed out 2 changesets (bug 1731597) for causing multiple wpt failures. CLOSED TREE
Backed out changeset 48cc3daf8201 (bug 1731597)
Backed out changeset db878c07f32a (bug 1731597)
2021-10-29 05:32:59 +03:00
Nika Layzell
8c0e559ca6 Bug 1731597 - Part 2: Stop relying on GetPrimaryRemoteTab when opening popups, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D126994
2021-10-28 22:25:28 +00:00
Tooru Fujisawa
2c2facfee0 Bug 1720615 - Stop collecting telemetry for popup condition of window.open. r=smaug
This reverts bug 1710010 change.

Differential Revision: https://phabricator.services.mozilla.com/D120954
2021-08-02 01:12:38 +00:00
Nika Layzell
112f34573e Bug 1586830 - Part 1: Ensure IsInitialDocument is set earlier and consistently on WindowGlobalParent, r=smaug
This makes sure to clear and set the value more consistently when replacing
documents within a WindowGlobal, and makes sure to include the relevant flag in
the initializer.

In addition, the place where the flag is set is moved ahead to happen before
the call to `Embed` so that the information is ready before the window is
created.

Differential Revision: https://phabricator.services.mozilla.com/D119815
2021-07-14 15:51:20 +00:00
Tooru Fujisawa
0731a9aa4b Bug 1710010 - Collect telemetry for popup condition of window.open. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D118448
2021-06-23 04:19:40 +00:00
Kris Maglione
94b09497de Bug 1702678: Handle corner case when opener window is closed from a nested event loop during open. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D111179
2021-05-07 03:00:13 +00:00
Sandor Molnar
9644eccd27 Backed out changeset 761fdc9f84d2 (bug 1702678) for causing assertion failures in windowwatcher/nsWindowWatcher. CLOSED TREE 2021-05-07 05:31:41 +03:00
Kris Maglione
459d168ec2 Bug 1702678: Handle corner case when opener window is closed from a nested event loop during open. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D111179
2021-05-07 01:25:32 +00:00
Dorel Luca
10eb98bd92 Backed out changeset 0672855335bc (bug 1702678) for Mochitest failures in toolkit/components/windowwatcher/nsWindowWatcher.cpp. CLOSED TREE 2021-05-05 02:01:05 +03:00
Kris Maglione
448d370c48 Bug 1702678: Handle corner case when opener window is closed from a nested event loop during open. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D111179
2021-05-04 21:19:22 +00:00
Emilio Cobos Álvarez
878e6a6131 Bug 1694927 - Don't allow location APIs to steal focus. r=smaug,hsivonen
The check was a bit too general it seems. Explicitly allow moving focus
for link clicks and window.open(), which are the things we have tests
for and care about moving focus.

Differential Revision: https://phabricator.services.mozilla.com/D107039
2021-03-03 15:44:59 +00:00
Olli Pettay
e9d171edcd Bug 1689601, add a comment about missing LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105230
2021-03-02 12:13:16 +00:00
Mihai Alexandru Michis
f7d499a648 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
c9e9343a7c Bug 1689601, add a comment about missing LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105230
2021-03-02 09:44:09 +00:00
Emilio Cobos Álvarez
6f93d6f391 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
Emilio Cobos Álvarez
cf5b61e76d Bug 1667723 - Don't block opening the print dialog if the page sandbox auxiliary navigations. r=nika
Matches other browsers and fixes the regression. Print dialogs really
aren't an auxiliary navigation, even though we implement them similarly.

Differential Revision: https://phabricator.services.mozilla.com/D91739
2020-09-29 15:47:11 +00:00
Simon Giesecke
ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Nika Layzell
cbb7e8111c Bug 1659696 - Check PendingInitialization before targeting in window.open, r=kmag
This requires adding the flag as a synced field on the BrowsingContext, and
checking it in a few more places. Attempts to open a new window in this racy
manner will now raise an exception.

This should avoid the issue from bug 1658854 by blocking the buggy attempts to
load before the nested event loop has been exited.

Differential Revision: https://phabricator.services.mozilla.com/D87927
2020-09-16 20:47:55 +00:00
Tooru Fujisawa
735923df57 Bug 1663500 - Revert bug 1661643 change and resurrect browser.link.open_newwindow=1. r=Gijs,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D89447
2020-09-08 12:09:43 +00:00
Tooru Fujisawa
34ac1f4f95 Bug 1661643 - Remove browser.link.open_newwindow=1. r=preferences-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D88572
2020-08-28 13:44:46 +00:00
Emilio Cobos Álvarez
2c0dea8fd4 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
Edgar Chen
6fed29e010 Bug 1611961 - Move UserActivationState from BrowsingContext to WindowContext; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D83126
2020-08-17 11:02:34 +00:00
Csoregi Natalia
1d46598d45 Backed out 3 changesets (bug 1648887, bug 1611961) for assertion failures on WindowContext.cpp. CLOSED TREE
Backed out changeset 3719f7db339d (bug 1648887)
Backed out changeset b7c7fcb5df37 (bug 1648887)
Backed out changeset ab82a9c613f8 (bug 1611961)
2020-08-06 17:43:51 +03:00
Edgar Chen
ef727eb50f Bug 1611961 - Move UserActivationState from BrowsingContext to WindowContext; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D83126
2020-08-06 10:25:00 +00:00
Andreas Farre
b447c24f6c Bug 1613431 - Part 3: Handle synced setters return value. r=nika
Depends on D83646

Differential Revision: https://phabricator.services.mozilla.com/D83647
2020-07-31 13:37:13 +00:00
Sebastian Streich
346b193c48 Bug 1558394 - Pass the TriggeringSandboxFlags to nsILoadinfo r=ckerschb,smaug,necko-reviewers,valentin
Add triggering Sandbox flags to loadinfo
***
Pass triggering Flags into Loadinfo

***
Fix triggeringSandboxflags passing

Differential Revision: https://phabricator.services.mozilla.com/D69588
2020-07-29 11:43:23 +00:00
Olli Pettay
d87cc115c8 Bug 1654088, make WindowWatcher methods to use CStrings and not char and make window.open throw the correct exception, r=farre,geckoview-reviewers,agi*
Differential Revision: https://phabricator.services.mozilla.com/D84604
2020-07-27 21:36:24 +00:00
Simon Giesecke
a89b3bd48b Bug 1653229 - Remove unnecessary includes for BindingUtils.h. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D83771
2020-07-22 15:12:10 +00:00
Tooru Fujisawa
510e816a77 Bug 1623826 - Do not expose outerWidth/outerHeight features of window.open to web content. r=smaug
Depends on D81969

Differential Revision: https://phabricator.services.mozilla.com/D81970
2020-07-15 04:40:08 +00:00
Tooru Fujisawa
8e09fa4df1 Bug 1645084 - Stop collecting telemetry for outerWidth/outerHeight features of window.open in web content. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D81969
2020-07-15 04:40:01 +00:00
Razvan Maries
4cd919d687 Backed out 2 changesets (bug 1623826, bug 1645084) for perma failures on browser_popup_condition.js. CLOSED TREE
Backed out changeset 2acb78b73c26 (bug 1623826)
Backed out changeset 91a58ff5ad11 (bug 1645084)
2020-07-14 19:30:06 +03:00
Tooru Fujisawa
af5e5a01c6 Bug 1623826 - Do not expose outerWidth/outerHeight features of window.open to web content. r=smaug
Depends on D81969

Differential Revision: https://phabricator.services.mozilla.com/D81970
2020-07-14 13:23:50 +00:00
Tooru Fujisawa
1f21836be0 Bug 1645084 - Stop collecting telemetry for outerWidth/outerHeight features of window.open in web content. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D81969
2020-07-14 13:23:38 +00:00
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00