Граф коммитов

8476 Коммитов

Автор SHA1 Сообщение Дата
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
Cosmin Sabou fdf40d5a31 Backed out changeset 1778ca2ab291 (bug 1744425) for bc failures on browser_xpcom_graph_wait.js. CLOSED TREE 2021-12-08 07:20:54 +02:00
Chris Peterson aae95e46eb Bug 1744425 - Replace nsContentUtils::GenerateUUID() to nsID::GenerateUUID(). r=nika
Bug 1723674 added a new nsID::GenerateUUID() static factory function to generate UUIDs without the overhead of querying and instantiating an nsIUUIDGenerator object. nsContentUtils::GenerateUUID() is a utility function that amortizes that overhead by holding an nsIUUIDGenerator singleton. That's no longer necessary because code that calls nsContentUtils::GenerateUUID() can now just call nsID::GenerateUUID(). No nsIUUDGenerator is needed.

Differential Revision: https://phabricator.services.mozilla.com/D132866
2021-12-08 03:19:11 +00:00
Joel Maher 6b02e865d7 Bug 1639850 - adjust xpcshell on windows to remove frequent failures. r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D133119
2021-12-07 19:55:03 +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
Joel Maher 63bf096aef Bug 1743907 - Remove webrender annotation from manifestparser manifests. r=ahal,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D132682
2021-12-03 16:04:29 +00:00
Gijs Kruitbosch 44333a9d0a Bug 1741595 - remove about:plugins from android builds, r=agi
Differential Revision: https://phabricator.services.mozilla.com/D132559
2021-12-01 17:45:45 +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
Chris Peterson f6fdbf028a Bug 1738401 - Remove -Wno-shadow warning suppressions. r=firefox-build-system-reviewers,glandium
-Wshadow warnings are not enabled globally, so these -Wno-shadow suppressions have no effect. I had intended to enable -Wshadow globally along with these suppressions in some directories (in bug 1272513), but that was blocked by other issues.

There are too many -Wshadow warnings (now over 2000) to realistically fix them all. We should remove all these unnecessary -Wno-shadow flags cluttering many moz.build files.

Differential Revision: https://phabricator.services.mozilla.com/D132289
2021-12-01 06:40:04 +00:00
Andreea Pavel 8290a5a7d9 Bug 1572299 - disable test_opener.html on win10_2004 and linux64 r=intermittent-reviewers,MasterWayZ DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D132304
2021-12-01 06:28:48 +00:00
Narcis Beleuzu 4c87b2e488 Backed out 12 changesets (bug 1721217) for bc failures on browser_TopLevelNavigationDelegate.js
Backed out changeset 5fe3c617d521 (bug 1721217)
Backed out changeset c131e4a6d9d5 (bug 1721217)
Backed out changeset a59210a5b400 (bug 1721217)
Backed out changeset 74362b0c39c0 (bug 1721217)
Backed out changeset c8075b91d660 (bug 1721217)
Backed out changeset 46512deaf0e5 (bug 1721217)
Backed out changeset b38bc569d227 (bug 1721217)
Backed out changeset ee9bd012fda8 (bug 1721217)
Backed out changeset 7aa2726a0982 (bug 1721217)
Backed out changeset 885ced5f4bb4 (bug 1721217)
Backed out changeset 7d3f99ca3f44 (bug 1721217)
Backed out changeset 2f5a0164679a (bug 1721217)
2021-12-01 03:38:10 +02: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
Anny Gakhokidze 400b3c89cc Bug 1721217 - Part 7: Make sure to cancel loads when a canonical BC gets discarded, r=nika
This fixes failures in browser/base/content/test/tabPrompts/browser_contentOrigins.js

Differential Revision: https://phabricator.services.mozilla.com/D126847
2021-11-30 16:31:36 +00:00
Anny Gakhokidze 48e144a44c Bug 1721217 - Part 6: Don't cancel concurrent loads if they are downloads, r=nika,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D126846
2021-11-30 16:31:36 +00:00
Anny Gakhokidze a2ec84dc5c Bug 1721217 - Part 5: Change the error code when we cancel loads due to another one starting, r=nika
This allows us to move away from using IsNavigating field in parent-controlled
paths.  Use a new distinct error code in cases when we cancel loads in
Canonical BC due to another load starting. This way, we know to not reset the
urlbar if we are doing another load.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1721217#c10 for longer
explanation of what is going on here.

Differential Revision: https://phabricator.services.mozilla.com/D126845
2021-11-30 16:31:36 +00:00
Anny Gakhokidze 4a06eef3a8 Bug 1721217 - Part 2: Fix the race between navigations originating in the parent and in the content, r=nika
Add a synced ParentInitiatedNavigationEpoch field to browsing context, which
only gets incremented when we start navigations in the parent process. When a
child process initiates a navigation, it sends the current value of the field
that it sees via DocumentChannelCreationArgs. In the parent process, we can
compare the value of that field with the latest one for the same browsing
context. If the latest value is higher than the one provided by the content
process, it means that in the meantime parent process has started a navigation
so the earlier navigation originating in the content process will be cancelled.

Differential Revision: https://phabricator.services.mozilla.com/D126842
2021-11-30 16:31:34 +00:00
Anny Gakhokidze 64c6fca640 Bug 1721217 - Part 1: Enable parent controlled loads via DC, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D126841
2021-11-30 16:31:34 +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
Peter Van der Beken d9015bc3ab Bug 1743353 - Fire pageshow after pagehide/unload with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132354
2021-11-30 13:01:03 +00:00
Peter Van der Beken 759bf3ea27 Bug 1742689 - Block things loaded in the large allocation process from the BFCache with BFCache in the parent. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D132351
2021-11-30 12:50:09 +00:00
Christoph Kerschbaumer b4d3e55408 Bug 1742785: Update more tests within dom/ and docshell/ to work with https-first enabled r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132007
2021-11-30 09:21:45 +00:00
Csoregi Natalia 88c83e9a81 Backed out changeset 78307ccc4942 (bug 1742785) for causing permafailures on browser_ProcessPriorityManager.js. CLOSED TREE 2021-11-30 04:03:13 +02:00
Peter Van der Beken 049f910998 Bug 1741132 - Correctly evict entries with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131894
2021-11-27 11:14:09 +00:00
Peter Van der Beken 9e05629b84 Bug 1741132 - Add a property for whether an entry is in the BFCache (holds a content viewer or a frame loader). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131893
2021-11-27 11:14:09 +00:00
Peter Van der Beken c8b5d79509 Bug 1740517 - Don't restore form data when going back to a page with a no-store header with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131892
2021-11-27 11:14:08 +00:00
Peter Van der Beken 41778ca7b2 Bug 1740516 - Fire pageshow for an iframe before the pageshow for its parent window when coming out of BFCache with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131891
2021-11-27 11:14:08 +00:00
Narcis Beleuzu a322582a00 Backed out 11 changesets (bug 1721217) for bc failures on browser_scrollPositions.js . CLOSED TREE
Backed out changeset 750f4a84b30e (bug 1721217)
Backed out changeset c4eb4ad769ad (bug 1721217)
Backed out changeset 81af11d67439 (bug 1721217)
Backed out changeset 548f2441b7c6 (bug 1721217)
Backed out changeset cd584129321a (bug 1721217)
Backed out changeset f5f5291d1da8 (bug 1721217)
Backed out changeset 9ad66ceec1e2 (bug 1721217)
Backed out changeset 10b53a21bb23 (bug 1721217)
Backed out changeset 3755cfbe22fe (bug 1721217)
Backed out changeset 71436dc6c4c4 (bug 1721217)
Backed out changeset ecf33b73ae60 (bug 1721217)
2021-11-26 01:51:03 +02:00
Anny Gakhokidze 1fbf7432f6 Bug 1721217 - Part 7: Make sure to cancel loads when a canonical BC gets discarded, r=nika
This fixes failures in browser/base/content/test/tabPrompts/browser_contentOrigins.js

Differential Revision: https://phabricator.services.mozilla.com/D126847
2021-11-25 20:40:59 +00:00
Anny Gakhokidze 600c61e9f6 Bug 1721217 - Part 6: Don't cancel concurrent loads if they are downloads, r=nika,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D126846
2021-11-25 20:40:58 +00:00
Anny Gakhokidze 5a620b3dd9 Bug 1721217 - Part 5: Change the error code when we cancel loads due to another one starting, r=nika
This allows us to move away from using IsNavigating field in parent-controlled
paths.  Use a new distinct error code in cases when we cancel loads in
Canonical BC due to another load starting. This way, we know to not reset the
urlbar if we are doing another load.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1721217#c10 for longer
explanation of what is going on here.

Differential Revision: https://phabricator.services.mozilla.com/D126845
2021-11-25 20:40:58 +00:00
Anny Gakhokidze 4d5efdcf73 Bug 1721217 - Part 2: Fix the race between navigations originating in the parent and in the content, r=nika
Add a synced ParentInitiatedNavigationEpoch field to browsing context, which
only gets incremented when we start navigations in the parent process. When a
child process initiates a navigation, it sends the current value of the field
that it sees via DocumentChannelCreationArgs. In the parent process, we can
compare the value of that field with the latest one for the same browsing
context. If the latest value is higher than the one provided by the content
process, it means that in the meantime parent process has started a navigation
so the earlier navigation originating in the content process will be cancelled.

Differential Revision: https://phabricator.services.mozilla.com/D126842
2021-11-25 20:40:57 +00:00
Anny Gakhokidze 8afaf07df0 Bug 1721217 - Part 1: Enable parent controlled loads via DC, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D126841
2021-11-25 20:40:56 +00:00
Marian-Vasile Laza 4ec6cdf544 Backed out changeset a905fca36db2 (bug 1740516) for causing bc failures on browser_bug343515.js. CLOSED TREE 2021-11-25 22:55:43 +02:00
Peter Van der Beken ee1558efd7 Bug 1740516 - Fire pageshow for an iframe before the pageshow for its parent window when coming out of BFCache with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131891
2021-11-25 16:22:48 +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
Christoph Kerschbaumer ca94879d3a Bug 1742785: Update more tests within dom/ and docshell/ to work with https-first enabled r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132007
2021-11-25 08:19:22 +00:00
Csoregi Natalia c60cb3391e Backed out changeset dad850a374dd (bug 1742785) for causing failures on browser_ProcessPriorityManager.js. CLOSED TREE 2021-11-24 20:50:41 +02:00
Christoph Kerschbaumer bd04b0ccdd Bug 1742785: Update more tests within dom/ and docshell/ to work with https-first enabled r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D132007
2021-11-24 12:45:05 +00:00
Butkovits Atila ed15a00d3e Backed out 2 changesets (bug 1740517, bug 1740516) for causing failures at browser_bug343515.js and browser_browsingContext-webProgress.js. CLOSED TREE
Backed out changeset e656dd82e48a (bug 1740517)
Backed out changeset 9eb7a39f39b7 (bug 1740516)
2021-11-23 23:28:54 +02:00
Peter Van der Beken d7dd6f1294 Bug 1740517 - Don't restore form data when going back to a page with a no-store header with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131892
2021-11-23 20:04:36 +00:00
Peter Van der Beken d8fcefcdde Bug 1740516 - Fire pageshow for an iframe before the pageshow for its parent window when coming out of BFCache with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131891
2021-11-23 20:04:35 +00:00
Marian-Vasile Laza 3c2ad74d5b Backed out 4 changesets (bug 1741132, bug 1740516, bug 1740517) for causing mochitest failures on test_bug1741132.html.
Backed out changeset 9b91c4d469d7 (bug 1741132)
Backed out changeset 1ad268a75fec (bug 1741132)
Backed out changeset 6a6e91c8eeeb (bug 1740517)
Backed out changeset c8a789ba6dc7 (bug 1740516)
2021-11-23 19:07:58 +02:00
Peter Van der Beken afd1bab71f Bug 1741132 - Correctly evict entries with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131894
2021-11-23 15:37:24 +00:00
Peter Van der Beken 00ffaf83c0 Bug 1741132 - Add a property for whether an entry is in the BFCache (holds a content viewer or a frame loader). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131893
2021-11-23 15:37:24 +00:00
Peter Van der Beken b55325dab8 Bug 1740517 - Don't restore form data when going back to a page with a no-store header with session history in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131892
2021-11-23 15:37:23 +00:00