Commit graph

3937 commits

Author SHA1 Message Date
Olli Pettay
0b429bbbfc Bug 1758664, don't try to recheck possible session history entry in the parent process if we're doing such check already, r=peterv
The code which this patch removes was clearly an oversight in the regressing patch.

Differential Revision: https://phabricator.services.mozilla.com/D140690
2022-03-10 10:19:57 +00:00
Peter Van der Beken
61f7e59993 Bug 1747033 - "Back" does not work correctly for pages with multipart/x-mixed-replace and history.replaceState. r=smaug,necko-reviewers,valentin
multipart/x-mixed-replace loads don't start a new load for parts other than the first,
they just call OnStartRequest/OnStopRequest for every part. The nsDocShell code was
trying to set the active entry to the loading entry for these loads, but because we
never started a new load after the first part, the loading entry would be null and we'd
just clear the active entry. history.replaceState would then try to replace the active
entry, but finding none it would just add a new one.

Differential Revision: https://phabricator.services.mozilla.com/D138464
2022-02-19 08:30:35 +00:00
Henri Sivonen
2fd5af8ef4 Bug 1736570 - Avoid DocumentChannel for nsParser-created initial about:blank replacement. r=nika,smaug
Differential Revision: https://phabricator.services.mozilla.com/D135106
2022-02-17 13:27:15 +00:00
Emilio Cobos Álvarez
51f5539b57 Bug 1754813 - Make Hal::ScreenOrientation an enum class. r=gsvelto,m_kato,geckoview-reviewers
This adds proper IPC validation too.

Differential Revision: https://phabricator.services.mozilla.com/D138461
2022-02-14 07:51:06 +00:00
Mike Conley
3a0f75795e Bug 1753990 - Only collect wireframes for top content BrowsingContexts. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D138050
2022-02-07 18:11:20 +00:00
Olli Pettay
90b2d9e86c Bug 1750973, don't replace the nsILayoutHistoryState object when doing same document history navigations, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D137703
2022-02-04 11:37:14 +00:00
Olli Pettay
14f1eabde6 Bug 1745638, allow stopping session history load to an iframe, r=peterv
The previous version had two issues:
It revealed an issue in the old implementation which causes an assertion to fire.
There was also a problem with mDocumentRequest, so the new approach tries to be less clever
and just adds a new boolean member variable mCheckingSessionHistory,
which GetIsAttemptingToNavigate() then uses.

Differential Revision: https://phabricator.services.mozilla.com/D136041
2022-02-01 18:59:05 +00:00
Iulian Moraru
a47757f1f9 Backed out changeset e15925b76a27 (bug 1745638) for causing mochitest failures on test_bug1745638.html. 2022-01-28 21:33:34 +02:00
Olli Pettay
96f10318be Bug 1745638, allow stopping session history load to an iframe, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D136041
2022-01-28 18:21:28 +00:00
Olli Pettay
87ab534f34 Bug 1747019 - set cache key on session history entry, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D136979
2022-01-28 17:00:08 +00:00
Mike Conley
03af506a58 Bug 1749008 - Create a wireframe for history states during navigation / pushState. and hang them off of nsISHEntry. r=peterv,emilio
This is preffed off by default via browser.history.collectWireframes.

Differential Revision: https://phabricator.services.mozilla.com/D135341
2022-01-26 15:53:34 +00:00
Peter Van der Beken
9995f7174d Bug 1267614 - Update meta refresh parsing to match the new spec. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D134225
2021-12-26 17:03:30 +00:00
Butkovits Atila
94d38895e3 Backed out changeset 69ac7afb9489 (bug 1267614) for causing failures at navigate.window.html. CLOSED TREE 2021-12-26 13:13:46 +02:00
Peter Van der Beken
9435610906 Bug 1267614 - Update meta refresh parsing to match the new spec. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D134225
2021-12-26 10:09:44 +00:00
Peter Van der Beken
a33a4db25e Bug 1744397 - Simplify refresh code: pass around delay as an unsigned int. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132863
2021-12-16 22:27:08 +00:00
Peter Van der Beken
ef88fc87e8 Bug 1744397 - Simplify refresh code: clean up meta refresh code in nsDocShell. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132862
2021-12-16 22:27:07 +00:00
Peter Van der Beken
6cd3771ef1 Bug 1744397 - Simplify refresh code: remove aMetaRefresh argument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132861
2021-12-16 22:27:07 +00:00
Peter Van der Beken
fd2d03af6a Bug 1744397 - Simplify refresh code: remove aRepeat argument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132860
2021-12-16 22:27:06 +00:00
Peter Van der Beken
b9b3a16001 Bug 1742865 - Handle meta refresh correctly with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132837
2021-12-16 15:31:56 +00:00
Butkovits Atila
196050d57d Backed out changeset e55eb174b342 (bug 1742865) for causin failures at attr-meta-http-equiv-refresh/parsing.html?131 2021-12-16 12:15:59 +02:00
Peter Van der Beken
8f586038da Bug 1742865 - Handle meta refresh correctly with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132837
2021-12-16 08:19:45 +00:00
Dennis Jackson
cf376cc878 Bug 1742617 - Add null pointer check for missing cert in MaybeFixBadCertDomainErrorURI r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D132153
2021-12-15 12:24:39 +00:00
Norisz Fay
333caceb64 Backed out 5 changesets (bug 1742865, bug 1744397) for causing wpt failures on attr-meta-http-equiv-refresh/parsing.html CLOSED TREE
Backed out changeset 7b01edc5a0e0 (bug 1744397)
Backed out changeset 41abd4b7d2c0 (bug 1744397)
Backed out changeset 634641e3a05a (bug 1744397)
Backed out changeset 6e7755177481 (bug 1744397)
Backed out changeset e9fc94b33da9 (bug 1742865)
2021-12-14 13:25:58 +02:00
Peter Van der Beken
bfbe9b27fe Bug 1744397 - Simplify refresh code: pass around delay as an unsigned int. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132863
2021-12-14 10:14:00 +00:00
Peter Van der Beken
a538f42b2d Bug 1744397 - Simplify refresh code: clean up meta refresh code in nsDocShell. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132862
2021-12-14 10:13:59 +00:00
Peter Van der Beken
6c947d1a00 Bug 1744397 - Simplify refresh code: remove aMetaRefresh argument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132861
2021-12-14 10:13:59 +00:00
Peter Van der Beken
cc2d4f0467 Bug 1744397 - Simplify refresh code: remove aRepeat argument. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132860
2021-12-14 10:13:58 +00:00
Peter Van der Beken
f1f36b16d4 Bug 1742865 - Handle meta refresh correctly with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132837
2021-12-14 10:13:58 +00:00
Mike Conley
4646b826a2 Bug 1745484 - Pass full nsIReferrerInfo through nsITopLevelNavigationDelegate. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D133511
2021-12-12 18:02:07 +00:00
Henri Sivonen
649a5b63d8 Bug 1701828 - meta charset rewrite. r=smaug
Implements https://github.com/whatwg/html/issues/6962 . Improves performance
when <meta charset> occurs in head but after the first kilobyte and aligns
behavior better with WebKit and Blink.

The main change is to avoid reloads when meta appears within head but
after the first kilobyte. Prior to this change, Gecko reloaded in that
case (in compliance with the spec!) even though WebKit and Blink did not.

Differences from WebKit and Blink:

* WebKit and Blink honor <meta charset> in <noscript>. This implementation
  does not.
* WebKit and Blink look for meta as if the tree builder was unaware of
  foreign content. This implementation is foreign content-aware. This
  makes a difference for CDATA sections that contain a > before the meta
  as well as style and script elements within foreign content. This could
  happen if the CDATA section that has mysteriously been introduced around
  a what looks like a meta tag also contains another prior tag-looking
  run of text.
* This implementation processes rel=preload and speculative loads that are
  seen before <meta charset> has been seen. WebKit and Blink instead first
  look for the meta and rewind before starting speculative parsing.
* Unlike WebKit, if there is neither an honored meta nor syntax resembling
  an XML declaration, detection from content takes place (as in Blink).
* Unlike Blink, if there is neither an honored meta nor syntax resembling
  an XML declaration, the detection from content is not dependent of network
  buffer boundaries.
* Unlike Blink, detection from content can trigger a reload at the end of
  the stream if the guess made at that point differs from the first guess.
  (See below for the definition of the input to the first guess.)

Differences from the old spec and Gecko previously:

* Meta inside script and RCDATA elements is no longer honored.
* Late meta is now ignored and no longer triggers a reload.
* Later meta counts as early enough meta: In addition to the previous
  meta within the first 1024 bytes, now a meta that started within the first
  1024 bytes counts as early enough. Additionally, if by then there hasn't
  been a template start tag and head hasn't ended, meta occurring before the
  earlier of the end of the head or a template start tag counts as early
  enough.
* Meta now counts as not-late even if the encoding label has numeric
  character reference escapes.
* Syntax resembling an XML declaration longer than a kilobyte is honored if
  there is no honored meta.
* If there is neither an honored meta nor syntax resembling an XML declaration,
  the initial chardetng scan is potentially longer than before: the first 1024
  bytes, the token spanning the 1024-byte boundary if there is such a token,
  and, if by then head hasn't ended and there hasn't been a template start tag
  until the end of the template start tag or the end of the token that causes
  head to end, ever comes first. However, if the token implying the end of the
  head is a text token, bytes only to the end of the previous non-text token is
  considered. (This definition avoids depending on network buffer boundaries.)
* XML View Source now uses the code for syntax resembling an XML declaration
  instead of expat for extracting the internal encoding label.

Reftest are added as both WPT and Gecko reftests in order to test both http:
and file: URL scenarios. The Gecko tests retain the WPT <link> tags in order
to use the exact same bytes.

An encoding declaration has been added to a number of old tests that didn't
intend to test the new speculation behavior especially in the context of
https://bugzilla.mozilla.org/show_bug.cgi?id=1727750 .

Differential Revision: https://phabricator.services.mozilla.com/D125808
2021-12-08 11:34:20 +00:00
Norisz Fay
1d6984bc21 Backed out changeset 3dfd3c94a105 (bug 1701828) for causing mochitest failures on browser_hsts_host.js CLOSED TREE 2021-12-07 12:05:44 +02:00
Henri Sivonen
58476d7f17 Bug 1701828 - meta charset rewrite. r=smaug
Implements https://github.com/whatwg/html/issues/6962 . Improves performance
when <meta charset> occurs in head but after the first kilobyte and aligns
behavior better with WebKit and Blink.

The main change is to avoid reloads when meta appears within head but
after the first kilobyte. Prior to this change, Gecko reloaded in that
case (in compliance with the spec!) even though WebKit and Blink did not.

Differences from WebKit and Blink:

* WebKit and Blink honor <meta charset> in <noscript>. This implementation
  does not.
* WebKit and Blink look for meta as if the tree builder was unaware of
  foreign content. This implementation is foreign content-aware. This
  makes a difference for CDATA sections that contain a > before the meta
  as well as style and script elements within foreign content. This could
  happen if the CDATA section that has mysteriously been introduced around
  a what looks like a meta tag also contains another prior tag-looking
  run of text.
* This implementation processes rel=preload and speculative loads that are
  seen before <meta charset> has been seen. WebKit and Blink instead first
  look for the meta and rewind before starting speculative parsing.
* Unlike WebKit, if there is neither an honored meta nor syntax resembling
  an XML declaration, detection from content takes place (as in Blink).
* Unlike Blink, if there is neither an honored meta nor syntax resembling
  an XML declaration, the detection from content is not dependent of network
  buffer boundaries.
* Unlike Blink, detection from content can trigger a reload at the end of
  the stream if the guess made at that point differs from the first guess.
  (See below for the definition of the input to the first guess.)

Differences from the old spec and Gecko previously:

* Meta inside script and RCDATA elements is no longer honored.
* Late meta is now ignored and no longer triggers a reload.
* Later meta counts as early enough meta: In addition to the previous
  meta within the first 1024 bytes, now a meta that started within the first
  1024 bytes counts as early enough. Additionally, if by then there hasn't
  been a template start tag and head hasn't ended, meta occurring before the
  earlier of the end of the head or a template start tag counts as early
  enough.
* Meta now counts as not-late even if the encoding label has numeric
  character reference escapes.
* Syntax resembling an XML declaration longer than a kilobyte is honored if
  there is no honored meta.
* If there is neither an honored meta nor syntax resembling an XML declaration,
  the initial chardetng scan is potentially longer than before: the first 1024
  bytes, the token spanning the 1024-byte boundary if there is such a token,
  and, if by then head hasn't ended and there hasn't been a template start tag
  until the end of the template start tag or the end of the token that causes
  head to end, ever comes first. However, if the token implying the end of the
  head is a text token, bytes only to the end of the previous non-text token is
  considered. (This definition avoids depending on network buffer boundaries.)
* XML View Source now uses the code for syntax resembling an XML declaration
  instead of expat for extracting the internal encoding label.

Reftest are added as both WPT and Gecko reftests in order to test both http:
and file: URL scenarios. The Gecko tests retain the WPT <link> tags in order
to use the exact same bytes.

An encoding declaration has been added to a number of old tests that didn't
intend to test the new speculation behavior especially in the context of
https://bugzilla.mozilla.org/show_bug.cgi?id=1727750 .

Differential Revision: https://phabricator.services.mozilla.com/D125808
2021-12-07 07:35:32 +00:00
Gijs Kruitbosch
e36840652c Bug 1705211, r=nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D131856
2021-12-01 12:36:07 +00:00
Marian-Vasile Laza
74bbbc347e Backed out changeset 9c044551012e (bug 1705211) for causing bc test failures on browser_protocol_ask_dialog_external.js. CLOSED TREE 2021-12-01 03:09:59 +02:00
Olli Pettay
a1708052cd Bug 1742168, increase maxStateObjectSize to 16MB and make the pref a StaticPref, r=peterv
Keeping the pref as signed, since the existing code explicitly handles that case, so someone may have -1 as the pref value.

Differential Revision: https://phabricator.services.mozilla.com/D132020
2021-12-01 00:11:41 +00:00
Gijs Kruitbosch
9ec163c376 Bug 1705211, r=nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D131856
2021-11-30 23:38:57 +00:00
Butkovits Atila
8e13e5203a Backed out changeset 0de3705203a4 (bug 1742168) for causing failures at browser_multiple_pushState.js. CLOSED TREE 2021-11-30 16:31:10 +02:00
Tim Huang
e3e09e1fdf Bug 1731999 - Part 3: Enable partitioned service workers. r=pbz
This patch enables partitioned service workers in third-party contexts.
Doesn't like before, we will allow service workers to be registered even
the third-party contexts don't have storage access and the registered
service workers will be partitioned by the top-level site.

You can control this by using the pref 'privacy.partition.serviceWorkers'.
Setting this to true will enable the partitioning, otherwise, it will
still use the old behavior.

Differential Revision: https://phabricator.services.mozilla.com/D131788
2021-11-30 13:40:31 +00:00
Olli Pettay
00560d8b6d Bug 1742168, increase maxStateObjectSize to 16MB and make the pref a StaticPref, r=peterv
Keeping the pref as signed, since the existing code explicitly handles that case, so someone may have -1 as the pref value.

Differential Revision: https://phabricator.services.mozilla.com/D132020
2021-11-30 13:31:20 +00:00
Tim Huang
5cdaa70075 Bug 1731982 - Part 2: Use partitioned principal for creating initial client source if needed in nsDocShell. r=asuth
Currently, we are using the regular principal and inherited regular
principal to create clientSource in nsDocShell. This patch makes the
nsDocshell to use the partitioned principal if needed.

Differential Revision: https://phabricator.services.mozilla.com/D127629
2021-11-25 13:11:30 +00:00
Kagami Sascha Rosylight
36ca2b283d Bug 1741018 - Use uint32_t for bfcache flags and MOZ_LOG for ACTIVE_LOCK r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D131523
2021-11-22 12:14:15 +00:00
Evgenia Kotovich
5264bfd45a Bug 1702240. Change nsDocShell's notification of keyword-search pass a string rather than an engine. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D130336
2021-11-17 09:28:06 +00:00
Olli Pettay
91122391ce Bug 1730120, close ContentViewer properly if initialization fails, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130211
2021-11-09 22:09:48 +00:00
Butkovits Atila
0d719e8d5d Backed out changeset d2e38d5047ae (bug 1730120) for causing Crashtest failures at crashtests/1419902.html. CLOSED TREE 2021-11-09 21:17:48 +02:00
Olli Pettay
5a0254075d Bug 1730120, close ContentViewer properly if initialization fails, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D130211
2021-11-09 17:15:06 +00:00
Alexandru Michis
490a04115c Backed out 12 changesets (bug 1731982, bug 1736401) for causing crashes. a=backout
DONTBUILD

Backed out changeset ab85eef8a4fd (bug 1736401)
Backed out changeset 347ce2439936 (bug 1731982)
Backed out changeset fa0ff1505daa (bug 1731982)
Backed out changeset 5b1f2b0a5673 (bug 1731982)
Backed out changeset 4adc65d2f1a3 (bug 1731982)
Backed out changeset a8700204af07 (bug 1731982)
Backed out changeset 88bd00ed8d94 (bug 1731982)
Backed out changeset 80bd8c79b931 (bug 1731982)
Backed out changeset 58ca3a94fec0 (bug 1731982)
Backed out changeset 0b28570dea43 (bug 1731982)
Backed out changeset 23524ce67bb9 (bug 1731982)
Backed out changeset d29cc06a65db (bug 1731982)
2021-11-09 09:23:38 +02:00
Gerald Squelart
5399574d8b Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-08 23:59:35 +00:00
Tim Huang
a41f61c051 Bug 1731982 - Part 2: Use partitioned principal for creating initial client source if needed in nsDocShell. r=asuth
Currently, we are using the regular principal and inherited regular
principal to create clientSource in nsDocShell. This patch makes the
nsDocshell to use the partitioned principal if needed.

Differential Revision: https://phabricator.services.mozilla.com/D127629
2021-11-08 14:30:53 +00:00
Cristian Tuns
1aeac93d23 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
Gerald Squelart
7fa084ae7c Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-05 05:52:28 +00:00