Skip to content

Commit efd0635

Browse files
committed
Add script text associated data to SVGScriptElement.
1 parent 92390d1 commit efd0635

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

spec/index.bs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,8 @@ Given a {{TrustedType}} type (|expectedType|), a [=realm/global object=] (|globa
10681068

10691069
Given an {{HTMLScriptElement}} (|script|), this algorithm performs the following steps:
10701070

1071-
1. If |script|'s [=script text=] value is not equal to its [=child text content=],
1072-
set |script|'s [=script text=] to the result of executing [$Get Trusted Type compliant string$], with the following arguments:
1071+
1. If |script|'s [=HTMLScriptElement/script text=] value is not equal to its [=child text content=],
1072+
set |script|'s [=HTMLScriptElement/script text=] to the result of executing [$Get Trusted Type compliant string$], with the following arguments:
10731073
* {{TrustedScriptURL}} as |expectedType|,
10741074
* |script|'s {{Document}}'s [=relevant global object=] as |global|,
10751075
* |script|'s [=child text content=] attribute value,
@@ -1175,14 +1175,24 @@ This document modifies {{HTMLScriptElement}}s. Each script has:
11751175
through a compliant sink. Equivalent to script's
11761176
[=child text content=]. Initially an empty string.
11771177

1178+
This document also modifies {{SVGScriptElement}}s. Each script has:
1179+
1180+
: an associated string <dfn export for="SVGScriptElement">script text</dfn>.
1181+
:: A string, containing the body of the script to execute that was set
1182+
through a compliant sink. Equivalent to script's
1183+
[=child text content=]. Initially an empty string.
1184+
1185+
Issue: There's currently no defined processing model for {{SVGScriptElement}}s. This spec assumes one that is similar to that of {{HTMLScriptElement}}'s model.
1186+
Use [=SVGScriptElement/script text=] in the same way you would use [=HTMLScriptElement/script text=].
1187+
11781188
#### The {{HTMLScriptElement/innerText}} IDL attribute #### {#the-innerText-idl-attribute}
11791189

11801190
The {{HTMLScriptElement/innerText}} setter steps are:
11811191

11821192
1. Let |value| be the result of calling [$Get Trusted Type compliant string$] with
11831193
{{TrustedScript}}, [=this=]'s [=relevant global object=], the given value, `HTMLScriptElement innerText`, and
11841194
`script`.
1185-
1. Set [=this=]'s [=script text=] value to |value|.
1195+
1. Set [=this=]'s [=HTMLScriptElement/script text=] value to |value|.
11861196
1. Run [=set the inner text steps=] with [=this=] and |value|.
11871197

11881198
The {{HTMLScriptElement/innerText}} getter steps are:
@@ -1197,7 +1207,7 @@ empty string instead, and then do as described below:
11971207
1. Let |value| be the result of calling [$Get Trusted Type compliant string$] with
11981208
{{TrustedScript}}, [=this=]'s [=relevant global object=], the given value, `HTMLScriptElement textContent`, and
11991209
`script`.
1200-
1. Set [=this=]'s [=script text=] value to |value|.
1210+
1. Set [=this=]'s [=HTMLScriptElement/script text=] value to |value|.
12011211
1. Run [=set text content=] with [=this=] and |value|.
12021212

12031213
The {{HTMLScriptElement/textContent}} getter steps are:
@@ -1211,7 +1221,7 @@ Update the {{HTMLScriptElement/text}} setter steps algorithm as follows.
12111221
1. <ins>Let |value| be the result of calling [$Get Trusted Type compliant string$] with
12121222
{{TrustedScript}}, [=this=]'s [=relevant global object=], the given value, `HTMLScriptElement text`, and
12131223
`script`.</ins>
1214-
1. <ins>Set [=this=]'s [=script text=] value to the given value.</ins>
1224+
1. <ins>Set [=this=]'s [=HTMLScriptElement/script text=] value to the given value.</ins>
12151225
1. [=String replace all=] with the given value within [=this=].
12161226

12171227

@@ -1244,7 +1254,7 @@ The first few steps of the [=prepare the script element=] algorithm are modified
12441254
run when the parser tries to run it, but it is later executed after a script dynamically
12451255
updates it, it will execute in an async fashion even if the <code id=script-processing-model:attr-script-async-5><a href=https://html.spec.whatwg.org/#attr-script-async>async</a></code> attribute isn't set.</p>
12461256
<li><ins><p>Execute the [$Prepare the script text$] algorithm on <var>el</var>. If that algorithm threw an error, then return.</p></ins></li>
1247-
<li><p>Let <var ignore="">source text</var> be <var>el</var>'s <del><a id=script-processing-model:child-text-content href=https://dom.spec.whatwg.org/#concept-child-text-content data-x-internal=child-text-content>child text content</a>.</del> <ins>[=script text=] value.</ins>
1257+
<li><p>Let <var ignore="">source text</var> be <var>el</var>'s <del><a id=script-processing-model:child-text-content href=https://dom.spec.whatwg.org/#concept-child-text-content data-x-internal=child-text-content>child text content</a>.</del> <ins>[=HTMLScriptElement/script text=] value.</ins>
12481258
<li>...
12491259
</ol>
12501260

0 commit comments

Comments
 (0)