You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[cssom-1] Refactor CSSStyleSheet constructor and replaceSync to allow steps to be referenced from HTML spec (w3c#6411)
The CSS module scripts feature is being specified in HTML using several algorithms defined in cssom-1 on the CSSStyleSheet interface. In the review of the CSS module scripts HTML spec PR whatwg/html#4898, there was a concern that referencing the CSSStyleSheet methods directly implies that if these methods were overridden by user script, the UA should call the user script instead.
This change pulls the steps for the `CSSStyleSheet` constructor and `replaceSync` method into separate algorithms so that they can be safely referenced from the HTML spec.
When called, execute the steps to <a>create a constructed CSSStyleSheet</a> given <var>options</var> and return the result.
752
+
</dd>
753
+
754
+
<dt>To <dfn export>create a constructed {{/CSSStyleSheet}}</dfn></dt> given {{CSSStyleSheetInit}}<var>options</var>, run these steps:
755
+
<dd>
752
756
<ol>
753
-
<li>Construct a new {{/CSSStyleSheet}} object <var>sheet</var> with the following properties:
754
-
<ul>
755
-
<li><a spec=cssom>location</a> set to the <a spec=html>base URL</a> of the <a>associated Document</a> for the <a>current global object</a>.
756
-
<li><a>stylesheet base URL</a> set to the {{CSSStyleSheetInit/baseURL}} attribute value from <var>options</var>.
757
-
<li>No <a spec=cssom>parent CSS style sheet</a>.
758
-
<li>No <a spec=cssom>owner node</a>.
759
-
<li>No <a spec=cssom>owner CSS rule</a>.
760
-
<li><a spec=cssom>title</a> set to the the empty string.
761
-
<li>Unset <a spec=cssom>alternate flag</a>.
762
-
<li>Set <a spec=cssom>origin-clean flag</a>.
763
-
<li>Set <a>constructed flag</a>.
764
-
<li><a>Constructor document</a> set to the <a>associated Document</a> for the <a>current global object</a>.
765
-
</ul>
757
+
<li>Construct a new {{/CSSStyleSheet}} object <var>sheet</var>.</li>
758
+
<li>Set <var>sheet</var>'s <a spec=cssom>location</a> to the <a spec=html>base URL</a> of the <a>associated Document</a> for the <a>current global object</a>.
759
+
<li>Set <var>sheet</var>'s <a>stylesheet base URL</a> to the {{CSSStyleSheetInit/baseURL}} attribute value from <var>options</var>.
760
+
<li>Set <var>sheet</var>'s <a spec=cssom>parent CSS style sheet</a> to null.
761
+
<li>Set <var>sheet</var>'s <a spec=cssom>owner node</a> to null.
762
+
<li>Set <var>sheet</var>'s <a spec=cssom>owner CSS rule</a> to null.
763
+
<li>Set <var>sheet</var>'s <a spec=cssom>title</a> to the the empty string.
0 commit comments