Skip to content

Commit

Permalink
use img alt text in label and text
Browse files Browse the repository at this point in the history
  • Loading branch information
josepharhar committed Jan 2, 2025
1 parent b44ec20 commit e85aaab
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -54564,8 +54564,8 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
<p>The <dfn element-attr for="option"><code data-x="attr-option-value">value</code></dfn>
attribute provides a value for element. The <dfn data-x="concept-option-value">value</dfn> of an
<code>option</code> element is the value of the <code data-x="attr-option-value">value</code>
content attribute, if there is one, or, if there is not, the value of the element's <code
data-x="dom-option-text">text</code> IDL attribute.</p>
content attribute, if there is one, or, if there is not, the result of <span>collect option
text</span> given <span>this</span> and false.</p>

<p>The <dfn element-attr for="option"><code data-x="attr-option-selected">selected</code></dfn>
attribute is a <span>boolean attribute</span>. It represents the default <span
Expand Down Expand Up @@ -54689,12 +54689,8 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
IDL attribute must return the element's <span data-x="concept-option-index">index</span>.</p>

<p>The <dfn attribute for="HTMLOptionElement"><code data-x="dom-option-text">text</code></dfn> IDL
attribute, on getting, must return the result of <span data-x="strip and collapse ASCII
whitespace">stripping and collapsing ASCII whitespace</span> from the concatenation of <span
data-x="concept-cd-data">data</span> of all the <code>Text</code> node descendants of the
<code>option</code> element, in <span>tree order</span>, excluding any that are descendants of
descendants of the <code>option</code> element that are themselves <code>script</code> or
<span>SVG <code>script</code></span> elements.</p>
attribute, on getting, must return the result of <span>collect option text</span> given
<span>this</span> and true.</p>

<p>The <code data-x="dom-option-text">text</code> attribute's setter must <span>string replace
all</span> with the given value within this element.</p>
Expand Down Expand Up @@ -54742,6 +54738,36 @@ interface <dfn interface>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
<li><p>Return <var>option</var>.</p></li>
</ol>

<p>To <dfn>collect option text</dfn>, given an <code>option</code> element <var>option</var> and a
boolean <var>includeAltText</var>:</p>

<ol>
<li><p>Let <var>text</var> be the empty string.</p></li>

<li>
<p>For each <span>descendant</span> of <var>option</var> in <span>tree order</span>:</p>

<ol>
<li><p>If <var>descendant</var> is a <code>script</code> or <span>SVG
<code>script</code></span> element, then <span>continue</span> skipping all
<span data-x="descendant">>descendants</span> of <var>descendant</var>.</p></li>

<li><p>If <span>descendant</span> is a <code>Text</code> node, then set <var>text</var> to
the concatenation of <var>text</var> and <span>descendant</span>'s <span
data-x="concept-cd-data">data</span>.</p></li>

<li><p>If <span>descendant</span> is an <code>img</code> element and the value of
<span>descendant</span>'s <code data-x="attr-img-alt">alt</code> attribute is not empty, then
set <var>text</var> to the concatenation of <var>text</var>, <code data-x="">" "</code>, the value of
<span>descendant</span>'s <code data-x="attr-img-alt">alt</code> attribute, and <code
data-x="">" "</code>.</p></li>
</ol>
</li>

<li><p>Return the result of <span>strip and collapse ASCII whitespace</span> given
<var>text</var>.</p></li>
</ol>

</div>


Expand Down

0 comments on commit e85aaab

Please sign in to comment.