Commit Graph

646 Commits

Author SHA1 Message Date
Vincent Hilla
e7e22edc70 Bug 1959610 - Align CloseOuter with #script-closable session history check. r=smaug
Since https://github.com/whatwg/html/pull/6315, script-closable checks for a
history length of one, instead of the session history containing only one
document.

This commit also adds a wpt to test that windows opened by links and forms
count as `created by a script`.

Differential Revision: https://phabricator.services.mozilla.com/D245035
2025-04-22 09:34:17 +00:00
Emilio Cobos Álvarez
4d8cd3814a Bug 1960602 - More explicitly block bfcache when a subframe is loading. r=smaug
The test now passes with http2/http3 (where it didn't use to because the
frame was not OOP in that case).

Differential Revision: https://phabricator.services.mozilla.com/D245741
2025-04-17 11:37:08 +00:00
Norisz Fay
f74c4d8e9e Backed out changeset 8305c9bfb249 (bug 1960602) for causing Android mochitest failures on test_blockBFCache.html CLOSED TREE 2025-04-17 04:28:20 +03:00
Emilio Cobos Álvarez
4a9cc7bd93 Bug 1960602 - More explicitly block bfcache when a subframe is loading. r=smaug
The test now passes with http2/http3 (where it didn't use to because the
frame was not OOP in that case).

Differential Revision: https://phabricator.services.mozilla.com/D245741
2025-04-16 19:19:17 +00:00
kernp25
4d18975ff5 Bug 1945924 - Replace SchemeIsFoo functions with the inlined SchemeIs() call. r=valentin,emilio,necko-reviewers,geckoview-reviewers,anti-tracking-reviewers,core-sessionstore-reviewers,ohall,farre
No behavior change intended.

Differential Revision: https://phabricator.services.mozilla.com/D236756
2025-03-31 14:25:54 +00:00
Nika Layzell
c8bf149cfc Bug 1665474 - Part 5: Add support for the Origin-Agent-Cluster HTTP header, r=farre
This adds support for the Origin-Agent-Cluster header. A map from principals to
their cached origin-agent-cluster status is maintained in the
BrowsingContextGroup, and synchronized to child processes such that it can be
used to create DocGroups.

Note that this patch does not implement origin-keyed process isolation for
Fission. Fission process isolation still always uses the site-origin.

It's likely we'll want to implement additional hereustics and/or tracking to
decide when to perform origin-keyed process isolation to avoid potential
process count increases when the default is changed to origin-isolated.

Differential Revision: https://phabricator.services.mozilla.com/D236974
2025-03-03 22:51:28 +00:00
Rob Wu
2b9e9d3154 Bug 1949587 - Restore picker behavior for hidden extension pages r=edgar
Since Firefox 136, pickers cannot be opened from non-focused tabs.
Unintentionally, background pages of extensions and devtools pages of
extensions were also affected, because their browsers are embedded in a
hidden XUL window, which is considered not focused.

This patch updates CanonicalBrowsingContext::CanOpenModalPicker to allow
pickers to be opened from specific hidden extension browsers again.

To evaluate the feasibility of enforcing the restriction for hidden
background pages, this patch puts the restriction behind a pref,
enabled by default on Nightly only. If no signs of broken extensions
are reported for a few releases, we can set the pref by default, to
enforce the restriction (and document the change accordingly).
After another few releases we can evaluate whether to enforce the
restriction permanently (effectively removing the exception from
this patch) or to revert the pref.

Differential Revision: https://phabricator.services.mozilla.com/D239046
2025-02-21 19:02:19 +00:00
Rob Wu
ff0298c05d Bug 1949092 - Fix canOpenModalPicker for nested browsers + tests r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D238843
2025-02-20 21:38:40 +00:00
Adam Vandolder
23e9c9915a Bug 1890747 - Track Navigation history entries. r=dom-core,farre
Differential Revision: https://phabricator.services.mozilla.com/D219007
2025-02-13 03:11:20 +00:00
Emilio Cobos Álvarez
300a114109 Bug 1947023 - Propagate hidden-under-embedder properly to nested tops. r=nika,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D237502
2025-02-10 17:50:57 +00:00
Florian Quèze
9609e47f62 Bug 1879329 - script generated replacement of the GleanMetrics.h includes, r=chutten,valentin,media-playback-reviewers,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,rkraesig,emz,aabh,padenot.
Differential Revision: https://phabricator.services.mozilla.com/D234744
2025-01-21 11:21:45 +00:00
Edgar Chen
550690c003 Bug 1837963 - Disallow opening file pickers from background tabs; r=geckoview-reviewers,emilio,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D230087
2025-01-16 11:30:36 +00:00
Sandor Molnar
5a87a4f673 Backed out 3 changesets (bug 1837963) for causing build bustages. CLOSED TREE
Backed out changeset cd000de4a239 (bug 1837963)
Backed out changeset d19b71505a16 (bug 1837963)
Backed out changeset 7c4052454ec2 (bug 1837963)
2025-01-15 02:54:56 +02:00
Edgar Chen
ff32fd204b Bug 1837963 - Disallow opening file pickers from background tabs; r=geckoview-reviewers,emilio,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D230087
2025-01-15 00:14:37 +00:00
Norisz Fay
f8452b2129 Backed out 4 changesets (bug 1837963) for causing build bustages on nsColorPicker.cpp
Backed out changeset 6465dbafe002 (bug 1837963)
Backed out changeset 5ed6d107133f (bug 1837963)
Backed out changeset 90114d0e72d1 (bug 1837963)
Backed out changeset 36f4b96eb15b (bug 1837963)
2025-01-14 15:23:14 +02:00
Edgar Chen
eda589c635 Bug 1837963 - Disallow opening file pickers from background tabs; r=geckoview-reviewers,emilio,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D230087
2025-01-14 12:33:43 +00:00
Adam Vandolder
2ba689d99e Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-12-05 01:20:07 +00:00
Goloman Adrian
05b7d33317 Backed out changeset 4d19e4620e63 (bug 1924861) for causing bc failures @browser_stop_pending.js. CLOSED TREE 2024-12-04 09:11:45 +02:00
Adam Vandolder
87c9038ba7 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-12-04 04:17:36 +00:00
Cosmin Sabou
82fbc8fbe4 Backed out changeset a8d030efc4ea (bug 1924861) for causing bc failures on browser_stop_pending. 2024-12-02 01:21:14 +02:00
Adam Vandolder
f6e7455adc Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-12-01 04:13:01 +00:00
Sandor Molnar
7e190c9386 Backed out changeset b94afd94ed9c (bug 1924861) for causing multiple bc failures. CLOSED TREE 2024-11-30 20:40:15 +02:00
Adam Vandolder
5f7b028386 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-11-29 23:38:09 +00:00
Emilio Cobos Álvarez
ce8bfaf724 Bug 1933119 - Fix non-remote frame focus after frameloader change too. r=Jamie,smaug
Differential Revision: https://phabricator.services.mozilla.com/D230097
2024-11-26 12:13:30 +00:00
Butkovits Atila
6a4f64d393 Backed out changeset 8c5bff1fa41a (bug 1924861) for causing failures at forward.py. 2024-11-26 12:51:09 +02:00
Adam Vandolder
fad0c07fe5 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-11-26 04:48:49 +00:00
Sandor Molnar
7058c42e18 Backed out changeset c64aebba09d9 (bug 1924861) for causing mochitest failures. CLOSED TREE 2024-11-26 03:17:30 +02:00
Adam Vandolder
2d308415a4 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-11-25 23:18:32 +00:00
Emilio Cobos Álvarez
dfafb7731c Bug 1930425 - Dump JS stack when trying to incorrectly set activeness. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D228615
2024-11-12 15:41:41 +00:00
Norisz Fay
7c7d41d846 Backed out changeset 5b4cea7ea948 (bug 1924861) for causing mochitest failures on test_ext_tabs_goBack_goForward.html, test_bug1300461.html CLOSED TREE 2024-10-29 04:57:43 +02:00
Adam Vandolder
b0355ca479 Bug 1924861 - Only show the first history entry if it has user interaction. r=dom-core,omc-reviewers,sessionstore-reviewers,dao,peterv,tabbrowser-reviewers,mviar,sfoster
Differential Revision: https://phabricator.services.mozilla.com/D221390
2024-10-29 00:27:19 +00:00
Andreas Farre
4228753e09 Bug 1926456 - Skip discarded contexts when setting synced field. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D226769
2024-10-24 12:47:34 +00:00
Florian Quèze
fd32d5896d Bug 1923028 - Migrate scalars to use Glean APIs for dom.*, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D226688
2024-10-24 10:52:57 +00:00
Adam Vandolder
fdd2d05bdb Bug 1917369 - Track user interaction state in docshell's active entry. r=dom-core,peterv
Differential Revision: https://phabricator.services.mozilla.com/D221389
2024-09-12 13:12:58 +00:00
Emilio Cobos Álvarez
60ca3ff493 Bug 1914149 - Propagate zoom to new browsing contexts unconditionally. r=nika
Your patch looks good to me. Not sure if there's a non-racy way of
testing the internal full-zoom value here...

But in general, assuming consistent zoom lacking other sources of
information seems like the right thing to do.

I agree that eventually we want to probably move the site-specific zoom
impl into Gecko (if only because Android is also going to want that, see
bug 1547181, where I added a comment).

Co-authored-by: Nika Layzell <nika@thelayzells.com>

Differential Revision: https://phabricator.services.mozilla.com/D220277
2024-09-02 11:28:05 +00:00
Fatih
e3dce50ad3 Bug 1885101: Match screen and window properties with top window for ScreenRect, ScreenAvailRect and WindowOuterSize. r=timhuang,emilio
This patch removes test_iframe.html. We remove it because the newly introduced test covers the tests done in that test. The reason for removing it in the first place is now that screen properties are inherited/spoofed xorigin, we get a 4px difference. The reasosn for 4px difference is the test runner runs tests in an iframe with a 2px border on each side.

Differential Revision: https://phabricator.services.mozilla.com/D215509
2024-08-06 15:31:34 +00:00
Nika Layzell
0c56f81d86 Bug 1834864 - Select BCG more consistently during COOP+COEP process switches, r=smaug,tabbrowser-reviewers,mak
Previously it was possible to bypass specific BCG selection based on
cross-origin isolated status if the site was allowed to load file URIs
using enterprise policies, which could lead to a crash.

This patch changes the behaviour such that BCG selection now happens
correctly. The site will still not be cross-origin isolated due to being
loaded into a file content process.

Differential Revision: https://phabricator.services.mozilla.com/D217007
2024-07-19 14:38:20 +00:00
Henri Sivonen
7d94c50478 Bug 1753352 - Inherit principal into about:blank with query string. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D212093
2024-07-17 16:12:53 +00:00
Nika Layzell
279b50ebe8 Bug 1728331 - Part 4: Make ContentParent KeepAlives explicit with RAII references, r=smaug,dom-worker-reviewers,asuth
This is a fairly significant patch, however it would be difficult to break it
down into smaller patches:

1) The various mechanisms used to manage ContentParent lifecycles have been
   merged together into a common "KeepAlive" system. A process will
   begin shutdown when its keepalive count reaches 0. (though it will
   still wait for all BrowserParents to also be dead before sending the
   actual shutdown message as before).

   This replaces a number of bespoke systems for tracking BrowserParent
   instances in different lifecycle states, remote workers, ongoing
   process switches, and preallocated processes.

2) KeepAlives are now managed automatically by a UniquePtr variant
   (Unique[Threadsafe]ContentParentKeepAlive). This makes the hand-off
   over KeepAlive lifecycles explicit, even for workers.

3) All KeepAlives are now keyed by a BrowserId, which will be 0 for keepalives
   not associated with a specific tab. This allows the new process
   selection logic to count all tabs other than the one being navigated
   when deciding which process to use.

4) The process switching logic now tracks it's KeepAlive with a BrowserId,
   meaning that ongoing process switches are considered when performing
   process selection, even if the BrowserParent hasn't been created yet.

Differential Revision: https://phabricator.services.mozilla.com/D213338
2024-06-24 23:19:28 +00:00
Aron Cseh
b01be1057e Backed out 9 changesets (bug 1901851, bug 1728331) for causing remote worker crashes. a=backout
Backed out changeset 30bbda0eb197 (bug 1728331)
Backed out changeset dabd7d6836c8 (bug 1728331)
Backed out changeset 9e04f49c926e (bug 1728331)
Backed out changeset 779ac735736c (bug 1728331)
Backed out changeset 1d413fe340a0 (bug 1728331)
Backed out changeset 15608efcbeb6 (bug 1901851)
Backed out changeset f711bbec11b2 (bug 1901851)
Backed out changeset 8bb1d267d08f (bug 1901851)
Backed out changeset b29282956a04 (bug 1901851)
2024-06-22 00:52:24 +03:00
Nika Layzell
7547f3f8db Bug 1728331 - Part 4: Make ContentParent KeepAlives explicit with RAII references, r=smaug,dom-worker-reviewers,asuth
This is a fairly significant patch, however it would be difficult to break it
down into smaller patches:

1) The various mechanisms used to manage ContentParent lifecycles have been
   merged together into a common "KeepAlive" system. A process will
   begin shutdown when its keepalive count reaches 0. (though it will
   still wait for all BrowserParents to also be dead before sending the
   actual shutdown message as before).

   This replaces a number of bespoke systems for tracking BrowserParent
   instances in different lifecycle states, remote workers, ongoing
   process switches, and preallocated processes.

2) KeepAlives are now managed automatically by a UniquePtr variant
   (Unique[Threadsafe]ContentParentKeepAlive). This makes the hand-off
   over KeepAlive lifecycles explicit, even for workers.

3) All KeepAlives are now keyed by a BrowserId, which will be 0 for keepalives
   not associated with a specific tab. This allows the new process
   selection logic to count all tabs other than the one being navigated
   when deciding which process to use.

4) The process switching logic now tracks it's KeepAlive with a BrowserId,
   meaning that ongoing process switches are considered when performing
   process selection, even if the BrowserParent hasn't been created yet.

Differential Revision: https://phabricator.services.mozilla.com/D213338
2024-06-20 19:24:51 +00:00
Andreas Farre
0a1a357b83 Bug 1890748 - Move responsibility of FeaturePolicy initialization to nsILoadInfo. r=freddyb,necko-reviewers,jesup,dom-core,sefeng
Differential Revision: https://phabricator.services.mozilla.com/D207140
2024-06-20 13:22:41 +00:00
Cristian Tuns
cd4bca3a0a Backed out 8 changesets (bug 1901851, bug 1728331) for causing bc failures in browser_docshell_type_editor.js CLOSED TREE
Backed out changeset 2cf5cad90099 (bug 1728331)
Backed out changeset d920c2d72d00 (bug 1728331)
Backed out changeset 9e5bd0186aa6 (bug 1728331)
Backed out changeset 45735575df21 (bug 1728331)
Backed out changeset fbafea1663e3 (bug 1901851)
Backed out changeset 30bdf88d3bb7 (bug 1901851)
Backed out changeset 1d994915bd71 (bug 1901851)
Backed out changeset 0b3249432b9c (bug 1901851)
2024-06-19 20:51:53 -04:00
Nika Layzell
14d11f5f70 Bug 1728331 - Part 4: Make ContentParent KeepAlives explicit with RAII references, r=smaug,dom-worker-reviewers,asuth
This is a fairly significant patch, however it would be difficult to break it
down into smaller patches:

1) The various mechanisms used to manage ContentParent lifecycles have been
   merged together into a common "KeepAlive" system. A process will
   begin shutdown when its keepalive count reaches 0. (though it will
   still wait for all BrowserParents to also be dead before sending the
   actual shutdown message as before).

   This replaces a number of bespoke systems for tracking BrowserParent
   instances in different lifecycle states, remote workers, ongoing
   process switches, and preallocated processes.

2) KeepAlives are now managed automatically by a UniquePtr variant
   (Unique[Threadsafe]ContentParentKeepAlive). This makes the hand-off
   over KeepAlive lifecycles explicit, even for workers.

3) All KeepAlives are now keyed by a BrowserId, which will be 0 for keepalives
   not associated with a specific tab. This allows the new process
   selection logic to count all tabs other than the one being navigated
   when deciding which process to use.

4) The process switching logic now tracks it's KeepAlive with a BrowserId,
   meaning that ongoing process switches are considered when performing
   process selection, even if the BrowserParent hasn't been created yet.

Differential Revision: https://phabricator.services.mozilla.com/D213338
2024-06-19 20:14:50 +00:00
Andreas Farre
a7f8faed6a Bug 1886222 - Start reload by calling reload in the parent. r=Gijs,canadahonk,smaug
Differential Revision: https://phabricator.services.mozilla.com/D211519
2024-06-19 05:49:45 +00:00
Andreas Farre
154d4b7619 Bug 1891670 - Expose crossGroupOpener on CanonicalBrowsingContext. r=dom-core,tabbrowser-reviewers,peterv
Differential Revision: https://phabricator.services.mozilla.com/D212677
2024-06-17 14:16:23 +00:00
Nika Layzell
11d3698341 Bug 1681457 - Allow non-auxiliary BrowsingContexts created by script to close themselves, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211792
2024-06-05 00:06:48 +00:00
Norisz Fay
ed9f22a2fc Backed out changeset 1034029ae9ed (bug 1681457) for causing failures on test_window_close.html CLOSED TREE 2024-06-01 00:10:26 +03:00
Nika Layzell
7025bc892e Bug 1681457 - Allow non-auxiliary BrowsingContexts created by script to close themselves, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D211792
2024-05-31 17:27:15 +00:00
Cristian Tuns
ce526f805f Backed out changeset 9b708a1dc402 (bug 1890748) for causing bc failures in browser_permission_delegate_geo.js CLOSED TREE 2024-05-27 12:25:10 -04:00