This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13103 - Visual formatting of content inside the pre element isn't available to assistive technologies
Summary: Visual formatting of content inside the pre element isn't available to assist...
Status: RESOLVED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 editorial
Target Milestone: ---
Assignee: steve faulkner
QA Contact: HTML WG Bugzilla archive list
URL: http://www.w3.org/TR/2011/WD-html5-20...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-30 16:40 UTC by Léonie Watson
Modified: 2016-04-07 14:40 UTC (History)
16 users (show)

See Also:


Attachments

Description Léonie Watson 2011-06-30 16:40:27 UTC
http://www.w3.org/TR/2011/WD-html5-20110525/grouping-content.html#the-pre-element


Where the visual formatting of content inside a pre element is pertinent to understanding its meaning, there is no way for someone using a screen reader to access that information.
Comment 1 Tab Atkins Jr. 2011-06-30 16:49:41 UTC
Yes, it is - it's all just part of the markup.  What's not accessible is the *meaning* of the visual formatting, but that's inherent to this sort of thing, and there's a note in the spec about this already.
Comment 2 Léonie Watson 2011-07-06 10:15:57 UTC
(In reply to comment #1)
> Yes, it is - it's all just part of the markup.  What's not accessible is the
> *meaning* of the visual formatting, but that's inherent to this sort of thing,
> and there's a note in the spec about this already.

If the visual formatting is pertinent to understanding the meaning of the content though, there's a gap for people who use screen readers. The text in the spec acknowledges this, but it doesn't really offer any practical advice.

Could an example be included that highlights this, and which demonstrates a potential solution? Perhaps some Python code, with the suggestion that the code be made available for download (allowing a screen reader user to open it in a text editor where the indentations would be honoured)?
Comment 3 Tab Atkins Jr. 2011-07-06 18:27:28 UTC
(In reply to comment #2)
> Could an example be included that highlights this, and which demonstrates a
> potential solution? Perhaps some Python code, with the suggestion that the code
> be made available for download (allowing a screen reader user to open it in a
> text editor where the indentations would be honoured)?

I'm confused.  The indentations are honored in <pre> just as well as they'd be in a text editor.

If a screen reader somehow reads the indentations of Python code better in a text editor than in <pre>, that's probably a bug in the screen reader.  Do you have any examples of something like this?
Comment 4 Léonie Watson 2012-11-09 20:48:22 UTC
The difference is that in an application window, a screen reader can calculate the distance between the window edge and the start of the line. When content contained within <pre></pre> appears on a page, there isn't a fixed point from which to measure the indentation. Screen readers rely almost exclusively on the HTML (rather than the CSS) to convey information to the user.
Comment 5 Devarshi Pant 2013-04-10 17:50:03 UTC
I can see a screen reader picking up headers, lists, graphics etc., but have not heard it picking up preformatted text. Wonder how that is going to be like.
Comment 6 Léonie Watson 2013-05-16 16:58:11 UTC
With apologies. This bug was filed against the wrong component. Now filed against the HTML5 spec, specifically section 4.5.3 the pre element:
http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-pre-element

The section acknowledges the potential inaccessibility of pre-formatted content for certain users:

"Note: Authors are encouraged to consider how preformatted text will be experienced when the formatting is lost, as will be the case for users of speech synthesizers, braille displays, and the like. For cases like ASCII art, it is likely that an alternative presentation, such as a textual description, would be more universally accessible to the readers of the document."

The suggestion to include an alternative presentation is helpful, but could be made more so by extending it to include an additional commonplace use of the pre element:

"Note: Authors are encouraged to consider how preformatted text will be experienced when the formatting is lost, as will be the case for users of speech synthesizers, braille displays, and the like. An alternative presentation would be more universally accessible to readers of the document. For example a textual description of ASCII art, or a downloadable text file containing code examples."
Comment 7 Charles McCathieNevile 2016-04-07 14:40:04 UTC
Bug in implementations - browsers should make it possible for the screen reader to get the spacing information, and screen readers should report that as appropriate.