WebAIM - Web Accessibility In Mind

E-mail List Archives

Thread: Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?

for

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

From: Glenda Sims
Date: Wed, Feb 01 2012 6:09PM
Subject: Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?
No previous message | Next message →

Oh wise and wonderful Accessibility Experts,

I'm pretty sure I know the answer to this question...but I need to make
sure I'm accurate by getting some 2nd opinions. I believe that the use of
document.write is perfectly acceptable and meets WCAG 2.0 1.3.1
requirements....when it is used to build a web page, as the page is loading
the first time.

Now, if you start using document.write after the page has fully loaded, to
dynamically change content on the page, then, you can get in trouble and be
out of compliance with WCAG 2.0 1.3.1.

The item I'm trying to clarify is down at the bottom of the Testing Technique
in SCR21: Using functions of the DOM to add content to a page at
http://www.w3.org/TR/2012/NOTE-WCAG20-TECHS-20120103/SCR21

Is specifically states:

Tests
> Procedure
> For pages that dynamically create new content:
>
> 1. Examine the source code and check that the new content is not
> created using document.write(), innerHTML, outerHTML, innerText or
> outerText.
>
>
> End of Quote.

Now, in my humble opinion, the key word in this procedure is "new". I
think you can't use document.write to add new content to the page.

So now, it is time for me to listen to your opinions. How do you interpret
this? Do you agree with me? Or not.

Thanks tons,
Glenda (goodwitch) Sims
--
glenda sims | deque.com | 512.963.3773

*web for everyone. web on everything.* - w3 goals

From: Jared Smith
Date: Wed, Feb 01 2012 6:42PM
Subject: Re: Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?
← Previous message | Next message →

This technique is extremely dated and its recommendations flawed.
There's nothing wrong with using these techniques to write content to
the page so long as the currently focused element is not modified or
removed. These methods are not optimal for generating content, but I
can think of no accessibility issues with using them. Unless I'm
misunderstanding something, you can ignore it.

Jared Smith
WebAIM.org

From: Donald Evans
Date: Wed, Feb 01 2012 8:03PM
Subject: Re: Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?
← Previous message | Next message →

is there any issue with using innerHTML?

On Wed, Feb 1, 2012 at 8:42 PM, Jared Smith < = EMAIL ADDRESS REMOVED = > wrote:

> This technique is extremely dated and its recommendations flawed.
> There's nothing wrong with using these techniques to write content to
> the page so long as the currently focused element is not modified or
> removed. These methods are not optimal for generating content, but I
> can think of no accessibility issues with using them. Unless I'm
> misunderstanding something, you can ignore it.
>
> Jared Smith
> WebAIM.org
>

From: Jared Smith
Date: Wed, Feb 01 2012 9:27PM
Subject: Re: Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?
← Previous message | Next message →

On Wed, Feb 1, 2012 at 8:04 PM, Donald Evans < = EMAIL ADDRESS REMOVED = > wrote:
> is there any issue with using innerHTML?

There are no accessibility issues with innerHTML that I am aware of.
So long as you are not updating the currently focused element, you are
simply manipulating the DOM and modern screen readers should pick up
the updates.

Jared

From: Benjamin Hawkes-Lewis
Date: Thu, Feb 02 2012 12:21AM
Subject: Re: Is any use of document.write a violation of WCAG 2.0 1.3.1 (or only if it is used to dynamically create new content after the page has loaded)?
← Previous message | No next message

On Thu, Feb 2, 2012 at 1:11 AM, Glenda Sims < = EMAIL ADDRESS REMOVED = > wrote:
> Oh wise and wonderful Accessibility Experts,
>
> I'm pretty sure I know the answer to this question...but I need to make
> sure I'm accurate by getting some 2nd opinions.  I believe that the use of
> document.write is perfectly acceptable and meets WCAG 2.0 1.3.1
> requirements....when it is used to build a web page, as the page is loading
> the first time.
>
> Now, if you start using document.write after the page has fully loaded, to
> dynamically change content on the page, then, you can get in trouble and be
> out of compliance with WCAG 2.0 1.3.1.
>
> The item I'm trying to clarify is down at the bottom of the Testing Technique
> in SCR21:  Using functions of the DOM to add content to a page at
> http://www.w3.org/TR/2012/NOTE-WCAG20-TECHS-20120103/SCR21

Not passing a test case of any particular (informative) technique does
not automatically put you out of compliance with a normative
requirement. Using document.write does not automatically mean that
"Information, structure, and relationships that are conveyed through
presentation can" not "be programmatically determined or are
available in text, and that's the only test you need to pass to comply
with 1.3.1.

--
Benjamin Hawkes-Lewis