Skip to content

Commit 12fc79f

Browse files
lukewarlowlozy219
authored andcommitted
Editorial: export Element's innerText getter and setter steps
These will be used by Trusted Types (and eventually HTML once upstreamed) as part of shadowing this attribute to HTMLScriptElement.
1 parent 6995585 commit 12fc79f

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

source

+21-15
Original file line numberDiff line numberDiff line change
@@ -14310,14 +14310,13 @@ interface <dfn interface>DOMStringMap</dfn> {
1431014310

1431114311
<div w-nodev>
1431214312

14313-
<p>The <dfn attribute for="HTMLElement"><code data-x="dom-innerText">innerText</code></dfn> and
14314-
<dfn attribute for="HTMLElement"><code data-x="dom-outerText">outerText</code></dfn> getter steps
14315-
are:</p>
14313+
<p>The <dfn export>get the text steps</dfn>, given an <span>HTMLElement</span>
14314+
<var>element</var>, are:</p>
1431614315

1431714316
<ol>
1431814317
<li>
14319-
<p>If <span>this</span> is not <span>being rendered</span> or if the user agent is a non-CSS
14320-
user agent, then return <span>this</span>'s <span>descendant text content</span>.</p>
14318+
<p>If <var>element</var> is not <span>being rendered</span> or if the user agent is a non-CSS
14319+
user agent, then return <var>element</var>'s <span>descendant text content</span>.</p>
1432114320

1432214321
<p class="note">This step can produce surprising results, as when the <code
1432314322
data-x="dom-innerText">innerText</code> getter is invoked on an element not <span>being
@@ -14329,13 +14328,12 @@ interface <dfn interface>DOMStringMap</dfn> {
1432914328
<li><p>Let <var>results</var> be a new empty <span>list</span>.</p></li>
1433014329

1433114330
<li>
14332-
<p>For each child node <var>node</var> of <span>this</span>:</p>
14331+
<p>For each child node <var>node</var> of <var>element</var>:</p>
1433314332

1433414333
<ol>
14335-
<li><p>Let <var>current</var> be the <span>list</span> resulting in running the
14336-
<span>rendered text collection steps</span> with <var>node</var>. Each item in
14337-
<var>results</var> will either be a <span>string</span> or a positive integer (a <i>required
14338-
line break count</i>).</p>
14334+
<li><p>Let <var>current</var> be the <span>list</span> resulting in running the <span>rendered
14335+
text collection steps</span> with <var>node</var>. Each item in <var>results</var> will either
14336+
be a <span>string</span> or a positive integer (a <i>required line break count</i>).</p>
1433914337

1434014338
<p class="note">Intuitively, a <i>required line break count</i> item means that a certain
1434114339
number of line breaks appear at that point, but they can be collapsed with the line breaks
@@ -14360,6 +14358,10 @@ interface <dfn interface>DOMStringMap</dfn> {
1436014358
<li><p>Return the concatenation of the string items in <var>results</var>.</p></li>
1436114359
</ol>
1436214360

14361+
<p>The <dfn attribute for="HTMLElement"><code data-x="dom-innerText">innerText</code></dfn> and
14362+
<dfn attribute for="HTMLElement"><code data-x="dom-outerText">outerText</code></dfn> getter steps
14363+
are to return the result of running <span>get the text steps</span> with <span>this</span>.</p>
14364+
1436314365
<p>The <dfn>rendered text collection steps</dfn>, given a <span>node</span> <var>node</var>,
1436414366
are as follows:</p>
1436514367

@@ -14446,16 +14448,20 @@ interface <dfn interface>DOMStringMap</dfn> {
1444614448

1444714449
<hr>
1444814450

14449-
<p>The <code data-x="dom-innerText">innerText</code> setter steps are:</p>
14451+
<p>The <dfn export>set the inner text steps</dfn>, given an <span>HTMLElement</span>
14452+
<var>element</var>, and a string <var>value</var> are:</p>
1445014453

1445114454
<ol>
14452-
<li><p>Let <var>fragment</var> be the <span>rendered text fragment</span> for the given value
14453-
given <span>this</span>'s <span>node document</span>.</p></li>
14455+
<li><p>Let <var>fragment</var> be the <span>rendered text fragment</span> for <var>value</var>
14456+
given <var>element</var>'s <span>node document</span>.</p></li>
1445414457

14455-
<li><p><span data-x="concept-node-replace-all">Replace all</span> with <var>fragment</var> within
14456-
<span>this</span>.</p></li>
14458+
<li><p><span data-x="concept-node-replace-all">Replace all</span> with <var>fragment</var>
14459+
within <var>element</var>.</p></li>
1445714460
</ol>
1445814461

14462+
<p>The <code data-x="dom-innerText">innerText</code> setter steps are to run <span>set the inner
14463+
text steps</span>.</p>
14464+
1445914465
<p>The <code data-x="dom-outerText">outerText</code> setter steps are:</p>
1446014466

1446114467
<ol>

0 commit comments

Comments
 (0)