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

4846 Коммитов

Автор SHA1 Сообщение Дата
Mathew Hodson 9b4650bb45 Bug 582361 - Align scrolling to a fragment with HTML spec. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187362
2023-09-13 16:04:59 +00:00
Mike Hommey 36d0f4e00d Bug 1851729 - Stop building the parts of expat we don't need when wasm-sandboxing it. r=bholley
While in the vicinity, add a missing define for IS_LITTLE_ENDIAN in
wasm, which in practice has no consequence because the code that depends
on it is not actually used in the wasm sandbox. And since that code is
not used, we also strip it.

Differential Revision: https://phabricator.services.mozilla.com/D187524
2023-09-06 02:55:21 +00:00
Markus Stange fe7358f6c8 Bug 1843949 - Preallocate attribute array with the known size from parsing. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D183809
2023-09-02 18:46:30 +00:00
Andrew Creskey baa6cd2868 Bug 1850892 - Remove expiring probe HTTP_PRELOAD_IMAGE_STARTREQUEST_DELAY r=necko-reviewers,valentin
We are working on an alternative approach to improving OnStart/OnStop request timing, and so will remove this probe because it's no longer as relevant and the implementation touchs many classes and methods.

Differential Revision: https://phabricator.services.mozilla.com/D187233
2023-09-01 14:45:06 +00:00
Mirko Brodesser 2966a909e7 Bug 1839316: part 4) Add `RequestPriority` to `ScriptFetchOptions` and `ScriptLoadRequest`. r=smaug
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.

Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-28 11:56:34 +00:00
renevietnam29@gmail.com 2a0eb51c7e Bug 1842984 Remove dom.image-lazy-loading.enabled r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D184883
2023-08-23 13:26:36 +00:00
Norisz Fay c5e74dfe84 Backed out changeset 4a4d5e64aec5 (bug 1846178) for causing mochitest failures on test_script_loader_js_cache.html/cache_module.html CLOSED TREE 2023-08-23 11:19:39 +03:00
Henri Sivonen acc51e7036 Bug 1846178 - Use the async/defer (non-blocking) HTML parser code path for module scripts. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D185797
2023-08-23 07:11:47 +00:00
Emilio Cobos Álvarez 95707c96bb Bug 1849204 - Add generic atom hash keys that use the better distributed atom hash, and use it across the tree. r=mstange,xpcom-reviewers,credential-management-reviewers,sgalich,nika
Differential Revision: https://phabricator.services.mozilla.com/D186496
2023-08-18 18:43:27 +00:00
Markus Stange 943e3c05a7 Bug 1843946 - Use an atom for the full class attribute value, to reduce string hash key cost during the AtomArrayCache lookup. r=emilio
This generalizes the previous "set single class from parser" fast-path to
also apply when there are multiple classes in the class attribute.

The main benefit is the cheaper cache lookup.
Another benefit is that this avoids a string copy (the same copy that the original
"set single class from parser" optimization avoided).

We now always atomize the full class attribute value before parsing it,
e.g. when somebody uses setAttribute. In the common case of a single class,
this atomization cost would have been paid anyway.

Before: https://share.firefox.dev/4576ulw
After: https://share.firefox.dev/3rNGBsH (though this is not the full story
because the atomization work is moved outside of nsHtml5TreeOperation::SetHTMLElementAttributes)

Differential Revision: https://phabricator.services.mozilla.com/D183813
2023-08-17 19:02:40 +00:00
Sean Feng aa9228e6a7 Bug 1840191 - Fix a crash where nsContentSink::DidBuildModelImpl gets called with incorrect state r=hsivonen,dom-core
The autofocus algorithm made this noticeable because we now can run
scripts at an earlier time.

Differential Revision: https://phabricator.services.mozilla.com/D182734
2023-08-17 18:22:57 +00:00
Olli Pettay 3d32582619 Bug 1848714 - Use unsafe methods in hot code paths to access and remove elements from nsTArray when it is guaranteed to be safe, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186191
2023-08-15 14:24:19 +00:00
Emilio Cobos Álvarez ea11c5c0b4 Bug 1847811 - Remove network.preload pref. r=necko-reviewers,anti-tracking-reviewers,pbz,kershaw
Having it disabled is not web compatible, and there's no strong reason
to keep it, IMO.

If we want another pref to determine whether preloads are actually
triggered we can add it in the future.

Differential Revision: https://phabricator.services.mozilla.com/D186014
2023-08-14 10:46:03 +00:00
Cosmin Sabou c406bcf318 Backed out 5 changesets (bug 1839316) for causing bustages on ScriptLoader.cpp. CLOSED TREE
Backed out changeset 85f107e082ee (bug 1839316)
Backed out changeset 8c1e22518c3a (bug 1839316)
Backed out changeset a4c3dec0f34c (bug 1839316)
Backed out changeset 313ff15742dd (bug 1839316)
Backed out changeset fa200e26bbb1 (bug 1839316)
2023-08-09 20:16:06 +03:00
Mirko Brodesser 5cade38f47 Bug 1839316: part 4) Add `RequestPriority` to `ScriptFetchOptions` and `ScriptLoadRequest`. r=smaug
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.

Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-09 13:50:28 +00:00
Masayuki Nakano b2e135f779 Bug 1845445 - Make `ContentEventHandler::ShouldBreakLineBefore` use `nsHTMLTag` instead of `nsINode::IsAnyOfHTMLElements` with a lot of params r=smaug
It's expensive to call `nsINode::IsAnyOfHTMLElements` with a lot of arguments
due to its recursive calls (in this case, called with 30 arguments).

Additionally, the unknown element check with `do_QueryObject` is also expensive.

Once we get an `nsHTMLTag`, we can use a `switch` statement.

Note that I realized `nsHTMLTag_small` is not defined only on Windows if
`nsHTMLTags.h` is included after `rpcndr.h` in the Windows SDK since there is
```
#define small char
```

In the header file.  This patch includes the workaround for this issue.

Differential Revision: https://phabricator.services.mozilla.com/D184553
2023-08-09 02:31:50 +00:00
Emilio Cobos Álvarez a74c9be827 Bug 1847715 - Don't require a virtual call for LinkStyle::FromNode(Element&). r=smaug
This allows getting rid of some of the special-cases to avoid this virtual call
elsewhere.

Differential Revision: https://phabricator.services.mozilla.com/D185639
2023-08-08 11:14:02 +00:00
Emilio Cobos Álvarez 46b5ba840a Bug 1847546 - Other misc nsHtml5TreeOperation clean-ups. r=smaug
Remove useless namespacing, we have an using statement in the file
anyways.

Differential Revision: https://phabricator.services.mozilla.com/D185638
2023-08-08 10:18:20 +00:00
Emilio Cobos Álvarez 6f0f08186e Bug 1847546 - Clean-up nsHtml5TreeOperation::CreateHTMLElement. r=smaug
Couldn't resist.

Differential Revision: https://phabricator.services.mozilla.com/D185598
2023-08-08 10:05:28 +00:00
CanadaHonk a117230132 Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 22:11:05 +00:00
Emilio Cobos Álvarez 94de7e9ddf Bug 1847546 - Don't do duplicate work on style elements from the innerHTML setter. r=smaug
Right now, when binding to the tree we queue a runnable to update the
stylesheet, even though mEnableUpdates is false.

Even though the redundant update is nowadays always cached, it's just
wasted work, and the code is simpler without it.

This will be tested by bug 1771113, which is what made me look at this.

We need to tweak a bit the dispatch of applicable state change events
for DevTools, because for a case like:

  div.attachShadow({ mode: "open" }).innerHTML = `<style>...</style>`;

Before we'd go through the stylesheet cache here due to the redundant
update:

  https://searchfox.org/mozilla-central/rev/fb43eb3bdf5b51000bc7dfe3474cbe56ca2ab63c/layout/style/SharedStyleSheetCache.cpp#161-165

But now we won't, and the code in StyleSheet.cpp wasn't quite correct /
didn't dispatch the event.

Nobody listens to style-sheet-applicable-state-changed, so remove that
code while at it.

Differential Revision: https://phabricator.services.mozilla.com/D185559
2023-08-07 20:21:34 +00:00
Stanca Serban 183a888a39 Backed out 3 changesets (bug 1824121) for causing wpt failures in html5lib_search-element.html. CLOSED TREE
Backed out changeset e3aec91d79e4 (bug 1824121)
Backed out changeset e3a3324b1732 (bug 1824121)
Backed out changeset 6ff5c272ab8e (bug 1824121)
2023-08-07 21:20:18 +03:00
Cosmin Sabou cbccca3a0d Bug 1824121 - Include nsHtml5HtmlAttributes.h to fix Bp-nu build bustages. a=bustage-fix CLOSED TREE 2023-08-07 18:35:00 +03:00
CanadaHonk 631b819e14 Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 14:05:32 +00:00
Cosmin Sabou 0058dbdd1c Backed out 5 changesets (bug 1839316) for causing leaks. CLOSED TREE
Backed out changeset 75edff380fee (bug 1839316)
Backed out changeset 6a622fd5cd91 (bug 1839316)
Backed out changeset 60908cc7c586 (bug 1839316)
Backed out changeset 7b9dd8875a9e (bug 1839316)
Backed out changeset b586915187c2 (bug 1839316)
2023-08-07 16:43:03 +03:00
Cosmin Sabou b0f9a6e63d Backed out changeset c309e9b48aec (bug 1824121) for causing element related mochitest failures. CLOSED TREE 2023-08-07 16:05:13 +03:00
CanadaHonk 23a0c9beff Bug 1824121 - Implement the <search> element r=hsivonen,Jamie,emilio
Implemented the new <search> HTML element.
All WPT tests for it now pass (except one for iso-8859-8, not done generally).

A11y role uses just landmark as recommended instead of a new search role (for now).

Co-authored-by: Henri Sivonen <hsivonen@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D176967
2023-08-07 12:30:50 +00:00
Mirko Brodesser 5d091f10d0 Bug 1839316: part 4) Add `RequestPriority` to `ScriptFetchOptions` and `ScriptLoadRequest`. r=smaug
The request priority isn't propagated from `ScriptFetchOptions`, so
setting it has no effect for end-users. That will be implemented in a
following part.

Differential Revision: https://phabricator.services.mozilla.com/D183483
2023-08-07 11:46:19 +00:00
Peter Van der Beken dfce7f40b3 Bug 1843968 - Hold some strong references. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D184803
2023-08-01 12:09:36 +00:00
Mirko Brodesser 8a2cd802ca Bug 1845073: add "fetchpriority" attribute to HTML parser. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D184458
2023-08-01 06:47:51 +00:00
Tom Schuster 90a29a13ea Bug 1627263 - Propagate nonce attribute from <link preload> to loaders. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183967
2023-07-31 14:49:56 +00:00
Tom Schuster 1586c9c5ed Bug 1627263 - Provide the nonce for speculative style preloads. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183966
2023-07-31 14:49:56 +00:00
Mirko Brodesser fcb76b13d8 [Bug 1845094] Change HTML parser's README to reflect that comments with "Uncomment" (case-sensitive) have to be changed too. r=edgar DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D184375
2023-07-31 08:02:15 +00:00
Tom Schuster 115b5bd777 Bug 1843066 - Provide the nonce for speculative <script> preloads. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183390
2023-07-21 17:28:02 +00:00
Stanca Serban 70ab9b117e Backed out 6 changesets (bug 1313937, bug 1843066, bug 1843002) for causing build bustages in ScriptLoadRequest.h. CLOSED TREE
Backed out changeset 84c2d1c04aa2 (bug 1313937)
Backed out changeset 7cab9a1ea25f (bug 1313937)
Backed out changeset affc7d1f130d (bug 1313937)
Backed out changeset e13aacfe7944 (bug 1843066)
Backed out changeset 21a9bee8f772 (bug 1843002)
Backed out changeset d381b6365111 (bug 1843002)
2023-07-21 17:41:04 +03:00
Tom Schuster 0935ddb561 Bug 1843066 - Provide the nonce for speculative <script> preloads. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183390
2023-07-21 12:31:23 +00:00
Olli Pettay 6dc4557a54 Bug 1843918, don't even try to warn about compatibility mode when parsing a data document, r=dom-core,edgar
Differential Revision: https://phabricator.services.mozilla.com/D183896
2023-07-19 08:07:24 +00:00
Em Zhan 7a4c08f2c3 Bug 1843514 - Avoid speculative module loads after importmap r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183637
2023-07-16 17:33:17 +00:00
Nika Layzell b4b30f1acd Bug 1842658 - Part 2: Use refcounting macros for nsHtml5OwningUTF16Buffer, r=mccr8
When the code was originally added in bug 1842658, it was to use non-atomic
refcounting across multiple threads due to some invariants preventing
concurrent access. That was changed in bug 1607762 to fix a race issue.

We should be able to switch to using the macros now, which will simplify the
code here a bit.

Depends on D183203

Differential Revision: https://phabricator.services.mozilla.com/D183204
2023-07-14 16:20:54 +00:00
Olli Pettay 036d8eb082 Bug 1842792, disable speculative load of modulepreload if parser has seen importmap, r=jonco,allstarschh,peterv
Differential Revision: https://phabricator.services.mozilla.com/D183421
2023-07-13 16:27:23 +00:00
Tom Schuster 36bbfb0e0c Bug 1842199 - Add nonce attribute to HTML parser. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D182777
2023-07-10 12:48:23 +00:00
Cristina Horotan f03ce34731 Backed out changeset 24e6bd152417 (bug 1627263) as requested because it landed with the wrong bug number 2023-07-10 14:31:32 +03:00
Tom Schuster 80b4c639e3 Bug 1627263 - Add nonce attribute to HTML parser. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D182777
2023-07-10 10:39:45 +00:00
Noemi Erli 1f7e2c0e0f Backed out changeset dd6b4605ab60 (bug 1627263) for causing bustages in nsHtml5StackNode.h CLOSED TREE 2023-07-07 15:01:27 +03:00
Tom Schuster e9fda63e32 Bug 1627263 - Add nonce attribute to HTML parser. r=hsivonen
Depends on D182564

Differential Revision: https://phabricator.services.mozilla.com/D182777
2023-07-07 11:26:55 +00:00
Kershaw Chang 705e17a537 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-28 13:21:00 +00:00
Norisz Fay 07a91b8c6a Backed out 2 changesets (bug 1838829) for causing perma mochitest failure with dom/websocket/tests being skipped CLOSED TREE
Backed out changeset 19a5d4f1850a (bug 1838829)
Backed out changeset 97cd8a256954 (bug 1838829)
2023-06-27 02:52:52 +03:00
Kershaw Chang 75c68b6864 Bug 1838829 - Skip failed tests, r=necko-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,dimi,valentin,robwu
Differential Revision: https://phabricator.services.mozilla.com/D181251
2023-06-26 14:22:14 +00:00
Emilio Cobos Álvarez 4cc6758558 Bug 1839922 - Remove usage of {Has,Get}Attr(kNameSpaceID_None, ..). r=edgar
We have more readable and faster versions (that just omit the namespace
arg).

Mostly done via sed, with a couple helpers to use the faster lookups
where possible.

Differential Revision: https://phabricator.services.mozilla.com/D181795
2023-06-23 10:01:32 +00:00
Norisz Fay e86f1fa0e9 Backed out 5 changesets (bug 1838829) for causing mochitest failures CLOSED TREE
Backed out changeset 693d34c8447d (bug 1838829)
Backed out changeset 903d9ff4afaa (bug 1838829)
Backed out changeset 5e51feff7467 (bug 1838829)
Backed out changeset e125be49d2a6 (bug 1838829)
Backed out changeset 1a8cf3c83dc4 (bug 1838829)
2023-06-22 03:37:07 +03:00