Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -117337,14 +117337,18 @@ document.querySelector("button").addEventListener("click", bound);
<li><p>Set <var>script</var>'s <span data-x="concept-script-settings-object">settings
object</span> to <var>settings</var>.</p></li>

<li><p>Let <var>baseUrl</var> be <var>script</var>'s <span data-x="concept-script-base-url">base
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure script's baseURL is valid here -- we just created script in the first step of this algorithm and haven't initialized that field yet.

I see that other "create a module script" algos take the baseURL as a parameter, e.g. see create a javascript module script. It looks to me like "create a CSS module script" also needs that parameter. We'd pass in the "response's URL" as the baseURL here in the same way as is done for WASM module scripts and JS module scripts nearby.

It's a little more plumbing than I thought it'd be in #11629 (comment) but I hadn't realized at the time that the CSS module script's baseURL just gets set to null.

URL</span>.

<li><p>Set <var>script</var>'s <span data-x="concept-script-base-url">base URL</span> and
<span data-x="concept-script-script-fetch-options">fetch options</span> to null.</p></li>

<li><p>Set <var>script</var>'s <span data-x="concept-script-parse-error">parse error</span> and
<span data-x="concept-script-error-to-rethrow">error to rethrow</span> to null.</p></li>

<li><p>Let <var>sheet</var> be the result of running the steps to <span>create a constructed
<code>CSSStyleSheet</code></span> with an empty dictionary as the argument.</p></li>
<code>CSSStyleSheet</code></span> with: «[
"<code data-x="">baseUrl</code>" → <var>baseUrl</var> ]».</p></li>

<li>
<p>Run the steps to <span>synchronously replace the rules of a <code>CSSStyleSheet</code></span>
Expand Down