Commit Graph

2599 Commits

Author SHA1 Message Date
Fatih Kilic
011eeffeb1 Bug 1970242 - Use more common font Ahem.ttf. a=dmeehan DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D252495

Differential Revision: https://phabricator.services.mozilla.com/D252834
2025-06-06 19:49:27 +00:00
Sylvestre Ledru
8ae54ea4f9 Bug 1519636 - Reformat recent changes to the Google coding style r=geckoview-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,nalexander,gstoll,tcampbell,janv,julienw
Updated with clang-format version 19.1.7 (taskcluster-DYvBxDZJRVqTi8E7pTSJAQ)

Differential Revision: https://phabricator.services.mozilla.com/D249880
2025-05-17 19:11:13 +00:00
Joel Maher
b46dfdb253 Bug 1959284 - clean and sanitize caps|chrome|docshell|dom/**/xpcshell.toml. r=aryx,dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D244838
2025-04-09 14:36:35 +00:00
Joel Maher
34dc8fc793 Bug 1957450 - cleanup chrome.toml files to remove old conditions and standardize remaining conditions. r=aryx,devtools-reviewers,fxview-reviewers,profiler-reviewers,omc-reviewers,migration-reviewers,backup-reviewers,julienw,nchevobbe,mconley,pdahiya,nsharpley
Differential Revision: https://phabricator.services.mozilla.com/D243709
2025-04-01 21:16:45 +00:00
Emilio Cobos Álvarez
89fc1ca8e3 Bug 1955775 - Don't include domain in ContentPrincipal::GetHashValue. r=nika,ckerschb
As it can mutate over the lifetime of the principal.

Differential Revision: https://phabricator.services.mozilla.com/D242653
2025-04-01 12:57:21 +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
f231bdbc51 Bug 1952914 - Part 1: Reduce complexity of GetSiteOriginNoSuffix, r=ckerschb
The most expensive step in ValidatePrincipal is currently building a
SiteOriginNoSuffix from a ContentPrincipal. This codepath has become more hot
due to new checks using ValidatePrincipal.

This refactors the code to avoid doing any work on the principal in more cases.
The new codepath only computes a different siteOrigin for http(s) URIs, which I
believe should be correct. It also does manual parsing of the origin which was
built by GenerateOriginNoSuffixForURI in order to avoid unnecessary calls to
the URI parser.

Differential Revision: https://phabricator.services.mozilla.com/D242420
2025-03-26 02:18:25 +00:00
Magnus Melin
aa41db9b41 Bug 1956233 - avoid getting URI prefs when not contentprincipal. r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D242919
2025-03-25 15:33:35 +00:00
Valentin Gosu
0461ae216d Bug 1943262 - Refactor instantiation of nsEffectiveTLDService r=cookie-reviewers,anti-tracking-reviewers,permissions-reviewers,emz
This ensures that the instantiation of the service always returns the
same singleton. I also changed calls to nsEffectiveTLDService::GetInstance
to use mozilla::components::EffectiveTLD::Service() instead.

Differential Revision: https://phabricator.services.mozilla.com/D235288
2025-01-28 10:56:50 +00:00
Benjamin VanderSloot
986aa04113 Bug 1937102 - Fix protections UI tests that rely on unpartitioning storage - r=anti-tracking-reviewers,cookie-reviewers,webcompat-reviewers,timhuang,twisniewski
This is where I found and addressed a bug with surplus console messages when we enabled APS

Differential Revision: https://phabricator.services.mozilla.com/D233915
2025-01-16 15:39:24 +00:00
Tim Huang
3b3c28d6ae Bug 1915355 - Part 4: Implement the third-party cookie blocking excpetion in CookieService. r=cookie-reviewers,baku,valentin
The patch integrates the third-party cookie blocking excpetion in
CookieService.

Depends on D223381

Differential Revision: https://phabricator.services.mozilla.com/D223383
2025-01-10 08:24:29 +00:00
Stanca Serban
3eac2f1354 Backed out 8 changesets (bug 1915355) for causing xpcshell failures.
Backed out changeset d292c3a2592d (bug 1915355)
Backed out changeset 3386ee00459e (bug 1915355)
Backed out changeset 98848e63dfbf (bug 1915355)
Backed out changeset b668d0c685e8 (bug 1915355)
Backed out changeset 08acd8256071 (bug 1915355)
Backed out changeset 3ae9463ee988 (bug 1915355)
Backed out changeset 2dd416f1b847 (bug 1915355)
Backed out changeset 17107bbcf8c8 (bug 1915355)
2025-01-08 23:36:08 +02:00
Tim Huang
93bfe3a6c1 Bug 1915355 - Part 4: Implement the third-party cookie blocking excpetion in CookieService. r=cookie-reviewers,baku,valentin
The patch integrates the third-party cookie blocking excpetion in
CookieService.

Depends on D223381

Differential Revision: https://phabricator.services.mozilla.com/D223383
2025-01-08 19:25:59 +00:00
Gijs Kruitbosch
1b26010b77 Bug 1939538 - teach ContentPrincipal::GetSpecialBaseDomain not to bother for chrome/resource/ui URLs, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D233017
2025-01-07 15:54:10 +00:00
Alexandru Marc
0c1f8f4e28 Backed out 7 changesets (bug 1915355) for causing performance regressions CLOSED TREE
Backed out changeset 77b4cc920fe4 (bug 1915355)
Backed out changeset da9446e06954 (bug 1915355)
Backed out changeset 20708fe16d2a (bug 1915355)
Backed out changeset 7c4b003d1e48 (bug 1915355)
Backed out changeset 36163490219b (bug 1915355)
Backed out changeset 8f867025b79b (bug 1915355)
Backed out changeset 3d647f81adb9 (bug 1915355)
2024-12-30 13:02:45 +02:00
Alexandru Marc
503f03519f Backed out changeset 6fefdfdfe325 (bug 1665056) for causing mass failures CLOSED TREE 2024-12-18 17:26:05 +02:00
Frederik Braun
feaece220f Bug 1665056 - do not change security.fileuri_strict_origin_policy at runtime r=asuth,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D232209
2024-12-18 13:58:10 +00:00
Tim Huang
4335a4a0b2 Bug 1915355 - Part 4: Implement the third-party cookie blocking excpetion in CookieService. r=cookie-reviewers,baku,valentin
The patch integrates the third-party cookie blocking excpetion in
CookieService.

Differential Revision: https://phabricator.services.mozilla.com/D223383
2024-12-17 21:44:37 +00:00
Alexandru Marc
424d306b7d Backed out 7 changesets (bug 1915355) for causing build bustages @ ThirdPartyCookieBlockingExceptions.cpp CLOSED TREE
Backed out changeset 5e5278038a79 (bug 1915355)
Backed out changeset d2381f88168a (bug 1915355)
Backed out changeset 675785853d7a (bug 1915355)
Backed out changeset de6a26d3e3df (bug 1915355)
Backed out changeset b2934cae3c23 (bug 1915355)
Backed out changeset e7077b00cfc1 (bug 1915355)
Backed out changeset c5d7f4e7e839 (bug 1915355)
2024-12-17 12:39:21 +02:00
Tim Huang
af6c4648bd Bug 1915355 - Part 4: Implement the third-party cookie blocking excpetion in CookieService. r=cookie-reviewers,baku,valentin
The patch integrates the third-party cookie blocking excpetion in
CookieService.

Differential Revision: https://phabricator.services.mozilla.com/D223383
2024-12-17 08:57:31 +00:00
Frédéric Wang
8a29748fb2 Bug 1931288 - Implement EnsureCSPDoesNotBlockStringCompilation as per CSP spec. r=smaug,tschuster
See https://w3c.github.io/webappsec-csp/#can-compile-strings

Differential Revision: https://phabricator.services.mozilla.com/D229624
2024-12-13 08:54:53 +00:00
Frédéric Wang
0f0df595a9 Bug 1931288 - Implement HostGetCodeForEval() hook as per the HTML spec. r=smaug,dom-core,peterv
See https://html.spec.whatwg.org/multipage/webappapis.html#hostgetcodeforeval(argument)

Differential Revision: https://phabricator.services.mozilla.com/D229478
2024-12-13 08:54:52 +00:00
Otto Länd
459ed7b4c5 Bug 1905239: apply code formatting via Lando
# ignore-this-changeset
2024-12-11 20:03:21 +00:00
Frédéric Wang
c94fbf2e3e Bug 1905239 - Add new parameters to HostEnsureCanCompileStrings hook. r=tschuster
Currently, we do this via isRuntimeCodeGenEnabled whose single argument
is equivalent to codeString in "Dynamic Code Brand Checks" spec [1]. We
extend this hook to accept new parameters from that spec and adjust
PerformEval and CreateDynamicFunction accordingly. We don't change the
behavior for PerformShadowRealmEval [2] and WASM, i.e. we keep dummy
parameters.

[1] https://tc39.es/proposal-dynamic-code-brand-checks
[2] https://github.com/tc39/proposal-shadowrealm/issues/414

Differential Revision: https://phabricator.services.mozilla.com/D229588
2024-12-11 20:00:32 +00:00
Frédéric Wang
410b2420a9 Bug 1905239 - Introduce HostGetCodeForEval hook for PerformEval. r=tschuster
See https://tc39.es/proposal-dynamic-code-brand-checks

Differential Revision: https://phabricator.services.mozilla.com/D229477
2024-12-11 20:00:31 +00:00
Alexandru Marc
2e177dcfbb Backed out 3 changesets (bug 1905239) for causing build bustages @ FrontendContext.cpp CLOSED TREE
Backed out changeset 029305d7a99b (bug 1905239)
Backed out changeset a282ae3a55f7 (bug 1905239)
Backed out changeset f27e56ebfc0b (bug 1905239)
2024-12-11 12:16:57 +02:00
Otto Länd
f1f5a4f5c3 Bug 1905239: apply code formatting via Lando
# ignore-this-changeset
2024-12-11 09:43:11 +00:00
Frédéric Wang
0754e0aeb8 Bug 1905239 - Add new parameters to HostEnsureCanCompileStrings hook. r=tschuster
Currently, we do this via isRuntimeCodeGenEnabled whose single argument
is equivalent to codeString in "Dynamic Code Brand Checks" spec [1]. We
extend this hook to accept new parameters from that spec and adjust
PerformEval and CreateDynamicFunction accordingly. We don't change the
behavior for PerformShadowRealmEval [2] and WASM, i.e. we keep dummy
parameters.

[1] https://tc39.es/proposal-dynamic-code-brand-checks
[2] https://github.com/tc39/proposal-shadowrealm/issues/414

Differential Revision: https://phabricator.services.mozilla.com/D229588
2024-12-11 09:40:20 +00:00
Frédéric Wang
b79e24df19 Bug 1905239 - Introduce HostGetCodeForEval hook for PerformEval. r=tschuster
See https://tc39.es/proposal-dynamic-code-brand-checks

Differential Revision: https://phabricator.services.mozilla.com/D229477
2024-12-11 09:40:19 +00:00
Rob Wu
cdef57f69d Bug 1930749 - Add option to Cu.Sandbox to specify CSP r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D228711
2024-11-14 03:28:09 +00:00
serge-sans-paille
5946338a6a Bug 1920718 - Annotate all global variable with runtime initialization attributes r=glandium,application-update-reviewers,media-playback-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,gfx-reviewers,aosmond,lina,nalexander,aabh,geckoview-reviewers,win-reviewers,gstoll,m_kato
MOZ_RUNINIT => initialized at runtime
MOZ_CONSTINIT => initialized at compile time
MOZ_GLOBINIT => initialized either at runtime or compile time, depending on template parameter, macro parameter etc
This annotation is only understood by our clang-tidy plugin. It has no
effect on regular compilation.

Differential Revision: https://phabricator.services.mozilla.com/D223341
2024-10-30 11:05:24 +00:00
serge-sans-paille
262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc
a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille
07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00
Alexandru Marc
004e704b22 Backed out changeset 448597bce69d (bug 1922838) for causing build bustages. CLOSED TREE 2024-10-24 11:37:49 +03:00
serge-sans-paille
2c916d4973 Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 07:38:30 +00:00
Olli Pettay
713e9a9416 Bug 1905843, prevent unexpected use of result site origin, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D215496
2024-09-17 15:01:43 +00:00
Sandor Molnar
75ad5cd1e5 Backed out changeset 230299b03e10 (bug 1905843) for causing build bustages @ nsContentSecurityManager.cpp CLOSED TREE 2024-09-17 16:40:05 +03:00
Olli Pettay
95ef09ee46 Bug 1905843, prevent unexpected use of result site origin, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D215496
2024-09-17 12:55:39 +00:00
Masatoshi Kimura
e697accc65 Bug 1914286 - Remove NS_RelaxStrictFileOriginPolicy. r=smaug,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D219921
2024-08-23 10:13:35 +00:00
Tim Huang
5c7e1e1355 Bug 1912810 - Don't call ShouldAllowAccessFor if GetURI returns null. r=bvandersloot
Differential Revision: https://phabricator.services.mozilla.com/D219614
2024-08-22 15:44:14 +00:00
Andrew McCreight
76091b64ec Bug 1912804 - Don't warn in BasePrincipal::IsL10nAllowed if GetURI return null. r=peterv,dom-core
GetURI can succeed, but still return null. In that case, BasePrincipal::IsL10nAllowed
will pass null into NS_URIChainHasFlags, causing it to fail, which will produce three
separate warnings, and then return NS_OK. A recent change caused this function to be
call much more frequently, so this is now the top source of log spam in debug builds.

This change should not affect the behavior, aside from the lack of warnings.

Differential Revision: https://phabricator.services.mozilla.com/D219065
2024-08-13 12:40:13 +00:00
Emilio Cobos Álvarez
77c40caac6 Bug 1910698 - Remove nsIScriptError.sourceLine. r=smaug,devtools-reviewers,webdriver-reviewers,necko-reviewers,nchevobbe,kershaw,jdescottes,credential-management-reviewers,dimi
Afaict the source lines are not exposed anywhere in the UI.

Differential Revision: https://phabricator.services.mozilla.com/D218115
2024-08-01 17:12:48 +00:00
Emilio Cobos Álvarez
a44b49af0b Bug 1910698 - Add a struct to represent JS caller location and more general warning source location. r=smaug,necko-reviewers,anti-tracking-reviewers,dom-storage-reviewers,pbz,kershaw,janv
Use it liberally across the tree. This could be cleaned up even more in the future.

Differential Revision: https://phabricator.services.mozilla.com/D218114
2024-08-01 17:12:48 +00:00
Kagami Sascha Rosylight
90c218ca5f Bug 1908664 - Add nsIPrincipal::GetIsInPrivateBrowsing r=media-playback-reviewers,anti-tracking-reviewers,dom-storage-reviewers,padenot,asuth,pbz
Differential Revision: https://phabricator.services.mozilla.com/D216993
2024-07-26 17:47:51 +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
44d99735f2 Bug 1906734 - Switch WebExtension resources to use only static protocol flags, r=extension-reviewers,necko-reviewers,kershaw,robwu
Previously, the WebExtension protocol used dynamic protocol flags which
were based on the WebExtension policy in order to enforce things such as
availability in private browsing and the accessibility of certain
resources.

Since the shift to MV3, these checks have required more complex checks
than what was possible to specify with protocol flags, which required
the addition of WEBEXT_URI_WEB_ACCESSIBLE - a security flag which would
trigger further checks with the EPS to determine if the URI can be
loaded.

This was somewhat inefficient, as fetching the URI flags would require
looking up the policy each time dynamic flags were looked up, as well as
when policy specifics were being checked after loading flags. In
addition, it lead to a number of flags which were very specific to
extension protocols.

This patch changes extensions to no longer have dynamic flags, instead
specifying the static `URI_IS_WEBEXTENSION_RESOURCE` security flag. When
this flag is specified, security checks are made by querying the
ExtensionPolicyService to ask if the load should be permitted, combining
the specific security checks for Extension resources into a simpler
code-path, and avoids redundant checks.

Differential Revision: https://phabricator.services.mozilla.com/D216076
2024-07-17 16:02:34 +00:00
Nika Layzell
79ba8e0791 Bug 1901387 - Part 3: Make nsIPrincipal::CheckMayLoad threadsafe, r=asuth,ckerschb,extension-reviewers,robwu
This method was previously non-threadsafe due to it needing to access dynamic
URI flags. These flags were used to check the WEbExtensionPolicy to see if the
webextension resource being loaded should be accessible.

Making dynamic URI flags available off-main-thread in general would
unfortunately be quite difficult, due to some of them depending on things like
JS `nsIAboutModule` implementations, so that was not the approach taken.

Instead, all information required is already available in the threadsafe
WebExtensionPolicyCore, which is now directly queried, instead of being queried
indirectly through protocol flags.

Differential Revision: https://phabricator.services.mozilla.com/D215026
2024-06-28 17:34:08 +00:00
Tom Schuster
feaa0c77a1 Bug 1904004 - Use OriginAttributes::IsPrivateBrowsing instead of open coding PBM checks. r=timhuang,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,necko-reviewers,kershaw,dom-storage-reviewers,janv,canaltinova,dom-worker-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D214532
2024-06-24 11:06:18 +00:00
Tom Schuster
5710c69b23 Bug 1904004 - Add OriginAttributes::IsPrivateBrowsing. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D214531
2024-06-24 11:06:17 +00:00