Commit Graph

801726 Commits

Author SHA1 Message Date
Tom Ritter
5d4fe766fe Bug 1737829: Change the Navigator::UserAgent function for RFP r=asuth
We change it from taking bool aIsCallerChrome to
Maybe<bool> aShouldResistFingerprinting.  If there is
a value in there, it is used for determining RFP status.
If not, we call ShouldRFP with the provided Document.

This is needed because on a Worker, we wind up in UserAgent
with no Document, we need to pass the RFP decision in
from WorkerPrivate.

Differential Revision: https://phabricator.services.mozilla.com/D144581
2022-07-15 20:39:23 +00:00
Tom Ritter
f11bc3e771 Bug 1737829: Add loadInfo to nsHttpChannel::Init() r=necko-reviewers,kershaw
Everywhere except one loadInfo is supplied to an HTTPChannel
right after it is Init()-ed.  Inside of Init we would like to
use the loadInfo so we'll put it in there.

Differential Revision: https://phabricator.services.mozilla.com/D144580
2022-07-15 20:39:22 +00:00
Tom Ritter
cda59e5d3d Bug 1737829: Add a test for fine-grained RFP checks r=asuth
Additionally, add some more helpful worker annotations.

Differential Revision: https://phabricator.services.mozilla.com/D144579
2022-07-15 20:39:22 +00:00
Muhammad
0bf10d70ab Bug 1737829: Cut over Navigator components to fine-grained RFP Checks r=tjr,asuth
Whereas previously we would pass in the principal of a document,
now we will pass in the document directly. This will work for most use
cases, but not all (like Workers.)

Additionally, for the User Agent, if we do not Resist Fingerprinting
(because there is an exemption), we will fall through to getting the
User-Agent header which uses the coarse RFP check, so we fix that in
a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D138778
2022-07-15 20:39:21 +00:00
Tom Ritter
3b30c427d9 Bug 1770498: Update the browser_canvas_rfp_exclusion.js test r=timhuang
Previously, this test would open a page and then enable/disable
RFP while the tab was open, writing and reading the canvas as
it went.

Now that CookieJarSettings gets initialized when a document loads
and stays constant for the lifetime of the document, we cannot enable
and disable the prefs and expect them to continue to behave correctly.

We do a 'pre-test' to populate a canvas and then get the true image
data for it. Then we set the preferences prior to loading future
documents and compare the extracted canvas data to the known-correct
data to see if we are correctly spoofing it or not.

Differential Revision: https://phabricator.services.mozilla.com/D150592
2022-07-15 20:39:21 +00:00
Tom Ritter
03d9a1afdc Bug 1770498: De-duplicate the CookieJar check into a local function r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D151679
2022-07-15 20:39:20 +00:00
Tom Ritter
b732796900 Bug 1770498: Create ShouldRFP(nsILoadInfo) and make ShouldRFP(nsIPrincipal) explicitly dangerous r=timhuang
- Move ShouldRFP(char*), ShouldRFP(docshell), ShouldRFP(Document)
  below some utility code.

- Now that we know we should check the CookieJarSettings, using
  ShouldRFP(nsIPrincipal) is dangerous.  We mark it as dangerous
  and annotate the existing uses of it.

- At the same time, an nsILoadInfo has the CookieJarSettings we
  want to check, so create a ShouldRFP(nsILoadInfo) that checks
  it and cascades to the (marked-dangerous-but-not-dangerous-for-
  this-call) principal function.

- We also correct a situation where WorkerLoadInfo does not
  initialize the shouldRFP member.

Differential Revision: https://phabricator.services.mozilla.com/D150591
2022-07-15 20:39:20 +00:00
Tom Ritter
61152c85e9 Bug 1770498: Add shouldResistFingerprinting to RemoteWorkerData r=asuth
Previously, we initialized WorkerLoadInfo's shouldRFP member
using the Worker's principal at time of construction. It is
better to populate it from the RemoteWorkerData structure.

The RemoteWorkerData's shouldRFP member can be initialized
with the correct context.

In ServiceWorkerPrivateImpl.cpp it has the same effect, before
and after we use ServiceWorkerInfo.mPrincipal

But for SharedWorker.cpp we previously used
RemoteWorkerData.principalInfo (the second of three principal
members).  This was initialized from the WorkerLoadInfo.mPrincipal
member, which in turn came from loadInfo.mChannel which in turn
came from loadInfo.mLoadingPrincipal.

Now we use the WorkerLoadInfo.mShouldResistFingerprinting member
which is initialized from
nsContentUtils::ShouldResistFingerprinting(document) in
WorkerPrivate::GetLoadInfo which can take into account greater
context which will be important in the next few patches.

Differential Revision: https://phabricator.services.mozilla.com/D150590
2022-07-15 20:39:19 +00:00
Tom Ritter
700f6f1322 Bug 1770498: Use the CookieJarSetting's ShouldRFP Member in nsContentUtils::ShouldRFP r=timhuang
Now that the ShouldRFP member is correctly populated (we hope)
in CookieJarSettings, we can use it in our ShouldRFP methods.

There are two general scenarios:
  An exempted domain frames a non-exempted domain.
     The inner frame should be non-exempted.
  A non-exempted domain frames an exempted domain
     The inner frame should be non-exempted.

In the first scenario, CookieJarSettings.shouldRFP member
will be false (exempted.)  We clearly cannot blindly rely
on the member, it would be wrong here.

In the second scenario, CookieJarSettings.shouldRFP member
will be true (non-exempted). This is the scenario we really
need CookieJarSettings for.

----

We take the opportunity to add an additional check for the
'exempted domain framed by a non-exempted domain' scenario.
This additional check takes advantage of the first party
isolation key (for FPI) or partition key (for dFPI).

Differential Revision: https://phabricator.services.mozilla.com/D150589
2022-07-15 20:39:19 +00:00
Tom Ritter
1c40624193 Bug 1770498: Populate the RFP member of CookieJar Settings r=timhuang,geckoview-reviewers,owlish
CookieJarSettings frequently gets populated in a place
where we have ready access to the Document/Channel it
is being constructed for. This lets us populate the boolean
and pass it into CookieJarSetting's constructor easily.

When it is created for LoadInfo, we need to plumb the URI
through by adding it to LoadInfo::CreateForDocument.

Differential Revision: https://phabricator.services.mozilla.com/D150588
2022-07-15 20:39:19 +00:00
Tom Ritter
489d2393ae Bug 1770498: Add RFP to CookieJarSettings r=timhuang
Before we took a very simplistic view to domain-based RFP
exemptions - if the loading principal said an exempted
domain, you were exempted.

This did not intelligently take into account iframes. In
particular, if a non-exempted domain framed an exempted
domain, the exempted domain's iframe would be exempted.

It probably should not. This is debatable, but at this
point in time after consultation with Tor we are going
to take the approach described in the comments in
CookieJarSettings.h

Notably this is creating a gap when it comes to nested
iframes.  If an exempted domain iframes a non-exempted
domain, which in turn iframes an exempted domain - the
innermost iframe will be exempted even though its parent
is not.  This is not ideal, once a document is non-
exempted, all children should be non-exempted. But this
is especially difficult to implement with the facilities
easily available to us, so we leave this corner case for
another day.

Differential Revision: https://phabricator.services.mozilla.com/D150587
2022-07-15 20:39:18 +00:00
Tom Ritter
b5ba63bcef Bug 1770498: Use the final channel URI for SubDocument types also r=ckerschb
Testing indicated that for a SubDocument, the loading principal
is that of the parent document, but the final channel uri is
the uri of the subdocument.  In this situation, use the final
channel uri just as we do for a Document.

Differential Revision: https://phabricator.services.mozilla.com/D150586
2022-07-15 20:39:18 +00:00
Tom Ritter
3c7a0eef40 Bug 1770498: Abstract the Document check so it can be used in more places r=ckerschb
In rare cases, we will need to see if we ShouldRFP using
only a URI and OA.  (This is already the case for a
top-level load.)

Abstract this check into its own function, but at the
same time explicitly label it as dangerous and require
the developer to provide a justification why they need
to use it to hopefully prevent misuse.

Differential Revision: https://phabricator.services.mozilla.com/D150585
2022-07-15 20:39:18 +00:00
Tom Ritter
a53968736e Bug 1770498: Simplify Principal-based ShouldRFP check r=ckerschb,freddyb
- Reorder ShouldRFP(char* justification) to put it first
 - Add a log line about a null dochsell to be consistent
 - Significantly alter the ShouldRFP(nsIPrincipal) check:

   Before, it was a coarse function, if you weren't system
   principal, it just checked the pref.

   Now, it has been combined with the ShouldRFP(nsIPrincipal, OriginAttributes)
   function, which was fine-grained. That function didn't
   need to exist, because we can _get_ the OriginAttributes
   _from_ the principal.

   Because before we were retrieving the OA from the loadInfo
   (and not the principal) we add an assert to ensure they're
   the same.

   We eliminate the ShouldRFP(nsIPrincipal, OriginAttributes)
   function entirely and convert its one caller into just
   passing the principal.

   One result of all of this is that the ShouldRFP(nsIPrincipal)
   check has been turned into a fine-grained check.

Differential Revision: https://phabricator.services.mozilla.com/D146945
2022-07-15 20:39:17 +00:00
Tom Ritter
519e427b97 Bug 1770498: Correct a call to ShouldRFP r=smaug
Instead of trying to get the ScriptObjectPrincipal
of a window; use the window's Document, which will
take into account a lot more context.

Differential Revision: https://phabricator.services.mozilla.com/D150584
2022-07-15 20:39:16 +00:00
Sammy Khamis
17f0e3707b Bug 1777601 - Redesign Sync Mobile Device Screen r=Gijs,fluent-reviewers,preferences-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D150821
2022-07-15 20:34:31 +00:00
Lee Salzman
db788f9953 Bug 1779766 - Ensure DrawTargetWebgl is done using shmem before dealloc. r=aosmond,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151957
2022-07-15 20:34:19 +00:00
Ryan Hunt
3eea487471 Bug 1777604 - wasm: Conservatively flush icache for all threads when compiling a module on ARM64. r=nbp
See https://bugzilla.mozilla.org/show_bug.cgi?id=1777604#c12 for
more information.

Differential Revision: https://phabricator.services.mozilla.com/D151677
2022-07-15 19:37:18 +00:00
Haik Aftandilian
a064a6ac2d Bug 1779816 - Don't specify entitlements that use the default setting of false r=mac-reviewers,bradwerth
Cleanup our entitlement files by removing entitlements that use the default setting of false.

production.entitlements.xml and developer.entitlements.xml are used today.

The browser and plugin-container entitlement lists will be used when we enable using different entitlements for parent and child processes.

Differential Revision: https://phabricator.services.mozilla.com/D151943
2022-07-15 19:30:47 +00:00
Andrew Osmond
65ee6ac311 Bug 1779771 - Use thread local ScreenReferenceDrawTarget for CanvasPath::Constructor. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D151944
2022-07-15 19:22:21 +00:00
James Teow
b09009da4c Bug 1679556 - Toggle browser.fixup.alternate.enabled and add telemetry, r=mak
The suggested solution for this bug is to disable browser.fixup.alternate.enabled
unless toggled by the user, and to add telemetry to the preference so that if we
find users rarely use the option, we can safely remove the feature in a future release.

Many tests rely on expecting URI's to be modified, so I modified them so that they
should not expect the prefix or suffix to be modified.

Differential Revision: https://phabricator.services.mozilla.com/D147795
2022-07-15 19:08:56 +00:00
Butkovits Atila
06d063b4c9 Backed out changeset 0e60cc940997 (bug 1772339) for causing failures at browser_keyboardShortcut.js. CLOSED TREE 2022-07-15 21:42:23 +03:00
Janvi Bajoria
580833a166 Bug 1772339 - Hover states for PiP playback controls r=kpatenio,niklas,flod
Differential Revision: https://phabricator.services.mozilla.com/D149039
2022-07-15 17:47:06 +00:00
David Shin
3fa1dd240a Bug 1774135 - ResizeObserver: Take subpixel snapping into account when reporting devicePixelContentBoxSize. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151549
2022-07-15 17:45:36 +00:00
Thomas Wisniewski
bc21b9473b Bug 1717806 - fix the redirect-requiring SmartBlock shims to work consistently; r=ksenia,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151925
2022-07-15 17:38:24 +00:00
Lee Salzman
4c9f7436ee Bug 1779804 - Check for valid target in DrawTargetWebgl before accessing shmem. r=aosmond,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D151938
2022-07-15 16:34:02 +00:00
Tom Schuster
3400605cfd Bug 1740420 - Improve sandbox error message when accessing storages. r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D150255
2022-07-15 16:33:46 +00:00
Jon Coppeard
a66815a252 Bug 1779733 - Skip post barriers for the values of nusery allocated Maps r=jandem
This skips post barriers for MapObject tables when the JS Map object is in the
nursery. The change to the finalizer is required so that we don't try and
remove store buffer entries that were not created in the first place.

I don't like the way this works by casting the table pointer to a different type
with the same memory layout, but it's something we do already in that code and
it's the simplest solution to this problem.

Differential Revision: https://phabricator.services.mozilla.com/D151916
2022-07-15 16:05:54 +00:00
Sebastian Hengst
5f5698c214 Bug 1765416 - disable test_vendor.py on all platforms. r=ahochheiden DONTBUILD
Test can be reenabled after the migration to Python 3.7+ (bug 1734402) because
the fixed Poetry version (1.2.0) has that as minimum requirement.

Differential Revision: https://phabricator.services.mozilla.com/D151913
2022-07-15 15:54:56 +00:00
Jason Prickett
f2725644ad Bug 1779048 - Adding PIN and OTHER as promo types in PbNewTab message schema r=pdahiya,barret
Differential Revision: https://phabricator.services.mozilla.com/D151664
2022-07-15 15:52:04 +00:00
Iulian Moraru
26f8a8400a Backed out 6 changesets (bug 1773691, bug 1773695) for causing condprof xpcshell failures on test_ext_webRequest_urlclassification.js. CLOSED TREE
Backed out changeset f1d59396c406 (bug 1773695)
Backed out changeset db926abd402c (bug 1773695)
Backed out changeset 1c2556d56a53 (bug 1773695)
Backed out changeset cd29b0766f86 (bug 1773695)
Backed out changeset 6c7bd0531bc6 (bug 1773695)
Backed out changeset 0b4036e39469 (bug 1773691)
2022-07-15 18:53:49 +03:00
James Graham
a1aa142a60 Bug 1756182 - Ensure we reset actions state before using them in a test, r=webdriver-reviewers,whimboo
This prevents actions state set up in one test leaking into subsequent tests.

Differential Revision: https://phabricator.services.mozilla.com/D139122
2022-07-15 14:42:10 +00:00
James Graham
0f0bcca821 Bug 1543337 - Allow multiple pointermove events in touch infrastructure tests, r=webdriver-reviewers,whimboo
At least in gecko, we are generating a pointermove event for each
pointer even when there was no actual change. This corresponds to the
behaviour of touch events, where the touchmove event includes all
active touch points.

Although this looks like it doesn't match the intent of the Pointer
Events spec, for an infrastructure test that's just checking if the
testdriver feature is supported, it seems better to allow the
discrepancy from the ideal behaviour rather than imply that the whole
feature is broken.

Differential Revision: https://phabricator.services.mozilla.com/D151276
2022-07-15 14:42:10 +00:00
James Graham
24b6d46ba4 Bug 1543337 - Split touch pointer event into two, r=webdriver-reviewers,whimboo,jdescottes
For touch type pointers gecko doesn't support all the properties in pointer-events (and
it's not even very clear to me that they all make sense; how can one talk about the twist of
a finger, for example?). So split out a version of the tests that only test the properties
which are supported, so that we can regression-test the basics without failing due to missing
support at the engine layer for more complex properties.

Differential Revision: https://phabricator.services.mozilla.com/D139121
2022-07-15 14:42:09 +00:00
James Graham
e56d9c755b Bug 1543337 - Change some for (let _ of …) to for (const _ of …), r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D150812
2022-07-15 14:42:09 +00:00
James Graham
01bd544526 Bug 1543337 - Ensure we pass integer coordinates to actions, r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151531
2022-07-15 14:42:09 +00:00
James Graham
cce5215825 Bug 1543337 - Implement support for touch input in marionette, r=webdriver-reviewers,whimboo,jdescottes
Touch is a bit different to mouse inputs because there are often
multiple pointers (i.e. fingers) acting at the same time. It turns out
that Gecko wants a single call containing all the positions etc. of
the touch pointers for each event, rather than having a single call
per pointer. So we have to group the pointer actions from one tick
together.

Differential Revision: https://phabricator.services.mozilla.com/D139120
2022-07-15 14:42:08 +00:00
Tim Huang
eba6c660c7 Bug 1773695 - Part 5: Add a test for the email tracking protection. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151051
2022-07-15 14:30:22 +00:00
Tim Huang
4761e6ee29 Bug 1773695 - Part 4: Add email tracking flags to webrequest. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D151151
2022-07-15 14:30:21 +00:00
Tim Huang
82e7464da4 Bug 1773695 - Part 3: Implement email tracking url classifier feature. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151050
2022-07-15 14:30:21 +00:00
Tim Huang
ef064b90b5 Bug 1773695 - Part 2: Add flags for the email tracking protections. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151049
2022-07-15 14:30:20 +00:00
Tim Huang
fb52aa79c4 Bug 1773695 - Part 1: Add prefs for email tracking protection. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151048
2022-07-15 14:30:20 +00:00
Tim Huang
bbc73340ad Bug 1773691 - Add email tracking prtoection and annotation to the safebrowsing module. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D151047
2022-07-15 14:30:19 +00:00
ui.sayuree
8f559e5415 Bug 1777147 - remove DownloadsSubview module reference. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D151862
2022-07-15 14:28:08 +00:00
Csoregi Natalia
3b6429d367 Backed out changeset ca6ec0d979df (bug 1769290) for causing build bustages. CLOSED TREE 2022-07-15 16:48:37 +03:00
Benjamin VanderSloot
197f0123aa Bug 1779603 - Disable Always Partition Storage on xorigin mochitests, r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D151866
2022-07-15 13:26:23 +00:00
Thomas Wisniewski
35f5a93f4a Bug 1762462 - Make tests in toolkit/components/extensions/test/ reflect Always Partitioning Storage; r=mixedpuppy
Depends on D151393

Differential Revision: https://phabricator.services.mozilla.com/D151394
2022-07-15 13:26:23 +00:00
Thomas Wisniewski
32617075f6 Bug 1762462 - Make tests in dom/websocket/tests/ reflect Always Partitioning Storage; r=baku
Depends on D144731

Differential Revision: https://phabricator.services.mozilla.com/D151393
2022-07-15 13:26:23 +00:00
Benjamin VanderSloot
b87403fcef 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-15 13:26:22 +00:00
Thomas Wisniewski
848e1fad89 Bug 1762462 - Disable Always Partitioning Storage pref for Web Platform Tests; r=bvandersloot
Depends on D148059

Differential Revision: https://phabricator.services.mozilla.com/D148060
2022-07-15 13:26:22 +00:00