WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Element ID is not unique (style tags within head of html)

for

Number of posts in this thread: 9 (In chronological order)

From: Cindy Duggan
Date: Tue, Feb 11 2020 8:52AM
Subject: Element ID is not unique (style tags within head of html)
No previous message | Next message →

Hello,

We have a situation where a 3rd party font widget / script creates 2 style
tags in the head of our webpages (not sure why). Each style tag contains
an id, but the id's are the same. The automated testing tool we are using
lists this as a Level A accessibility error: 1.3.1 Info and Relationships:

Element ID is not unique
The ID used for an element on the page is also used for another element on
the page.

e.g.,

<style type="text/css" id="mti_fontface_abc">
@font-face
... (several fonts)
</style>

<style type="text/css" id="mti_fontface_abc">
@font-face
... (several different fonts)
</style>

I am having a hard time understanding how the duplicate id for 2 style tags
relates to the WCAG criteria and why this is considered an error.

Any insights?

Thanks.


*-----------------------*

Cindy Duggan, Ph.D., P.E.

*Director of Web ApplicationsInformation Technology Services*
[image: Manhattan College Logo/Shield]
Riverdale, NY 10471
Phone: 718-862-7413
= EMAIL ADDRESS REMOVED =
www.manhattan.edu

From: Patrick H. Lauke
Date: Tue, Feb 11 2020 9:00AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

On 11/02/2020 15:52, Cindy Duggan wrote:
[...]
> I am having a hard time understanding how the duplicate id for 2 style tags
> relates to the WCAG criteria and why this is considered an error.

4.1.1 is a very naive SC that fails particular "code smells" because
they *may* cause problems in different user agents, which then *may*
have an accessibility impact.

See discussion here about deprecating that SC altogether
https://github.com/w3c/wcag/issues/770

I would say: if the 3rd party solution could be nudged towards not
spitting out invalid HTML, that'd be good. Otherwise, just take this as
a mild failure (as it incontrovertibly is a failure of 4.1.1), but
document that you're aware of the failure and don't find it has any
actual real impact on the accessibility of the site/page.

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Patrick H. Lauke
Date: Tue, Feb 11 2020 9:01AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

Oh, and I only just noticed that you said it fails 1.3.1, not 4.1.1? In
that case, no idea what that particular automated tool is
thinking/doing. Certainly doesn't look like a 1.3.1 issue to me at all.
False (by quite a long shot) positive?

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Swift, Daniel P.
Date: Tue, Feb 11 2020 9:09AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

I'd argue a usability and accessibility issue. You can link to IDs as a functioning anchor - having more than one ID breaks this. I think the problem stems from this.

Dan Swift
Senior Web Specialist
University Communications and Marketing
West Chester University
610.738.0589

From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Patrick H. Lauke
Sent: Tuesday, February 11, 2020 11:01 AM
To: = EMAIL ADDRESS REMOVED =
Subject: Re: [WebAIM] Element ID is not unique (style tags within head of html)

Oh, and I only just noticed that you said it fails 1.3.1, not 4.1.1? In
that case, no idea what that particular automated tool is
thinking/doing. Certainly doesn't look like a 1.3.1 issue to me at all.
False (by quite a long shot) positive?

P
--
Patrick H. Lauke

https://www.splintered.co.uk/<https://www.splintered.co.uk/> | https://github.com/patrickhlauke<https://github.com/patrickhlauke>
https://flickr.com/photos/redux/<https://flickr.com/photos/redux/> | https://www.deviantart.com/redux<https://www.deviantart.com/redux>
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Patrick H. Lauke
Date: Tue, Feb 11 2020 9:12AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

On 11/02/2020 16:09, Swift, Daniel P. wrote:
> I'd argue a usability and accessibility issue. You can link to IDs as a functioning anchor - having more than one ID breaks this. I think the problem stems from this.

Yeah but in this specific case, you can't link to a <style> element in
the <head>.

Also (for situations where you would indeed have anchors in the actual
content / references to fragment identifiers) the problem would affect
all users, not just those with disabilities (or, to be clearer, not more
disproportionately) ... so not necessarily a WCAG issue as such.

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Bateman, Jill
Date: Tue, Feb 11 2020 9:12AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

Deque does a good job explaining the reasoning behind the unique ID issue here: https://dequeuniversity.com/rules/axe/3.0/duplicate-id but if you go through any kind of HTML 101 course, this is such a basic concept that it's a sign of poor coding whenever I see these. One of the great gifts of WCAG (imho) is that the requirements include standards - which make for better products. If your widget is spitting out crap code like that - maybe look for a new widget. Chances are down the road, you're going to have way more issues than accessibility issues.


Best regards,
Jill

OHIO UNIVERSITY
OIT Office of Information Security & Accessibility
Jill Bateman, MA '13
Digital Accessibility Coordinator
WUSOC 275
1 Ohio University Drive
Athens, OH 45701-2979

T: 740.597.5455
= EMAIL ADDRESS REMOVED =
www.ohio.edu/oit/accessibility<;https://www.ohio.edu/oit/accessibility>


<http://www.ohio.edu/oit/web>;


From: WebAIM-Forum < = EMAIL ADDRESS REMOVED = > on behalf of Cindy Duggan < = EMAIL ADDRESS REMOVED = >
Sent: Tuesday, February 11, 2020 10:52 AM
To: = EMAIL ADDRESS REMOVED = < = EMAIL ADDRESS REMOVED = >
Subject: [WebAIM] Element ID is not unique (style tags within head of html)

Hello,

We have a situation where a 3rd party font widget / script creates 2 style
tags in the head of our webpages (not sure why). Each style tag contains
an id, but the id's are the same. The automated testing tool we are using
lists this as a Level A accessibility error: 1.3.1 Info and Relationships:

Element ID is not unique
The ID used for an element on the page is also used for another element on
the page.

e.g.,

<style type="text/css" id="mti_fontface_abc">
@font-face
... (several fonts)
</style>

<style type="text/css" id="mti_fontface_abc">
@font-face
... (several different fonts)
</style>

I am having a hard time understanding how the duplicate id for 2 style tags
relates to the WCAG criteria and why this is considered an error.

Any insights?

Thanks.


*-----------------------*

Cindy Duggan, Ph.D., P.E.

*Director of Web ApplicationsInformation Technology Services*
[image: Manhattan College Logo/Shield]
Riverdale, NY 10471
Phone: 718-862-7413
= EMAIL ADDRESS REMOVED =
www.manhattan.edu<;http://www.manhattan.edu>;

From: Swift, Daniel P.
Date: Tue, Feb 11 2020 9:16AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

I completely missed the part about head HTML (original message from Cindy got stuck in my spam). I feel only mildly foolish now 😊

Dan Swift
Senior Web Specialist
University Communications and Marketing
West Chester University
610.738.0589

From: WebAIM-Forum [mailto: = EMAIL ADDRESS REMOVED = ] On Behalf Of Patrick H. Lauke
Sent: Tuesday, February 11, 2020 11:13 AM
To: = EMAIL ADDRESS REMOVED =
Subject: Re: [WebAIM] Element ID is not unique (style tags within head of html)

On 11/02/2020 16:09, Swift, Daniel P. wrote:
> I'd argue a usability and accessibility issue. You can link to IDs as a functioning anchor - having more than one ID breaks this. I think the problem stems from this.

Yeah but in this specific case, you can't link to a <style> element in
the <head>.

Also (for situations where you would indeed have anchors in the actual
content / references to fragment identifiers) the problem would affect
all users, not just those with disabilities (or, to be clearer, not more
disproportionately) ... so not necessarily a WCAG issue as such.

P
--
Patrick H. Lauke

https://www.splintered.co.uk/<https://www.splintered.co.uk/> | https://github.com/patrickhlauke<https://github.com/patrickhlauke>
https://flickr.com/photos/redux/<https://flickr.com/photos/redux/> | https://www.deviantart.com/redux<https://www.deviantart.com/redux>
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Mark Rogers
Date: Tue, Feb 11 2020 9:24AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | Next message →

The tool is probably flagging it as a 1.3.1. failure because WCAG failures F17 and F62 used to list 1.3.1 as a failure caused by duplicate IDs:

https://www.w3.org/TR/2014/NOTE-WCAG20-TECHS-20140916/F17.html
https://www.w3.org/TR/2014/NOTE-WCAG20-TECHS-20140916/F62.html

These were both removed in https://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/

On 11/02/2020, 16:01, "WebAIM-Forum on behalf of Patrick H. Lauke" < = EMAIL ADDRESS REMOVED = on behalf of = EMAIL ADDRESS REMOVED = > wrote:

Oh, and I only just noticed that you said it fails 1.3.1, not 4.1.1? In
that case, no idea what that particular automated tool is
thinking/doing. Certainly doesn't look like a 1.3.1 issue to me at all.
False (by quite a long shot) positive?

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke

From: Cindy Duggan
Date: Tue, Feb 11 2020 11:27AM
Subject: Re: Element ID is not unique (style tags within head of html)
← Previous message | No next message

Thanks all for the comments.

I agree that this is poor coding vs an accessibility issue.

Cindy

*-----------------------*

Cindy Duggan, Ph.D., P.E.

*Director of Web ApplicationsInformation Technology Services*
[image: Manhattan College Logo/Shield]
Riverdale, NY 10471
Phone: 718-862-7413
= EMAIL ADDRESS REMOVED =
www.manhattan.edu


On Tue, Feb 11, 2020 at 11:25 AM Mark Rogers < = EMAIL ADDRESS REMOVED = >
wrote:

> The tool is probably flagging it as a 1.3.1. failure because WCAG failures
> F17 and F62 used to list 1.3.1 as a failure caused by duplicate IDs:
>
> https://www.w3.org/TR/2014/NOTE-WCAG20-TECHS-20140916/F17.html
> https://www.w3.org/TR/2014/NOTE-WCAG20-TECHS-20140916/F62.html
>
> These were both removed in
> https://www.w3.org/TR/2015/NOTE-WCAG20-TECHS-20150226/
>
> On 11/02/2020, 16:01, "WebAIM-Forum on behalf of Patrick H. Lauke" <
> = EMAIL ADDRESS REMOVED = on behalf of = EMAIL ADDRESS REMOVED = >
> wrote:
>
> Oh, and I only just noticed that you said it fails 1.3.1, not 4.1.1?
> In
> that case, no idea what that particular automated tool is
> thinking/doing. Certainly doesn't look like a 1.3.1 issue to me at
> all.
> False (by quite a long shot) positive?
>
> P
> --
> Patrick H. Lauke
>
> https://www.splintered.co.uk/ | https://github.com/patrickhlauke
> https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
> twitter: @patrick_h_lauke | skype: patrick_h_lauke
> > > > >
>
> > > > >