WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Accessible P Tag Usage


From: chagnon@pubcom.com
Date: Mar 19, 2019 3:00PM

The discussion was getting a bit difficult to read so I went back into the WebAIM archives to retrieve the original post: https://webaim.org/discussion/mail_message?id9669

Three key points: 1. The standards are written by people;
2. Over time, the standards evolve and are more eloquently described, defined, and adjusted; and
3. They are interpreted in different ways by testers, checkers, and organizations.

Point 1.
Standards are written by different groups of industry experts from around the world. The primary standards group is the one for HTML / CSS because it's at the root of our current technologies. The WCAG, EPUB, and other standards are subsets that address their particular technology and (hopefully) mesh with the core HTML / CSS standards.

Reading the current definition of the <DIV> tag in HTML 5.1 2nd edition (which I think is the latest from the W3C) at https://www.w3.org/TR/2017/REC-html51-20171003/grouping-content.html#elementdef-div, it states:

<quote> The div element has no special meaning at all. It represents its children. </quote>

Although the HTML definition doesn't explicitly state it, <DIV> for all intents and purposes is a wrapper or container tag that holds other tags. By itself, it has no semantic meaning.

WCAG, PDF/UA, and other accessibility standards provide more details by stating (in their various ways) that "all content must be tagged with a semantically appropriate tag" in order to be accessible to all technologies. So Duff Johnson's comment earlier today is correct; we can't have loose "text flopping about in a <div>". It has to be in a tag inside the <DIV>, a semantically-appropriate tag such as <P>, <Hx>, etc.

All the stakeholders in accessibility -- users, assistive technologies, content creators, software -- must follow the same standards. All of our A T manufacturers are advised to recognize the tags; so when "text is flopping about in a <div>," there's a good chance that one or more of the technologies will not recognize it which can have the same effect as artifacting that content, hiding it from our end users.

<aside> I love Duff's description of text flopping about in a <DIV> </aside>

I don't know of any mark-up language that would allow such a construct; maybe in some half-baked weird XML taxonomy it would be allowed, but not in accessibility.

Point 3:
Not all checkers (human and software) interpret the standards the same way. In theory, they should, but these are voluntary standards, not laws, regulations, or mandates and they are subject to different interpretations and implementations. I think "text flopping about in a <DIV>" should be flagged as a violation in any of our checkers.

We always recommend that our clients use 3 different checkers: one well-trained human plus 2 automated software checkers. That combo should be able to flag items like this. If you find one of your checkers misses this, then submit a bug/feature request to the manufacturer.

<< On the flip side, what about including an empty <p> tag with no text
content, or only an image? >>

I sure hope the empty <P> tags become woven into all of our standards! Although many of our A T tools can be designed to overlook the problem, that kind of gunk really clogs the system when you're trying to migrate content through various technologies -- assistive technologies, cross-media publishing technologies, CMS content management systems, et al.

No double returns between paragraphs.
And while we're at it, no multiple spaces, either.

I'm OK with <IMG>, <FIGURE>, <TABLE> and other elements in a <P>. Sometimes that's the only way we have to insert those items into our content and that technique doesn't produce a hard-stop barrier to those who use A T.


— — —
Bevi Chagnon, founder/CEO | <EMAIL REMOVED>
— — —
PubCom: Technologists for Accessible Design + Publishing
consulting ' training ' development ' design ' sec. 508 services
Upcoming classes at www.PubCom.com/classes
— — —
Latest blog-newsletter – Accessibility Tips at www.PubCom.com/blog

-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Duff Johnson
Sent: Tuesday, March 19, 2019 12:03 PM
To: WebAIM Discussion List < <EMAIL REMOVED> >
Subject: Re: [WebAIM] Accessible P Tag Usage

Just a few observations… I wish I had more time for this fascinating question today...

> I agree with Patrick. This is a very low priority issue and I dont
> think one need to flag it as an violation as there are many ways such
> as inserting <br> tags to provide line breaks between the content.

Let's not confuse paragraphs with line-breaks! These are very different semantics.

> Please note not marking up headings, tables and list items impacts the
> screen reader users heavily hence these should be flagged as
> violations.

Let's also not just think in terms of screen readers! Users with ATs that highlight or zoom could well be impacted.

>> My personal opinion is that it is not a requirement for text to be
>> contained in at least a paragraph element. My thinking is that a
>> paragraph element conveys that its contents are all part of a
>> paragraph--and that might not be the information or relationship that the content author wants to convey.

I have to disagree - there's a clear obligation to provide semantics for each element of content.

It's not OK to leave some text flopping about in a <div> just because it's likely that some ATs will stumble over it correctly and in-context!

>> Then G115 says:
>> "... Using the appropriate semantic elements will make sure the
>> structure is available to the user agent. This involves explicitly
>> indicating the role that different units have in understanding the
>> meaning of the content. The nature of a piece of content as a
>> paragraph, header, emphasized text, table, etc. can all be indicated in this way. ..."
>> The strictest interpretation of these items is that it is required
>> that relationships in content are programmatically available,
>> including content "... such as a paragraph ...". Is this to be taken
>> as saying text should, at a minimum, programmatically be a <p> tag,
>> unless there is a more appropriate structural tag?

IMO, this is a correct interpretation.

>> We are aware that the sufficient techniques do not constitute
>> required ways of doing things, so we are hesitant to violate a
>> customer based on the suggested ways of meeting the criteria.
>> However, when a failure condition says content must be semantically
>> appropriate, then a sufficient technique lists paragraphs as
>> appropriate semantics for text content, this implies that if text
>> content is not in a <p> or a more appropriate tag (like headings,
>> lists, etc.) it is not making the relationship/information about the text "available to all users."

Completely correct.

>> On the flip side, what about including an empty <p> tag with no text
>> content, or only an image?

This is also invalid, although with an admittedly relatively low impact, since software can easily include heuristics to deal with empty elements.

>> Our concern arises from the fact that AXE and WAVE do not violate
>> text content which is not included in a <p> or other semantically
>> appropriate tag

Interesting - IMO, this should be addressed as a bug.

Leaving text lying about in random <divs>… how is that not a straight-up violation of 1.3.1?