On Sat, 12 Dec 2015 at 14:10, Joop Kaashoek <
jckaa...@gmail.com> wrote:
> We need to add ARAI/Jaws compatibility to our site with is set up with HTML4. For various reasons converting to HTML5 is a problem (mainly the differing table behavior) So is it possible to add ARIA compatibility to our HTML4 site, with Javascript?
You can add ARIA attributes (like any other HTML attributes) to an
HTML document with JavaScript. However, it's likely to work better if
elements are decorated with the appropriate ARIA attributes before
they are parsed from markup or added with JavaScript to the document,
since otherwise assistive technologies like JAWS might "cache" the
undecorated state. If your site works without JavaScript, then adding
ARIA attributes to the raw markup also means that users with
JavaScript disabled can benefit from them.
Note that browsers and assistive technologies do not treat documents
self-declared as HTML4 differently to documents self-declared as
HTML5. Instead, HTML5 specifies how client software should process any
HTML document, whatever its declared version.
I'm not sure what you meant by "differing table behavior".
Are you talking about tables being rendered different visually? Some
doctype declarations, including some but not all of the HTML doctype
declarations, trigger different rendering behavior and this can affect
table display. "Activating Browser Modes with Doctype" (see
https://hsivonen.fi/doctype/) discusses which common doctypes trigger
which rendering mode. The implementation of these rendering modes and
author reliance upon them was never compliant with the HTML4 era web
specifications, but both the triggers and the details of the modes
have now been specified in the HTML5 era. More critically, to ease the
transition from HTML4, the HTML5 specification for doctype (see
http://www.w3.org/TR/html5/syntax.html#the-doctype) allows authors to
declare certain legacy doctypes, perhaps to keep the alternate
rendering behavior while still validating their use of new HTML5
features elsewhere in the same markup.
Are you talking HTML5 obsoleting the "summary" attribute? This causes
validators to emit a warning when "summary" is used, and authors are
recommended to use other mechanisms to describe tables (see
http://www.w3.org/TR/html5/tabular-data.html#table-descriptions-techniques),
but declaring your document as HTML5 but still including "summary"
attributes will not change how client technologies process those
attributes.
Hope that helps.
--
Benjamin Hawkes-Lewis