Skip to content

Commit

Permalink
Merge pull request #639 from w3c/fix/epub-nonvis
Browse files Browse the repository at this point in the history
Update the metadata testing for nonvisual content display
  • Loading branch information
clapierre authored Feb 3, 2025
2 parents f5313c9 + ca32b8d commit 673b817
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 57 deletions.
46 changes: 21 additions & 25 deletions a11y-meta-display-guide/2.0/draft/guidelines/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -751,39 +751,35 @@ <h5>Display statements</h5>
<dt>If all content is readable in text form:</dt>
<dd>
<p data-localization-id="ways-of-reading-nonvisual-reading-readable"
data-localization-mode="compact">Readable in
read aloud or dynamic braille</p>
data-localization-mode="compact">Readable in read aloud or dynamic braille</p>
<p data-localization-id="ways-of-reading-nonvisual-reading-readable"
data-localization-mode="descriptive">All
content can be read as read aloud speech or
dynamic braille</p>
</dd>



<dt>If not all content may be readable in text form:</dt>
<dd>
<p data-localization-id="ways-of-reading-nonvisual-reading-may-not-fully"
data-localization-mode="compact">May not be
fully readable in read aloud or dynamic
braille</p>
<p data-localization-id="ways-of-reading-nonvisual-reading-may-not-fully"
data-localization-mode="descriptive">
Portions of the content may not be readable
as read aloud speech or dynamic braille</p>
data-localization-mode="descriptive">All content can be read as read aloud speech or dynamic braille</p>
</dd>

<dt>If not all content is readable in text form:</dt>
<dd>
<p data-localization-id="ways-of-reading-nonvisual-reading-not-fully"
data-localization-mode="compact">Not
fully readable in read aloud or dynamic
braille</p>
data-localization-mode="compact">Not fully readable in read aloud or dynamic braille</p>
<p data-localization-id="ways-of-reading-nonvisual-reading-not-fully"
data-localization-mode="descriptive">Not all
of the content will be readable as read
aloud speech or dynamic braille</p>
data-localization-mode="descriptive">Not all of the content will be readable as read aloud speech or dynamic braille</p>
</dd>

<dt>If the content cannot be read in text form:</dt>
<dd>
<p data-localization-id="ways-of-reading-nonvisual-reading-none"
data-localization-mode="compact">Not readable in read aloud or dynamic braille</p>
<p data-localization-id="ways-of-reading-nonvisual-reading-none"
data-localization-mode="descriptive">The content is not readable as read aloud speech or dynamic braille</p>
</dd>

<dt>If no metadata is provided:</dt>
<dd>
<p data-localization-id="ways-of-reading-nonvisual-reading-no-metadata"
data-localization-mode="compact">No information about nonvisual reading is available</p>
<p data-localization-id="ways-of-reading-nonvisual-reading-no-metadata"
data-localization-mode="descriptive">No information about nonvisual reading is available</p>
</dd>

<dt>If text alternatives are provided:</dt>
<dd>
<p data-localization-id="ways-of-reading-nonvisual-reading-alt-text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,65 +251,86 @@ <h5>Understanding the variables</h5>
<dl>
<dt><var>all_necessary_content_textual</var></dt>
<dd>
<p>If true it indicates that the <i>accessModeSufficient="textual"</i> (all main content is provided in textual form) is present in the package document, otherwise if false it means that the metadata is not present.</p>
<p><i>All non-decorative content supports reading without sight</i> means that all contents of the digital publication necessary to use and understanding, including text, images (via their alternative descriptions), audio and video material (via their transcripts, descriptions, captions or subtitles) are fully accessible via suitable reading devices, for example text-to-speech screen readers or tactile reading devices (‘Braille displays’), and nothing in the digital publication prevents or blocks the use of alternative reading modes. The entire publication can be navigated and ‘read’ using only text rendered via sound or touch, and does not require visual perception.</p>
<p>If true it indicates that there is only a single access mode of textual or <i>accessModeSufficient="textual"</i> (all main content is provided in textual form) is present in the package document.</p>
</dd>
<dt><var>non_textual_content_images</var></dt>
<dt><var>audio_only_content</var></dt>
<dd>
<p>If true it indicates that there is only a single access mode of auditory (an audiobook).</p>
</dd>
<dt><var>non_textual_content</var></dt>
<dd>
<p>If true it indicates that at least one of the following is present in the package document:</p>
<ul>
<li><i>accessMode="chartOnVisual"</i> (Charts and Graphs);</li>
<li><i>accessMode="chemOnVisual"</i> (Chemistry);</li>
<li><i>accessMode="diagramOnVisual"</i> (Diagrams);</li>
<li><i>accessMode="mathOnVisual"</i> (Math);</li>
<li><i>accessMode="musicOnVisual"</i> (Music);</li>
<li><i>accessMode="textOnVisual"</i> (Images of text);</li>
<li>otherwise if false it means that this metadata is not present.</li>
</ul>
<p>This means that the content contains images of any type.</p>
<p>If true it indicates that there is non-textual content such as images, audio, or video in the publication.</p>
</dd>
<dt><var>textual_alternative_images</var></dt>
<dt><var>textual_alternatives</var></dt>
<dd>
<p>If true it indicates that at least one of the following is present in the package document:</p>
<ul>
<li><i>accessibilityFeature="alternativeText"</i> (Short alternative textual descriptions);</li>
<li><i>accessibilityFeature="longDescription"</i> (Full alternative textual descriptions);</li>
<li><i>accessibilityFeature="describedMath"</i> (Visual of math fully described));</li>
<li>otherwise if false it means that this metadata is not present.</li>
<li><i>accessibilityFeature="transcript"</i> (Transcripts for audio and visual content);</li>
<li>otherwise if false it means that this metadata is not present.</li>
</ul>
<p>This means that there are textual alternatives for images.</p>
<p>This means that there are textual alternatives for the non-textual content.</p>
</dd>
<dt><var>visual_only_content</var></dt>
<dd>
<p>If true it indicates that there is only a single access mode of visual and there are no sufficient access modes that include textual (e.g., comics and manga with no alternative text).</p>
</dd>
</dl>
<h5>Variables setup</h5>
<ol class="condition">
<li><b>LET</b> <var>package_document</var> be the result of calling <a href="#pre-processing">preprocessing</a> given <var>package_document_as_text</var>.</li>

<li><b>LET</b> <var>all_necessary_content_textual</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[@property="schema:<i>accessModeSufficient</i>" and normalize-space()="<i>textual</i>"]</code>.</li>
<li>
<b>LET</b> <var>package_document</var> be the result of calling <a href="#pre-processing">preprocessing</a> given <var>package_document_as_text</var>.
</li>

<li>
<b>LET</b> <var>non_textual_content_images</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[@property="<i>schema:accessMode</i>" and normalize-space() = ("chartOnVisual", "chemOnVisual", "diagramOnVisual", "mathOnVisual", "musicOnVisual", "textOnVisual")]</code>.
<b>LET</b> <var>all_necessary_content_textual</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[(@property="schema:<i>accessMode</i>" and normalize-space() = "textual" and count(//meta[@property="schema:<i>accessMode</i>"]) = 1) or (@property="schema:<i>accessModeSufficient</i>" and normalize-space()="<i>textual</i>")]</code>.
</li>

<li>
<b>LET</b> <var>audio_only_content</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[@property="schema:<i>accessMode</i>" and normalize-space() = "auditory" and count(//meta[@property="schema:<i>accessMode</i>"]) = 1]</code>.
</li>

<li>
<b>LET</b> <var>non_textual_content</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[@property="<i>schema:accessMode</i>" and not(normalize-space() = "textual")]</code>.
</li>

<li>
<b>LET</b> <var>textual_alternative_images</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[@property="<i>schema:accessibilityFeature</i>" and normalize-space()=("<i>longDescription</i>", "<i>alternativeText</i>","<i>describedMath"</i>)]</code>.
<b>LET</b> <var>some_sufficient_text</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[(@property="schema:accessMode" and contains(normalize-space(), "textual")) or (@property="schema:accessModeSufficient" and contains(normalize-space(), "textual"))]</code>.
</li>

<li>
<b>LET</b> <var>textual_alternatives</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[@property="<i>schema:accessibilityFeature</i>" and normalize-space()=("<i>longDescription</i>", "<i>alternativeText</i>", "<i>describedMath"</i>, "<i>transcript</i>")]</code>.
</li>

<li>
<b>LET</b> <var>visual_only_content</var> be the result of calling <a href="#check-for-node">check for node</a> on <var>package_document</var>, <code class="xpath">/package/metadata/meta[(@property="schema:<i>accessMode</i>" and normalize-space() = "visual" and count(//meta[@property="schema:<i>accessMode</i>"]) = 1) and not(//meta[@property="schema:<i>accessModeSufficient</i>" and contains(normalize-space(), "<i>textual</i>")])]</code>.
</li>
</ol>
<h5>Instructions</h5>
<ol class="condition">
<li>
<span><b>IF</b> <var>all_necessary_content_textual</var>:</span>
<span><b>THEN</b> display <code id="ways-of-reading-nonvisual-reading-readable">"Readable in read aloud or dynamic braille"</code>.</span>
</li>
<li>
<span><b>ELSE IF</b> <var>non_textual_content_images</var> <b>AND</b> <b>NOT</b> <var>textual_alternative_images</var>:</span>

<li>
<span><b>ELSE IF</b> <var>non_textual_content</var> <b>AND</b> (<var>some_sufficient_text</var> <b>OR</b> <var>textual_alternatives</var>):</span>
<span><b>THEN</b> display <code id="ways-of-reading-nonvisual-reading-not-fully">"Not fully readable in read aloud or dynamic braille"</code>.</span>
</li>
<li><b>ELSE</b> display <code id="ways-of-reading-nonvisual-reading-may-not-fully">"May not be fully readable in read aloud or dynamic braille"</code>.</li>
<li>
<span><b>IF</b> <var>textual_alternative_images</var>:</span>
<span><b>THEN</b> display <code id="ways-of-reading-nonvisual-reading-alt-text">"Has alternative text"</code>.</span>
</li>


<li>
<span><b>ELSE IF</b> <var>audio_only_content</var> or <var>visual_only_content</var>:</span>
<span><b>THEN</b> display <code id="ways-of-reading-nonvisual-reading-none">"Not readable in read aloud or dynamic braille"</code>.</span>
</li>

<li><b>ELSE</b> display <code id="ways-of-reading-nonvisual-no-metadata">"No information about nonvisual reading is available"</code>.</li>

<li>
<span><b>IF</b> <var>textual_alternatives</var>:</span>
<span><b>THEN</b> display <code id="ways-of-reading-nonvisual-reading-alt-text">"Has alternative text"</code>.</span>
</li>
</ol>


Expand Down Expand Up @@ -865,7 +886,7 @@ <h4 id="hazards-instructions">Instructions</h4>
<span><b>THEN</b> display <code id="hazards-none">"No hazards"</code>.</span>
</li>
<li>
<span><b>ELSE IF</b> <var>flashing_hazard</var> <b>OR</b> <var>motion_simulation_hazard</var> <b>OR</b> <var>sound_hazard</var>:</span></li>
<span><b>ELSE IF</b> <var>flashing_hazard</var> <b>OR</b> <var>motion_simulation_hazard</var> <b>OR</b> <var>sound_hazard</var>:</span>
<b>THEN</b> <ul class="condition">
<li>
<span><b>IF</b> <var>flashing_hazard</var>:</span>
Expand All @@ -880,7 +901,7 @@ <h4 id="hazards-instructions">Instructions</h4>
<span><b>THEN</b> display <code id="hazards-sound">"Sounds"</code>.</span>
</li>
</ul>

</li>
<li>
<span><b>ELSE IF</b> <var>unknown_if_contains_hazards</var>:</span>
<span><b>THEN</b> display <code id="hazards-unknown">"The presence of hazards is unknown"</code>.</span>
Expand Down

0 comments on commit 673b817

Please sign in to comment.