Re: SC 4.1.1 source fails but DOM passes - must a page fail?

Alan

I’m not a voice of authority, but you may need a third position to consider in addition to the two you suggested. Going on the intent of 4.1.1<https://www.w3.org/TR/UNDERSTANDING-WCAG20/ensure-compat-parses.html> it seems that avoiding parsing issues or user agent repair techniques is more important than looking at whether the source is valid. It’s my interpretation that position #2 would not be a valid argument if the HTML is invalid in a way that might cause parsing errors or cause repair techniques to be triggered on the user agent—whether or not JavaScript is loading.

Validating the web page is just one of the sufficient techniques for success in 4.1.1, and a page not validating is not listed as a failure, so it does not seem explicit that HTML source MUST validate, if other success criteria are met for 4.1.1.

This leaves position 3: The final outcome of the HTML source plus the JavaScript code must not cause parsing issues or user agent repair techniques. According to WebAIM: While WCAG 1.0 from 1999 required that pages be functional and accessible with scripting disabled, WCAG 2.0 and all other modern guidelines allow you to require JavaScript, but the scripted content or interactions must be compliant with the guidelines. https://webaim.org/techniques/javascript/

Given that, it sounds like if the JavaScript code can be used in a way that does not cause parsing issues or user agent repair techniques, it seems permittable even if the pre-JavaScript source does not validate.

Casey Hickey
Web and Digital Marketing Specialist
SUNY Cortland
Marketing Office
Brockway Hall, Room 309
607-753-2533

From: "Bristow, Alan" <Alan.Bristow@elections.ca>
Date: Thursday, January 10, 2019 at 3:40 PM
To: "'w3c-wai-ig@w3.org'" <w3c-wai-ig@w3.org>
Subject: SC 4.1.1 source fails but DOM passes - must a page fail?
Resent-From: <w3c-wai-ig@w3.org>
Resent-Date: Thursday, January 10, 2019 at 3:36 PM

All,

Tasked with declaring a page as passing or failing SC 4.1.1
https://www.w3.org/TR/WCAG20/#ensure-compat-parses

I am looking for an authoritative source to back up one or other of these two positions:

1. HTML source MUST validate, regardless of whether the DOM is valid once JavaScript has loaded
2. HTML source may be INVALID as long as the DOM is valid after JavaScript has loaded.

This is something that must have come up before but I am sorry to say I cannot find the answer.

I suspect, since:
a). browsers change the DOM
https://css-tricks.com/dom/#article-header-id-0

and,
b). some browsers are less capable than others and so some may fail to ‘mend’ some invalid HTML
that I probably have to follow position 1. since it is unequivocal.

Thanks for any wisdom you can share.

Cheers,

Alan

Alan Bristow
Web Programmer
Policy and Public Affairs
Elections Canada
Desk 9-A-053
30 Victoria Street, Gatineau, QC K1A 0M6
alan.bristow@elections.ca<mailto:alan.bristow@elections.ca>
Tel.: 819-939-2232

Received on Thursday, 10 January 2019 21:12:09 UTC