Commit Graph

4630 Commits

Author SHA1 Message Date
Henri Sivonen
2f2b2fb6fb Bug 1747264 - Avoid OOMing if the URL of an XML document is huge. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D134506
2021-12-27 07:31:34 +00:00
Bobby Holley
42c90d1426 Bug 1747514 - Ensure the expat sandbox is large enough to hold the base URI. r=shravanrn,deian
Differential Revision: https://phabricator.services.mozilla.com/D134653
2021-12-25 06:00:25 +00:00
Bobby Holley
84ba1b89f4 Bug 1747514 - Make RLBoxTransferBufferToSandbox properly fallible. r=shravanrn
Differential Revision: https://phabricator.services.mozilla.com/D134670
2021-12-25 06:00:25 +00:00
Kagami Sascha Rosylight
dc3411ed8f Bug 1539884 - Part 32: Mark nsHtml5SVGLoadDispatcher::Run as CAN_RUN_SCRIPT_BOUNDARY r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D134415
2021-12-23 16:27:24 +00:00
Henri Sivonen
97da4f66b8 Bug 1745142 - Communicate encoding commitment via speculative load queue. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D133996
2021-12-22 15:54:49 +00:00
Peter Van der Beken
56d7e1b1a5 Bug 1745239 - Chunk XML parsing to 64k characters at a time. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D134320
2021-12-20 19:31:55 +00:00
Randell Jesup
18dd863826 Bug 1746412: Parser cleanup r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D134021
2021-12-19 16:51:41 +00:00
Henri Sivonen
2e97d5cb50 Bug 1746603 - Make mSpeculationFailureCount atomic. r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D134142
2021-12-18 07:37:52 +00:00
Henri Sivonen
fe10b6b5da Bug 1746593 - Turn mTerminated and mInterrupted into atomics. r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D134135
2021-12-18 07:37:15 +00:00
Henri Sivonen
527882bab5 Bug 1736248 - Update the charset source if non-ASCII is seen after the first detector guess but the encoding does not change. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D133731
2021-12-14 15:01:21 +00:00
Nika Layzell
7b2e6d4996 Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D131422
2021-12-13 21:47:56 +00:00
Henri Sivonen
cdcc0b21b5 Bug 1745139 - Check for termination even after the first flush loop in CommitToInternalEncoding. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D133342
2021-12-09 12:59:04 +00:00
shravanrn@gmail.com
7079358631 Bug 1744460 part 2 - Update woff2 RLBoxSandboxPool to track minimum sandbox size r=bholley
Depends on D133009

Differential Revision: https://phabricator.services.mozilla.com/D133158
2021-12-09 00:01:17 +00:00
Butkovits Atila
6ffe112d27 Backed out 2 changesets (bug 1744460) for causing build bustages at RLBoxSandboxPool.cpp. CLOSED TREE
Backed out changeset 582101d582a0 (bug 1744460)
Backed out changeset dba7b7c19b2f (bug 1744460)
2021-12-08 21:57:58 +02:00
shravanrn@gmail.com
8001ccc0fd Bug 1744460 part 2 - Update woff2 RLBoxSandboxPool to track minimum sandbox size r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D133158
2021-12-08 17:55:16 +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
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
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
nchevobbe
b31e82ce90 Bug 1238861 - Display a warning message when doctype is not standard. r=hsivonen.
This patchs adds new error messages which are extending existing ones,
providing extra information to the user.
A webconsole mochitest is added in the following patch of this stack.

Differential Revision: https://phabricator.services.mozilla.com/D131889
2021-12-02 22:46:22 +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
Deian Stefan
1ee9a841d8 Bug 1732201 - Sandbox woff2 in OTS using RLBox r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D126435
2021-11-27 23:30:49 +00:00
Cristian Tuns
f0ef0360eb Backed out changeset d486edc7499b (bug 1732201) for causing web-platform-tests failures on header-totalsfntsize-001.xht CLOSED TREE 2021-11-27 07:32:22 -05:00
Deian Stefan
0a5e1f2075 Bug 1732201 - Sandbox woff2 in OTS using RLBox r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D126435
2021-11-27 04:41:21 +00:00
Shravan Narayan
1cc3caab38 Bug 1743007 - Convert expat XML_StopParser API to take an int param instead of u8 r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D132171
2021-11-25 21:02:10 +00:00
Shravan Narayan
361d7f84bb Bug 1742914 - Add explicit casts for u8 and u16 parameters to RLBox sandbox_invoke r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D132113
2021-11-25 05:17:33 +00:00
Cosmin Sabou
a543cd6cc8 Backed out changeset 524df7136a1f (bug 1742914) for causing assertion failures on htmlparser/nsExpatDriver.cpp. CLOSED TREE 2021-11-25 11:14:20 +02:00
Shravan Narayan
7fe9421af3 Bug 1742914 - Add explicit casts for u8 and u16 parameters to RLBox sandbox_invoke r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D132113
2021-11-25 05:17:33 +00:00
Deian Stefan
86e82e1036 Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,peterv,bholley,glandium
Differential Revision: https://phabricator.services.mozilla.com/D104658
2021-11-22 06:19:17 +00:00
Sandor Molnar
51a05715fe Backed out changeset 4294063f1606 (bug 1688452) for causing mochitest and wpt failures. CLOSED TREE 2021-11-20 13:00:27 +02:00
Deian Stefan
fcd2e09518 Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,peterv,bholley,glandium
Differential Revision: https://phabricator.services.mozilla.com/D104658
2021-11-19 21:28:53 +00:00
Alexandru Michis
d4f3d0994e Backed out changeset 7893bbd002e0 (bug 1688452) for causing bustages in nsRLBoxExpatDriver.
CLOSED TREE
2021-11-19 15:54:31 +02:00
Deian Stefan
76c5d8907d Bug 1688452 - Retrofit nsExpatDriver to use RLBoxed libexpat r=tjr,peterv,bholley,glandium
Differential Revision: https://phabricator.services.mozilla.com/D104658
2021-11-19 06:08:36 +00:00
Henri Sivonen
e266e0f13a Bug 1741219 - Remove Expat usage from nsHtml5StreamParser. r=smaug
To be overwritten by the patch for https://bugzilla.mozilla.org/show_bug.cgi?id=1701828 .

Differential Revision: https://phabricator.services.mozilla.com/D131215
2021-11-16 16:02:04 +00:00
Andi-Bogdan Postelnicu
c8e0f87391 Bug 1519636 - First reformat with clang-format 13.0.0. r=firefox-build-system-reviewers,sylvestre,mhentges
Updated with clang-format version 13.0.0 (taskcluster-OgjH5lasS5K_fvefdRcJVg)

Depends on D131114

Differential Revision: https://phabricator.services.mozilla.com/D129119
2021-11-16 08:07:30 +00:00
ssummar
0992acc367 Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129920
2021-11-08 08:14:00 +00:00
Cristian Tuns
71486b8924 Backed out changeset 7e8e3747c3f8 (bug 1603127) for causing toolchains build bustages (Bug 1739589). CLOSED TREE 2021-11-05 07:23:45 -04:00
ssummar
508562cc85 Bug 1603127 - Replaced mozilla::Tuple with std::tuple and applied structured bindings in mozilla/Encoding.h. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D129920
2021-11-05 05:33:58 +00:00
Edgar Chen
3f791b5050 Bug 1556352 - Part 1: Do not set form owner from parser for form-associated custom element; r=smaug
See steps 14 of https://html.spec.whatwg.org/commit-snapshots/3ad5159be8f27e110a70cefadcb50fc45ec21b05/#create-an-element-for-the-token

From spec perspective, FACE needs this in order to enqueue the formAssociated callback
while FACE is inserted into document. Otherwise it would bail out in
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#association-of-controls-and-forms:parser-inserted-flag,
and wouldn't run https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#reset-the-form-owner
steps nor https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions:reset-the-form-owner

From implementation perspective, we don't implement parser inserted flag, but we do
update the form owner from parser. Not doing this would make the subsequent part
which implements formAssociated callback a bit simpler, where we don't need to consider
or handle the case that form owner is set from parser.

Differential Revision: https://phabricator.services.mozilla.com/D129646
2021-10-28 10:29:37 +00:00
ssummar
51c0ff21e5 Bug 1626517 - Replaced mozilla::Unused with mozilla::Ignore in mozilla::Decoder/mozilla::Encoder calls. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D129022
2021-10-25 12:31:41 +00:00
Evgenia Kotovich
0d0980ee0d Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-18 09:26:33 +00:00
Noemi Erli
2bba3cec69 Backed out changeset 2ab6bb03dcc1 (bug 1576768) for causing failures in test_double_submit.html CLOSED TREE 2021-10-18 02:05:57 +03:00
Evgenia Kotovich
3e3dff109c Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-17 14:59:14 +00:00
Alexandru Michis
dac6815201 Backed out changeset 7c08aa027893 (bug 1576768) for causing multiple failures.
CLOSED TREE
2021-10-15 16:52:43 +03:00
Evgenia Kotovich
a8b32926fa Bug 1576768 - Automatically format .sjs files using prettier. r=Standard8,agi,zombie,extension-reviewers
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D128482
2021-10-15 12:58:11 +00:00
Henri Sivonen
8954e892c8 Bug 1735161 - Update MDN URL in speculation failure message. r=smaug DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D128095
2021-10-12 06:49:15 +00:00
Geoff Brown
7e36862b61 Bug 1724296 - Remove many skip-if(verify) test annotations (mochitest pt 2); r=jmaher
This completes the review of skip-if(verify) in mochitest.ini.

Differential Revision: https://phabricator.services.mozilla.com/D127992
2021-10-09 16:07:32 +00:00
Emilio Cobos Álvarez
a002eeaccb Bug 1733945 - Simplify reftest annotations to assume skiaContent == true. r=jrmuizel
Generated with:

  2180efaf7c

Differential Revision: https://phabricator.services.mozilla.com/D127428
2021-10-04 15:19:10 +00:00
Henri Sivonen
7588a257ed Bug 1724243 - Make text/plain and MediaDocuments use the Standards Mode. r=smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D123318
2021-10-01 12:55:28 +00:00