Commit Graph

3372 Commits

Author SHA1 Message Date
Peter Van der Beken
2e0cd032d6 Bug 1749935 - Remove nsIDTD::WillBuildModel. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135883
2022-02-14 13:03:49 +00:00
Peter Van der Beken
bbfc56b73d Bug 1749935 - Inline FindSuitableDTD in caller. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135882
2022-02-14 13:03:49 +00:00
Peter Van der Beken
00c7469638 Bug 1749935 - Make mSlidingBuffer a UniquePtr. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135881
2022-02-14 13:03:48 +00:00
Peter Van der Beken
15b9997eb0 Bug 1749935 - Always create scanner upfront. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135880
2022-02-14 13:03:48 +00:00
Peter Van der Beken
c68cf34189 Bug 1749935 - Remove unused support for nested CParserContext. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135879
2022-02-14 13:03:47 +00:00
Peter Van der Beken
bb4612daad Bug 1749935 - Remove nsIDTD::GetMode. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135848
2022-02-14 13:03:47 +00:00
Peter Van der Beken
2e5c4bc0ad Bug 1749935 - Remove unused argument from nsIDTD::DidBuildModel. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135847
2022-02-14 13:03:47 +00:00
Peter Van der Beken
028ef0b8d1 Bug 1749935 - Remove nsDTDMode::eDTDMode_unknown and unused nsDTDMode::eDTDMode_almost_standards/eDTDMode_fragment. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135846
2022-02-14 13:03:46 +00:00
Peter Van der Beken
f7e0158768 Bug 1749935 - Remove unused nsIDTD::CanContain/IsContainer. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135844
2022-02-14 13:03:46 +00:00
Peter Van der Beken
c3603b8d98 Bug 1749935 - Remove unused aTokenizer argument for nsIDTD::WillBuildModel/BuildModel. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135843
2022-02-14 13:03:45 +00:00
Peter Van der Beken
2021662efc Bug 1749935 - Remove unused NS_PARSER_FLAG_OBSERVERS_ENABLED and NS_PARSER_FLAG_FLUSH_TOKENS. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135842
2022-02-14 13:03:45 +00:00
Peter Van der Beken
dbcebc9c00 Bug 1749935 - Remove unused nsParser::SetUnusedInput. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135841
2022-02-14 13:03:44 +00:00
Peter Van der Beken
0836295ae7 Bug 1749935 - Remove nsIParser::MarkAsNotScriptCreated. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135840
2022-02-14 13:03:44 +00:00
Peter Van der Beken
63a0a73d2c Bug 1749935 - Remove nsIParser::GetChannel. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135839
2022-02-14 13:03:44 +00:00
Peter Van der Beken
481d54202e Bug 1749935 - Remove unused eAutoDetectResult values. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135838
2022-02-14 13:03:43 +00:00
Peter Van der Beken
5549bd8b2c Bug 1749935 - Remove unused PREFER_LATTER_ERROR_CODE. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135837
2022-02-14 13:03:43 +00:00
Peter Van der Beken
8573e064a2 Bug 1749935 - Mark nsIParser::WillResume(Impl) as infallible. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D135836
2022-02-14 13:03:43 +00:00
Peter Van der Beken
dd05949994 Bug 1752498 - XML error shows garbage for location. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D137262
2022-02-02 09:28:33 +00:00
Henri Sivonen
2c95bf7be8 Bug 1749522 - When plain text encoding speculation fails, restart the plaintext mode of the tokenizer. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D135830
2022-01-17 09:16:10 +00:00
Peter Van der Beken
1105765fa9 Bug 1749462 - Don't convert URI to string for Expat. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D135835
2022-01-17 08:49:11 +00:00
Sandor Molnar
4d0c0a33eb Backed out changeset a2d8eae8d006 (bug 1749522) for causing reftest failures in tests/reftest/bug1749522-1. CLOSED TREE 2022-01-14 17:50:39 +02:00
Henri Sivonen
d20ee45260 Bug 1749522 - When plain text encoding speculation fails, restart the plaintext mode of the tokenizer. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D135830
2022-01-14 13:36:24 +00:00
Henri Sivonen
09d38d1170 Bug 1748482 - Check XML parser for brokenness in various methods. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D135096
2022-01-05 13:43:35 +00:00
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
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
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
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
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
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
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
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
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