Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Node/textContent getter and setter steps #1271

Merged
merged 1 commit into from
Apr 3, 2024
Merged
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
29 changes: 17 additions & 12 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4286,24 +4286,27 @@ empty string instead, and then do as described below, switching on the interface
<dd><p>Do nothing.
</dl>

<p>The <dfn attribute for=Node><code>textContent</code></dfn> getter steps are to return the
following, switching on the interface <a>this</a> <a>implements</a>:
<p>To <dfn export>get text content</dfn> with a <a for=/>node</a> <var>node</var>,
return the following, switching on the interface <var>node</var> <a>implements</a>:

<dl class=switch>
<dt>{{DocumentFragment}}
<dt>{{Element}}
<dd>The <a>descendant text content</a> of <a>this</a>.
<dd>The <a>descendant text content</a> of <var>node</var>.

<dt>{{Attr}}
<dd><a>this</a>'s <a for=Attr>value</a>.
<dd><var>node</var>'s <a for=Attr>value</a>.

<dt>{{CharacterData}}
<dd><a>this</a>'s <a for=CharacterData>data</a>.
<dd><var>node</var>'s <a for=CharacterData>data</a>.

<dt>Otherwise
<dd>Null.
</dl>

<p>The <dfn attribute for=Node><code>textContent</code></dfn> getter steps are to
return the result of running <a>get text content</a> with <a>this</a>.

<p>To <dfn export>string replace all</dfn> with a string <var>string</var> within a
<a for=/>node</a> <var>parent</var>, run these steps:

Expand All @@ -4317,26 +4320,28 @@ following, switching on the interface <a>this</a> <a>implements</a>:
<li><p><a for=Node>Replace all</a> with <var>node</var> within <var>parent</var>.
</ol>

<p>The {{Node/textContent}} setter steps are to, if the given value is null, act as if it was the
empty string instead, and then do as described below, switching on the interface <a>this</a>
<a>implements</a>:
<p>To <dfn export>set text content</dfn> with a <a for=/>node</a> <var>node</var> and a string <var>value</var>,
do as defined below, switching on the interface <var>node</var> <a>implements</a>:

<dl class=switch>
<dt>{{DocumentFragment}}
<dt>{{Element}}
<dd><p><a>String replace all</a> with the given value within <a>this</a>.
<dd><p><a>String replace all</a> with <var>value</var> within <var>node</var>.

<dt>{{Attr}}
<dd><p><a>Set an existing attribute value</a> with <a>this</a> and the given value.
<dd><p><a>Set an existing attribute value</a> with <var>node</var> and <var>value</var>.

<dt>{{CharacterData}}
<dd><p><a>Replace data</a> with node <a>this</a>, offset 0, count <a>this</a>'s
<a for=Node>length</a>, and data the given value.
<dd><p><a>Replace data</a> with node <var>node</var>, offset 0, count <var>node</var>'s
<a for=Node>length</a>, and data <var>value</var>.

<dt>Otherwise
<dd><p>Do nothing.
</dl>

<p>The {{Node/textContent}} setter steps are to, if the given value is null, act as if it was the
empty string instead, and then run <a>set text content</a> with <a>this</a> and the given value.

<hr>

<dl class=domintro>
Expand Down
Loading