Skip to content

Commit

Permalink
Make <select> special in innerText
Browse files Browse the repository at this point in the history
<select> is a replaced element, but for Web compat we need
to include the text of <option> elements in innerText.
The new text is intended to match the behavior of Gecko,
which in turn is very close to the legacy IE/Edge behavior.

Fixes rocallahan/innerText-spec#5.
  • Loading branch information
zcorpan authored and Alice Boxhall committed Jan 7, 2019
1 parent 8410517 commit 074f75d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -11868,7 +11868,21 @@ interface <dfn>DOMStringMap</dfn> {

<li>
<p>If <var>node</var> has no associated CSS box, then let the result of these substeps be
<var>items</var> and abort these substeps.</p>
<var>items</var> and abort these substeps. For the purpose of this step, the following
elements must act as described if the <span>computed value</span> of the
<span>'display'</span> property is not 'none':</p>

<ul class="brief">
<li><code>select</code> elements have an associated non-replaced inline CSS box whose child
boxes include only those of <code>optgroup</code> and <code>option</code> element child
nodes;</li>

<li><code>optgroup</code> elements have an associated non-replaced block-level CSS box whose
child boxes include only those of <code>option</code> element child nodes; and</li>

<li><code>option</code> element have an associated non-replaced block-level CSS box whose
child boxes are as normal for non-replaced block-level CSS boxes.</li>
</ul>

<p class="note"><var>items</var> can be non-empty due to 'display:contents'.</p>
</li>
Expand Down Expand Up @@ -11924,7 +11938,7 @@ interface <dfn>DOMStringMap</dfn> {
</ol>

<p class="note">Note that descendant nodes of most replaced elements (e.g., <code>textarea</code>,
<code>select</code>, and <code>video</code> &mdash; but not <code>button</code>) are not rendered
<code>input</code>, and <code>video</code> &mdash; but not <code>button</code>) are not rendered
by CSS, strictly speaking, and therefore have no CSS boxes for the purposes of this algorithm.</p>

<p class="big-issue">This algorithm is amenable to being generalized to work on <span
Expand Down Expand Up @@ -119427,6 +119441,7 @@ INSERT INTERFACES HERE
Jerry Smith,
Jesse Ren&eacute;e Beach,
Jessica Jong,
jfkthame, <!-- GitHub -->
Jian Li,
Jim Jewett,
Jim Ley,
Expand Down

0 comments on commit 074f75d

Please sign in to comment.