Implement element.innerText getter

This commit is contained in:
Fernando Jiménez Moreno 2018-01-09 13:27:32 +01:00
parent 0d7c2271c2
commit 2a4535f43e
16 changed files with 844 additions and 16 deletions

View file

@ -73,6 +73,8 @@ skip: true
skip: false
[html]
skip: false
[innerText]
skip: false
[js]
skip: false
[navigation-timing]

View file

@ -563352,7 +563352,7 @@
"support"
],
"innerText/getter.html": [
"644b5b18359d26db9cd4d037b075ca016e2337b5",
"28fc321d84fac1173da328bdfb65b052000fcb4d",
"testharness"
],
"innerText/multiple-text-nodes.window.js": [

View file

@ -8268,9 +8268,6 @@
[Document interface: document.implementation.createDocument(null, "", null) must inherit property "onmousewheel" with the proper type (130)]
expected: FAIL
[HTMLElement interface: attribute innerText]
expected: FAIL
[HTMLElement interface: document.createElement("noscript") must inherit property "contextMenu" with the proper type (14)]
expected: FAIL
@ -10689,9 +10686,6 @@
[HTMLElement interface: document.createElement("noscript") must inherit property "spellcheck" with the proper type]
expected: FAIL
[HTMLElement interface: document.createElement("noscript") must inherit property "innerText" with the proper type]
expected: FAIL
[HTMLElement interface: document.createElement("noscript") must inherit property "onauxclick" with the proper type]
expected: FAIL

View file

@ -0,0 +1,241 @@
[getter.html]
[Trailing whitespace before hard line break removed ("<div>abc <br>def")]
expected: FAIL
[Whitespace collapses across element boundaries ("<div><span>abc </span> def")]
expected: FAIL
[Whitespace collapses across element boundaries ("<div><span>abc </span><span></span> def")]
expected: FAIL
[Whitespace collapses across element boundaries ("<div><span>abc </span><span style='white-space:pre'></span> def")]
expected: FAIL
[Soft line breaks ignored ("<div style='width:0'>abc def")]
expected: FAIL
[::first-line styles applied ("<div class='first-line-uppercase' style='width:0'>abc def")]
expected: FAIL
[::first-letter styles applied ("<div class='first-letter-uppercase' style='width:0'>abc def")]
expected: FAIL
[::first-letter float ignored ("<div class='first-letter-float' style='width:0'>abc def")]
expected: FAIL
[non-display-none child of svg ("<div id='target'>abc")]
expected: FAIL
[visibility:hidden child not rendered ("<div>123<span style='visibility:hidden'>abc")]
expected: FAIL
[visibility:visible child rendered ("<div style='visibility:hidden'>123<span style='visibility:visible'>abc")]
expected: FAIL
[visibility:collapse row-group with visible cell ("<table><tbody style='visibility:collapse'><tr><td style='visibility:visible'>abc")]
expected: FAIL
[visibility:collapse row with visible cell ("<table><tr style='visibility:collapse'><td style='visibility:visible'>abc")]
expected: FAIL
[visibility:collapse honored on flex item ("<div style='display:flex'><span style='visibility:collapse'>1</span><span>2</span></div>")]
expected: FAIL
[visibility:collapse honored on grid item ("<div style='display:grid'><span style='visibility:collapse'>1</span><span>2</span></div>")]
expected: FAIL
[opacity:0 child rendered ("<div>123<span style='opacity:0'>abc")]
expected: FAIL
[<audio> contents ignored ("<audio style='display:block'><source id='target' class='poke' style='display:block'>")]
expected: FAIL
[<video> contents ignored ("<video style='display:block'><source id='target' class='poke' style='display:block'>")]
expected: FAIL
[<select size='1'> contents of options preserved ("<select size='1'><option>abc</option><option>def")]
expected: FAIL
[<select size='2'> contents of options preserved ("<select size='2'><option>abc</option><option>def")]
expected: FAIL
[empty <select> ("<div>a<select></select>bc")]
expected: FAIL
[<optgroup> containing <option> ("<select><optgroup><option>abc</select>")]
expected: FAIL
[<div> in <option> ("<select><option class='poke-div'>123</select>")]
expected: FAIL
[empty <optgroup> in <div> ("<div>a<optgroup></optgroup>bc")]
expected: FAIL
[<optgroup> in <div> ("<div>a<optgroup>123</optgroup>bc")]
expected: FAIL
[empty <option> in <div> ("<div>a<option></option>bc")]
expected: FAIL
[<option> in <div> ("<div>a<option>123</option>bc")]
expected: FAIL
[<select size='1'> contents of options preserved ("<div><select size='1'><option>abc</option><option>def")]
expected: FAIL
[<select size='2'> contents of options preserved ("<div><select size='2'><option>abc</option><option>def")]
expected: FAIL
[Blank lines between <p>s separated by non-empty block ("<div><p>abc</p><div>123</div><p>def")]
expected: FAIL
[Blank lines around a <p> in its own block ("<div>abc<div><p>123</p></div>def")]
expected: FAIL
[Blank line after <p> ("<div><p>abc</p>def")]
expected: FAIL
[No newlines at display:inline-block boundary ("<div>123<span style='display:inline-block'>abc</span>def")]
expected: FAIL
[Leading/trailing space removal at display:inline-block boundary ("<div>123<span style='display:inline-block'> abc </span>def")]
expected: FAIL
[Blank lines around <p> even without margin ("<div>123<p style='margin:0px'>abc</p>def")]
expected: FAIL
[<span> boundaries are irrelevant ("<div>123<span>abc</span>def")]
expected: FAIL
[<span> boundaries are irrelevant ("<div>123 <span>abc</span> def")]
expected: FAIL
[<span> boundaries are irrelevant ("<div style='width:0'>123 <span>abc</span> def")]
expected: FAIL
[<em> gets no special treatment ("<div>123<em>abc</em>def")]
expected: FAIL
[<b> gets no special treatment ("<div>123<b>abc</b>def")]
expected: FAIL
[<i> gets no special treatment ("<div>123<i>abc</i>def")]
expected: FAIL
[<strong> gets no special treatment ("<div>123<strong>abc</strong>def")]
expected: FAIL
[<tt> gets no special treatment ("<div>123<tt>abc</tt>def")]
expected: FAIL
[<code> gets no special treatment ("<div>123<code>abc</code>def")]
expected: FAIL
[soft hyphen preserved ("<div style='width:0'>abc&shy;def")]
expected: FAIL
[Ignoring non-rendered table whitespace ("<div><table style='white-space:pre'> <td>abc</td> </table>")]
expected: FAIL
[Tab-separated table cells ("<div><table><tr><td>abc<td>def</table>")]
expected: FAIL
[Tab-separated table cells including empty cells ("<div><table><tr><td>abc<td><td>def</table>")]
expected: FAIL
[Tab-separated table cells including trailing empty cells ("<div><table><tr><td>abc<td><td></table>")]
expected: FAIL
[Newline-separated table rows ("<div><table><tr><td>abc<tr><td>def</table>")]
expected: FAIL
[Newlines around table ("<div>abc<table><td>def</table>ghi")]
expected: FAIL
[Tab-separated table cells in a border-collapse table ("<div><table style='border-collapse:collapse'><tr><td>abc<td>def</table>")]
expected: FAIL
[ ("<table><tfoot><tr><td>footer</tfoot><thead><tr><td style='visibility:collapse'>thead</thead><tbody><tr><td>tbody</tbody></table>")]
expected: FAIL
[Newline between cells and caption ("<div><table><tr><td>abc<caption>def</caption></table>")]
expected: FAIL
[Tab-separated table cells ("<div><div class='table'><span class='cell'>abc</span>\\n<span class='cell'>def</span></div>")]
expected: FAIL
[Newline-separated table rows ("<div><div class='table'><span class='row'><span class='cell'>abc</span></span>\\n<span class='row'><span class='cell'>def</span></span></div>")]
expected: FAIL
[Newlines around table ("<div>abc<div class='table'><span class='cell'>def</span></div>ghi")]
expected: FAIL
[Tab-separated table cells ("<div><div class='itable'><span class='cell'>abc</span>\\n<span class='cell'>def</span></div>")]
expected: FAIL
[Newline-separated table rows ("<div><div class='itable'><span class='row'><span class='cell'>abc</span></span>\\n<span class='row'><span class='cell'>def</span></span></div>")]
expected: FAIL
[No newlines around inline-table ("<div>abc<div class='itable'><span class='cell'>def</span></div>ghi")]
expected: FAIL
[Single newline in two-row inline-table ("<div>abc<div class='itable'><span class='row'><span class='cell'>def</span></span>\\n<span class='row'><span class='cell'>123</span></span></div>ghi")]
expected: FAIL
[<br> induces line break ("<div>abc<br>def")]
expected: FAIL
[<br> induces line break even at end of block ("<div>abc<br>")]
expected: FAIL
[<br> content ignored ("<div><br class='poke'>")]
expected: FAIL
[text-transform handles Turkish casing ("<div><div lang='tr' style='text-transform:uppercase'>i ı")]
expected: FAIL
[block-in-inline doesn't add unnecessary newlines ("<div>abc<span>123<div>456</div>789</span>def")]
expected: FAIL
[position:absolute induces a block boundary ("<div>abc<div style='position:absolute'>123</div>def")]
expected: FAIL
[position:relative has no effect ("<div>abc<span style='position:relative'>123</span>def")]
expected: FAIL
[text-overflow:ellipsis ignored ("<div style='width:0; overflow:hidden; text-overflow:ellipsis'>abc")]
expected: FAIL
[<rt> and no <rp> ("<div><ruby>abc<rt>def</rt></ruby>")]
expected: FAIL
[<rp> ("<div><ruby>abc<rp>(</rp><rt>def</rt><rp>)</rp></ruby>")]
expected: FAIL
[visibility:collapse row-group ("<table><tbody style='visibility:collapse'><tr><td>abc")]
expected: FAIL
[visibility:collapse row ("<table><tr style='visibility:collapse'><td>abc")]
expected: FAIL
[visibility:collapse cell ("<table><tr><td style='visibility:collapse'>abc")]
expected: FAIL
[<audio> contents ignored ("<audio style='display:block'>abc")]
expected: FAIL
[<video> contents ignored ("<video>abc")]
expected: FAIL
[<select> containing text node child ("<select class='poke'></select>")]
expected: FAIL
[<optgroup> containing <optgroup> ("<select><optgroup class='poke-optgroup'></select>")]
expected: FAIL
[<audio> contents ignored ("<div><audio>abc")]
expected: FAIL
[<video> contents ignored ("<div><video>abc")]
expected: FAIL

View file

@ -0,0 +1,367 @@
[setter.html]
[Simplest possible test]
expected: FAIL
[Simplest possible test, detached]
expected: FAIL
[Newlines convert to <br> in non-white-space:pre elements]
expected: FAIL
[Newlines convert to <br> in non-white-space:pre elements, detached]
expected: FAIL
[Newlines convert to <br> in <pre> element]
expected: FAIL
[Newlines convert to <br> in <pre> element, detached]
expected: FAIL
[Newlines convert to <br> in <textarea> element]
expected: FAIL
[Newlines convert to <br> in <textarea> element, detached]
expected: FAIL
[Newlines convert to <br> in white-space:pre element]
expected: FAIL
[Newlines convert to <br> in white-space:pre element, detached]
expected: FAIL
[CRs convert to <br> in non-white-space:pre elements]
expected: FAIL
[CRs convert to <br> in non-white-space:pre elements, detached]
expected: FAIL
[CRs convert to <br> in <pre> element]
expected: FAIL
[CRs convert to <br> in <pre> element, detached]
expected: FAIL
[Newline/CR pair converts to <br> in non-white-space:pre element]
expected: FAIL
[Newline/CR pair converts to <br> in non-white-space:pre element, detached]
expected: FAIL
[Newline/newline pair converts to two <br>s in non-white-space:pre element]
expected: FAIL
[Newline/newline pair converts to two <br>s in non-white-space:pre element, detached]
expected: FAIL
[CR/CR pair converts to two <br>s in non-white-space:pre element]
expected: FAIL
[CR/CR pair converts to two <br>s in non-white-space:pre element, detached]
expected: FAIL
[CRs convert to <br> in white-space:pre element]
expected: FAIL
[CRs convert to <br> in white-space:pre element, detached]
expected: FAIL
[< preserved]
expected: FAIL
[< preserved, detached]
expected: FAIL
[> preserved]
expected: FAIL
[> preserved, detached]
expected: FAIL
[& preserved]
expected: FAIL
[& preserved, detached]
expected: FAIL
[" preserved]
expected: FAIL
[" preserved, detached]
expected: FAIL
[' preserved]
expected: FAIL
[' preserved, detached]
expected: FAIL
[innerText not supported on SVG elements]
expected: FAIL
[innerText not supported on MathML elements]
expected: FAIL
[Null characters preserved]
expected: FAIL
[Null characters preserved, detached]
expected: FAIL
[Tabs preserved]
expected: FAIL
[Tabs preserved, detached]
expected: FAIL
[Leading whitespace preserved]
expected: FAIL
[Leading whitespace preserved, detached]
expected: FAIL
[Trailing whitespace preserved]
expected: FAIL
[Trailing whitespace preserved, detached]
expected: FAIL
[Whitespace not compressed]
expected: FAIL
[Whitespace not compressed, detached]
expected: FAIL
[Existing text deleted]
expected: FAIL
[Existing text deleted, detached]
expected: FAIL
[Existing <br> deleted]
expected: FAIL
[Existing <br> deleted, detached]
expected: FAIL
[Assigning the empty string]
expected: FAIL
[Assigning null]
expected: FAIL
[Assigning undefined]
expected: FAIL
[Assigning undefined, detached]
expected: FAIL
[Start with CR]
expected: FAIL
[Start with CR, detached]
expected: FAIL
[Start with LF]
expected: FAIL
[Start with LF, detached]
expected: FAIL
[Start with CRLF]
expected: FAIL
[Start with CRLF, detached]
expected: FAIL
[End with CR]
expected: FAIL
[End with CR, detached]
expected: FAIL
[End with LF]
expected: FAIL
[End with LF, detached]
expected: FAIL
[End with CRLF]
expected: FAIL
[End with CRLF, detached]
expected: FAIL
[innerText on <area> element]
expected: FAIL
[innerText on <area> element, detached]
expected: FAIL
[innerText on <base> element]
expected: FAIL
[innerText on <base> element, detached]
expected: FAIL
[innerText on <basefont> element]
expected: FAIL
[innerText on <basefont> element, detached]
expected: FAIL
[innerText on <bgsound> element]
expected: FAIL
[innerText on <bgsound> element, detached]
expected: FAIL
[innerText on <br> element]
expected: FAIL
[innerText on <br> element, detached]
expected: FAIL
[innerText on <col> element]
expected: FAIL
[innerText on <col> element, detached]
expected: FAIL
[innerText on <embed> element]
expected: FAIL
[innerText on <embed> element, detached]
expected: FAIL
[innerText on <frame> element]
expected: FAIL
[innerText on <frame> element, detached]
expected: FAIL
[innerText on <hr> element]
expected: FAIL
[innerText on <hr> element, detached]
expected: FAIL
[innerText on <image> element]
expected: FAIL
[innerText on <image> element, detached]
expected: FAIL
[innerText on <img> element]
expected: FAIL
[innerText on <img> element, detached]
expected: FAIL
[innerText on <input> element]
expected: FAIL
[innerText on <input> element, detached]
expected: FAIL
[innerText on <keygen> element]
expected: FAIL
[innerText on <keygen> element, detached]
expected: FAIL
[innerText on <link> element]
expected: FAIL
[innerText on <link> element, detached]
expected: FAIL
[innerText on <menuitem> element]
expected: FAIL
[innerText on <menuitem> element, detached]
expected: FAIL
[innerText on <meta> element]
expected: FAIL
[innerText on <meta> element, detached]
expected: FAIL
[innerText on <param> element]
expected: FAIL
[innerText on <param> element, detached]
expected: FAIL
[innerText on <source> element]
expected: FAIL
[innerText on <source> element, detached]
expected: FAIL
[innerText on <track> element]
expected: FAIL
[innerText on <track> element, detached]
expected: FAIL
[innerText on <wbr> element]
expected: FAIL
[innerText on <wbr> element, detached]
expected: FAIL
[innerText on <colgroup> element]
expected: FAIL
[innerText on <colgroup> element, detached]
expected: FAIL
[innerText on <frameset> element]
expected: FAIL
[innerText on <frameset> element, detached]
expected: FAIL
[innerText on <head> element]
expected: FAIL
[innerText on <head> element, detached]
expected: FAIL
[innerText on <html> element]
expected: FAIL
[innerText on <html> element, detached]
expected: FAIL
[innerText on <table> element]
expected: FAIL
[innerText on <table> element, detached]
expected: FAIL
[innerText on <tbody> element]
expected: FAIL
[innerText on <tbody> element, detached]
expected: FAIL
[innerText on <tfoot> element]
expected: FAIL
[innerText on <tfoot> element, detached]
expected: FAIL
[innerText on <thead> element]
expected: FAIL
[innerText on <thead> element, detached]
expected: FAIL
[innerText on <tr> element]
expected: FAIL
[innerText on <tr> element, detached]
expected: FAIL

View file

@ -15,6 +15,8 @@
<div id="container"></div>
<svg id="svgContainer"></svg>
<script>
let container = document.querySelector('#container');
let svgContainer = document.querySelector('#svgContainer');
function testText(html, expectedPlain, msg) {
textTextInContainer(container, html, expectedPlain, msg);
}