Skip to content

Commit 45effb6

Browse files
committed
Make innerText getter not run the algorithm on the element itself
It was specified more like "outerText" -- a tab character would be prepended when getting td.innerText, and br.innerText would return a newline. This did not match any browser, and when Chromium implemented the spec it was found to break some web content. Tests: web-platform-tests/wpt#13743 Fixes #4119
1 parent e3f1cc8 commit 45effb6

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

source

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12595,14 +12595,25 @@ interface <dfn>DOMStringMap</dfn> {
1259512595
their text contents ignored.</p>
1259612596
</li>
1259712597

12598+
<li><p>Let <var>results</var> be a new empty <span>list</span>.</p></li>
12599+
1259812600
<li>
12599-
<p>Let <var>results</var> be the <span>list</span> resulting in running the <span>inner text
12600-
collection steps</span> with this element. Each item in <var>results</var> will either be a
12601-
<span>JavaScript string</span> or a positive integer (a <i>required line break count</i>).</p>
12601+
<p>For each child node <var>node</var> of this element:</p>
12602+
12603+
<ol>
12604+
<li><p>Let <var>current</var> be the <span>list</span> resulting in running the <span>inner
12605+
text collection steps</span> with <var>node</var>. Each item in <var>results</var> will either
12606+
be a <span>JavaScript string</span> or a positive integer (a <i>required line break
12607+
count</i>).</p>
1260212608

12603-
<p class="note">Intuitively, a <i>required line break count</i> item means that a certain number
12604-
of line breaks appear at that point, but they can be collapsed with the line breaks induced by
12605-
adjacent <i>required line break count</i> items, reminiscent to CSS margin-collapsing.</p>
12609+
<p class="note">Intuitively, a <i>required line break count</i> item means that a certain
12610+
number of line breaks appear at that point, but they can be collapsed with the line breaks
12611+
induced by adjacent <i>required line break count</i> items, reminiscent to CSS
12612+
margin-collapsing.</p>
12613+
12614+
<li><p>For each item <var>item</var> in <var>current</var>, append <var>item</var> to
12615+
<var>results</var>.</p></li>
12616+
</ol>
1260612617
</li>
1260712618

1260812619
<li><p><span data-x="list remove">Remove</span> any items from <var>results</var> that are the

0 commit comments

Comments
 (0)