Commit Graph

33 Commits

Author SHA1 Message Date
Moonchild e6b9d9cbea Issue #1624 - Add missing error handling and bail on null specifier. 2020-11-28 10:17:43 +00:00
Moonchild a680bdc637 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-23 13:55:00 +00:00
Moonchild df55ce9037 Issue #618 - Clear the module map when changing a Document's global and add
release build assertions for mismatching compartments.
2020-09-08 11:00:27 +00:00
Moonchild 8e5d9da5eb Issue #618 - Make ES6 modules work for resource: URIs 2020-09-08 08:22:28 +00:00
Moonchild 92ef206274 Issue #618 - Implement preloading of module scripts.
This hooks up module scripts to the existing preload mechanism.
2020-08-27 15:44:53 +00:00
Gaming4JC 38d13e2779 Issue #618 - Don't preload nomodule scripts when modules are enabled
Ref: BZ 1382020
2020-08-26 11:19:42 -04:00
Moonchild b78f53ffb0 Issue #618 - (async) Implement async attribute for inline module scripts.
This commit does several things:
- Moves the pref check from ScriptLoader to ns[I]Document so it can be called on
the document.
- Changes the atrribute freezing function to a better name that takes the
document as a parameter.
- Sets the proper async/defer attributes on HTML script elements based on
keywords and whether they are module scripts or not.
2020-08-25 07:06:43 +00:00
Moonchild 8b397a63af Issue #618 - (async) Keep track of script modes in a single mode state.
This simplifies handling of combinations of async/defer by assigning one and
only one state to scripts.
If async then always async > if defer or module then defer > otherwise blocking.
2020-08-25 05:52:40 +00:00
Moonchild 2ca1cbe2f5 Issue #618 - (async, preload) Correctly pass info about async/defer to parser.
This makes sure we don't block body-referred sub-resources by head-referenced
defer and async scripts. This is important for all script loads, not just
modules, but is added here because it was run into while implementing modules.
2020-08-24 11:13:16 +00:00
Moonchild 95e0f114e2 Issue #618 - (async) Split out function to add async request. 2020-08-24 10:15:00 +00:00
Moonchild a0ef1c07de Issue #618 - Rename some script load request flags to be more descriptive. 2020-08-24 09:56:03 +00:00
Moonchild c5ab177485 Issue #618 - Make document.currentScript null in modules.
Because the spec says so.
2020-08-23 14:08:32 +00:00
Jon Coppeard 76e5f863aa Issue #618 - Fix processing of non-parser-generated module scripts. 2020-08-22 18:35:57 +00:00
Jon Coppeard f0175ebc76 Issue #618 - Handle errors for inline module scripts and ensure we update the
module map after fetch errors.
2020-08-22 10:13:37 +00:00
Moonchild cbbfd0f2d7 Issue #618 - Split SRI verification out from OnStreamComplete. 2020-08-22 09:51:42 +00:00
Moonchild 090a487388 Issue #618 - Split handling of load errors out from OnStreamComplete. 2020-08-22 09:27:12 +00:00
Moonchild c8a701b646 Issue #618 - Integrity for descendant module scripts should be the empty string
Because the spec says so.
2020-08-22 07:16:29 +00:00
Jon Coppeard 073e914eba Issue #618 - Don't mute errors for module scripts because they always use CORS 2020-08-22 07:08:10 +00:00
Moonchild 86f128d412 Issue #618: Pass down referrer and referrer policy when fetching modules.
Because the spec says so.
2020-08-13 17:13:23 +00:00
Moonchild 4f0d9497f2 Issue #618: Ignore 'event' and 'for' attributes for module scripts.
Because the spec says so.
2020-08-13 13:42:52 +00:00
Moonchild 9b62528938 Issue #618 - Simplify module resolve hook to be a function pointer
This is an ahead-of time port to try and address #1624.
This is based on BZ 1461751 and Jon Coppeard's work in it.
2020-08-06 18:31:36 +00:00
Gaming4JC 15a7be79bd Issue #618 - Keep track of which modules in a graph have been fetched using a visited set
Ref: BZ 1365187
2020-08-04 10:25:36 -04:00
Gaming4JC 7e673b1dbe Issue #618 - Simplify module map interface
Ref: BZ 1365187
2020-08-04 10:25:32 -04:00
Jon Coppeard 8447c4d8a3 Issue #618 - Record module dependency before starting fetch so that error
handling works correctly

Ref BZ 1395896
2020-08-02 07:20:25 +00:00
Moonchild 43e0632cd4 Issue #618 - Align error handling for module scripts with the spec (again)
This updates module implementation to match spec regarding handling of
instantiation errors, after it was changed yet again, this time to not remember
instantiation errors, but instead immediately rethrow applicable ones.

Ref: BZ 1420420
2020-07-08 12:58:30 +00:00
Moonchild 786e344698 Issue #618 - Fix error events fired when loading JS module dependencies fail
When module dependencies fail, don't spam with errors for each import; only fire
the error event once.

Ref: BZ 1421259
2020-07-08 10:50:53 +00:00
Moonchild 66bf3a2279 Issue #618 - Further align error handling for module scripts with the spec
Ref: BZ 1388728
2020-07-04 16:28:30 +00:00
Moonchild 046534432d Issue #618 - Remove eager instantiation
This backs out the stuff added in Bug 1295978.
Ref: BZ 1295978, 1388728
2020-07-04 10:35:22 +00:00
Moonchild 10e2624419 Issue #618 - Match JSAPI names with the changes in 9ca7414722
Ref: BZ 1388728
2020-07-03 14:21:27 +00:00
Moonchild 98752af133 Issue #618 - Add clarifying code comments. 2020-07-01 21:12:49 +00:00
Moonchild ec10b65dde Issue #618 - Check for failed instantiation when starting to fetch dependencies
If instantiation has failed, then also fail the load and don't fetch imports.
Ref BZ: 1358882
2020-07-01 21:12:16 +00:00
Moonchild 9056191e67 Issue #1603 - Part 2: Split some classes out of ScriptLoader.cpp
This splits ScriptLoader up the same way Mozilla did with the exception of
ScriptRequest due to the fact that ScriptLoader and ScriptRequest are
interdependent and would create a circular dependency if split apart when not
using unified building.
2020-07-01 10:15:24 +00:00
Moonchild c45b7ee3a9 Issue #1603 - Part 1: Reorganize ScriptLoader/ScriptElement
- Moves scripting parts of DOM into 'dom/script'
- Renames nsScript{Loader/Element} to Script{Loader/Element}
- Adjusts all callers
2020-06-30 11:51:11 +00:00