Commit graph

728 commits

Author SHA1 Message Date
Jon Coppeard
c095a8dbd4 Bug 1865410 - Part 1: Don't use preload requests after an import map is registered r=smaug
We stop speculative preloading of module scripts after seeing an import map.
However it can still happen that we see a preload request for script element
after an import map is registered because a script can dynamically insert an
import map after preloading has happened.

Don't use these preloads as they may have incorrectly resolved module
specifiers.

We can remove the previous way of dealing with this issue where we removed
preloaded modules from the module map if we later loaded an import map. This is
not safe as modules could be present in the module map for other valid reasons,
e.g. if they have been imported by another script.

Differential Revision: https://phabricator.services.mozilla.com/D194766
2023-12-02 08:49:59 +00:00
Denis Palmeiro
596fcfcea7 Bug 1865929: Apply delazify strategy to small scripts in ScriptLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D194647
2023-11-24 19:50:45 +00:00
Mirko Brodesser
135eba69cf Bug 1865610: part 4) Add fetchpriority attribute support for rel=modulepreload and rel=preload as=script. r=smaug,valentin
Differential Revision: https://phabricator.services.mozilla.com/D192331
2023-11-23 14:45:21 +00:00
Mirko Brodesser
ac16c226e0 Bug 1865610: part 1) Add partial support for the "fetchpriority" attribute for loading style sheets from <link> elements or Link header fields. r=smaug,emilio,valentin
Includes only support for dynamically loading style sheets from `<link>`
elements and `Link` header fields.
The remaining support, including preloading, is completed in part 3.

Differential Revision: https://phabricator.services.mozilla.com/D191745
2023-11-23 14:36:11 +00:00
Tooru Fujisawa
e550bdfb92 Bug 1864168 - Part 6: Use 1-origin column number in ScriptLoader and nsIScriptElement. r=smaug,devtools-reviewers,hsivonen,ochameau
Also fix opSetScriptLineAndColumnNumberAndFreeze::mColumnNumber to point the
first character of the script source, instead of '>' of the start tag.

Differential Revision: https://phabricator.services.mozilla.com/D193374
2023-11-22 12:31:32 +00:00
Tooru Fujisawa
8c59289f4f Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D193369
2023-11-22 12:31:30 +00:00
Natalia Csoregi
705aa81869 Backed out 14 changesets (bug 1865005, bug 1864168, bug 1864155, bug 1862814, bug 1862693) for causing bustage on nsRFPService.cpp. CLOSED TREE
Backed out changeset a4f3e7625abf (bug 1865005)
Backed out changeset ab38141e470b (bug 1862814)
Backed out changeset a679b50dc4a9 (bug 1862814)
Backed out changeset e340886ce62a (bug 1862814)
Backed out changeset 1378502e64b0 (bug 1862814)
Backed out changeset 8ee94e5e79c2 (bug 1862814)
Backed out changeset 6d4ef1cdfabb (bug 1864168)
Backed out changeset 2c30c4d757fc (bug 1864168)
Backed out changeset d4db9576559b (bug 1864168)
Backed out changeset 8ffec0d83028 (bug 1864168)
Backed out changeset fa77d852b494 (bug 1864168)
Backed out changeset f6646771a26a (bug 1864168)
Backed out changeset 7bd0ff6986df (bug 1864155)
Backed out changeset 39867b503289 (bug 1862693)
2023-11-22 14:01:55 +02:00
Tooru Fujisawa
78e7224834 Bug 1864168 - Part 6: Use 1-origin column number in ScriptLoader and nsIScriptElement. r=smaug,devtools-reviewers,hsivonen,ochameau
Also fix opSetScriptLineAndColumnNumberAndFreeze::mColumnNumber to point the
first character of the script source, instead of '>' of the start tag.

Differential Revision: https://phabricator.services.mozilla.com/D193374
2023-11-22 11:13:56 +00:00
Tooru Fujisawa
a4a513ad86 Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D193369
2023-11-22 11:13:54 +00:00
Tooru Fujisawa
cf99b67c05 Bug 1862692 - Part 20: Stop using 0-origin column number types. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D193033
2023-11-09 11:41:12 +00:00
Tooru Fujisawa
f4a1cb246a Bug 1862692 - Part 17: Use 1-origin column number type in JS::ReadOnlyCompileOptions. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D193030
2023-11-09 11:41:11 +00:00
Tooru Fujisawa
62e38eaac8 Bug 1853881 - Part 1: Add JS::ThreadStackQuotaForSize and use it everywhere. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D191905
2023-10-26 14:10:55 +00:00
Mirko Brodesser
dc52b1401a Bug 1839315: part 6) Lift code for fetchpriority attribute from nsGenericHTMLElementWithFetchPriorityAttribute to nsGenericHTMLElement. r=smaug
As requested in the review of part 1.

Differential Revision: https://phabricator.services.mozilla.com/D191274
2023-10-23 08:14:51 +00:00
Mirko Brodesser
5ccc34b836 Bug 1839315: part 1) Lift code for fetchpriority attribute from HTMLScriptElement to nsGenericHTMLElementWithFetchPriorityAttribute. r=smaug
Since the HTMLLinkElement requires it too, see part 2.

Differential Revision: https://phabricator.services.mozilla.com/D189935
2023-10-23 08:14:49 +00:00
Tooru Fujisawa
5d9a5df4e1 Bug 1846407 - Use enum class for Task::Run return value. r=bas,win-reviewers,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D185043
2023-10-18 15:23:29 +00:00
Noemi Erli
c3c92500ef Backed out changeset 7718734e95b1 (bug 1846407) for causing bustages in nsWindow.cpp CLOSED TREE 2023-10-18 05:31:49 +03:00
Tooru Fujisawa
0054ab3127 Bug 1846407 - Use enum class for Task::Run return value. r=bas,win-reviewers,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D185043
2023-10-18 01:54:43 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Emilio Cobos Álvarez
25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Yoshi Cheng-Hao Huang
b758eaeb68 Bug 1841859 - Part 2: Parse the referrer policy from http header and update the referrer policy. r=jonco,smaug
This implementes the following requirement from the spec:

https://html.spec.whatwg.org/#fetch-a-single-module-script

12. In both cases, let processResponseConsumeBody given response response and null, failure, or a byte sequence bodyBytes be the following algorithm:

  5. Let referrerPolicy be the result of parsing the `Referrer-Policy` header given response.
  6. If referrerPolicy is not the empty string, set options's referrer policy to referrerPolicy.

Differential Revision: https://phabricator.services.mozilla.com/D186944
2023-09-20 17:32:15 +00:00
Yoshi Cheng-Hao Huang
cd69bc3c65 Bug 1841859 - Part 1: Move ReferrerPolicy to ScriptLoadRequest and LoadedScript. r=jonco,smaug
Suggested by jonco during review,
https://phabricator.services.mozilla.com/D186944#inline-1036982

Differential Revision: https://phabricator.services.mozilla.com/D187385
2023-09-20 17:32:15 +00:00
Mirko Brodesser
8e5580d60e Bug 1839316: part 12) Adjust nsISupportsPriority's value to fetch priority in ScriptLoader. r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D187438
2023-09-19 13:13:27 +00:00
Tooru Fujisawa
eaf4a57860 Bug 1853480 - Part 1: Use TaskController thread stack size as JS stack quota in ScriptLoader off-thread compilation. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D188556
2023-09-19 11:12:52 +00:00
Narcis Beleuzu
4ddc9496d3 Backed out 4 changesets (bug 1853480) for bustages on ScriptPreloader.cpp . CLOSED TREE
Backed out changeset 153828203749 (bug 1853480)
Backed out changeset f686d2dccfd6 (bug 1853480)
Backed out changeset 975251abd222 (bug 1853480)
Backed out changeset d29bfc33c3e8 (bug 1853480)
2023-09-19 13:44:52 +03:00
Tooru Fujisawa
a10325d739 Bug 1853480 - Part 1: Use TaskController thread stack size as JS stack quota in ScriptLoader off-thread compilation. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D188556
2023-09-19 09:46:25 +00:00
Henri Sivonen
2ea4ba1cf2 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-09-15 07:53:16 +00:00
Mirko Brodesser
06c09b51d1 Bug 1839316: part 11) Factor preparing the incremental stream loader out of StartLoadInternal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187181
2023-09-05 12:07:20 +00:00
Mirko Brodesser
6ab61c105c Bug 1839316: part 10) Factor preparing the HTTP request and initiator type out of StartLoadInternal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187177
2023-09-05 12:07:20 +00:00
Mirko Brodesser
a4bcc60a60 Bug 1839316: part 9) Factor preparing request priority and request dependencies out of StartLoadInternal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187176
2023-09-05 12:07:20 +00:00
Mirko Brodesser
5044b90fb7 Bug 1839316: part 8) Factor details of preparing load info and preparing the cache info out of ScriptLoader::StartLoadInternal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D187175
2023-09-04 09:05:10 +00:00
Tooru Fujisawa
ce72fea4a7 Bug 1846194 - Remove off-thread compilation and decode API. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D185125
2023-09-01 03:43:21 +00:00
Mirko Brodesser
69e061faaa Bug 1850713: remove duplicated setting of early hint preloader id in ScriptLoader::StartLoadInternal. r=kershaw,manuel
Happens already at
<https://searchfox.org/mozilla-central/rev/e7b8d13b7513b6fbd97d69e882d7faeed05309d0/dom/script/ScriptLoader.cpp#620-628>.

Differential Revision: https://phabricator.services.mozilla.com/D187105
2023-08-30 14:58:21 +00:00
Mirko Brodesser
29a4be0f8b Bug 1839316: part 7) Factor creating channel for script loading out of ScriptLoader::StartLoadInternal. r=kershaw
Abstracts details away. Simplifies extending `StartLoadInternal`.

Differential Revision: https://phabricator.services.mozilla.com/D187093
2023-08-30 10:33:40 +00:00
Tooru Fujisawa
d5ad45d022 Bug 1845668 - Part 2: Move OffThreadCompilationCompleteTask::Run into class definition. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D184899
2023-08-29 12:07:18 +00:00
Tooru Fujisawa
7436d5d4b4 Bug 1845668 - Part 1: Rewrite OffThreadCompilationCompleteRunnable based on Task. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D184898
2023-08-29 12:07:18 +00:00
Tooru Fujisawa
1398b6d4be Bug 1845638 - Part 2: Include the pending time of OffThreadCompilationCompleteRunnable to the profiler timing. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D184897
2023-08-29 12:07:18 +00:00
Tooru Fujisawa
70c40a1658 Bug 1845638 - Part 1: Use JS::FrontendContext APIs and TaskController in compilation and decode in ScriptLoader. r=smaug,bthrall
Differential Revision: https://phabricator.services.mozilla.com/D184896
2023-08-29 12:07:18 +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
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
Tooru Fujisawa
70cc38532e Bug 1847469 - Part 26: Use column number types in JS::CompileOptions. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D185764
2023-08-16 17:31:42 +00:00
Cristian Tuns
4fe9ed8f30 Backed out 27 changesets (bug 1847469) for causing spidermonkey bustages in Script.cpp CLOSED TREE
Backed out changeset 9d6e2651a013 (bug 1847469)
Backed out changeset 9b72d668efd2 (bug 1847469)
Backed out changeset 86abf5cf0a22 (bug 1847469)
Backed out changeset 46833087f8ac (bug 1847469)
Backed out changeset f3e2207fdeec (bug 1847469)
Backed out changeset aed75776cfff (bug 1847469)
Backed out changeset 8292a38bd99f (bug 1847469)
Backed out changeset 1320f83fb8c7 (bug 1847469)
Backed out changeset df9f925f9837 (bug 1847469)
Backed out changeset 69f32cf1862a (bug 1847469)
Backed out changeset b2ddddec8818 (bug 1847469)
Backed out changeset 056eed7abc97 (bug 1847469)
Backed out changeset 5df4f43ac0bf (bug 1847469)
Backed out changeset cb57923f6532 (bug 1847469)
Backed out changeset a0993f2a2195 (bug 1847469)
Backed out changeset 782499fbedf2 (bug 1847469)
Backed out changeset cf84fb98c5e1 (bug 1847469)
Backed out changeset 1fa5ab59814b (bug 1847469)
Backed out changeset f5f78944df81 (bug 1847469)
Backed out changeset aa14337bf5c6 (bug 1847469)
Backed out changeset 6757db4575d7 (bug 1847469)
Backed out changeset 236ff135701e (bug 1847469)
Backed out changeset 9b4d5b435020 (bug 1847469)
Backed out changeset a0f789621bc8 (bug 1847469)
Backed out changeset c19b81f48055 (bug 1847469)
Backed out changeset b4521e546d7e (bug 1847469)
Backed out changeset f26a10289316 (bug 1847469)
2023-08-16 07:08:01 -04:00
Tooru Fujisawa
185839bd83 Bug 1847469 - Part 26: Use column number types in JS::CompileOptions. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D185764
2023-08-16 10:26:34 +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
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
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
Jon Coppeard
80cac6bbb5 Bug 1843838 - Rename ScriptLoadRequest::IsReadyToRun to IsFinished since this returns true for cancelled requests r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D183740
2023-08-04 09:40:40 +00:00