From 86d49c07d3d1406bd56352869dae9eaf4d075e27 Mon Sep 17 00:00:00 2001 From: Benjamin Jones Date: Fri, 16 Aug 2013 15:13:42 -0700 Subject: WCAG 1.0 guidelines 6 and 7 --- guidelines/WCAG-1.0/foo.gif | Bin 0 -> 356086 bytes guidelines/WCAG-1.0/guideline-6.js | 42 +++++++++++++++++++++++++++++++++++ guidelines/WCAG-1.0/guideline-7.js | 28 +++++++++++++++++++++++ guidelines/WCAG-1.0/test6.html | 8 +++++++ guidelines/WCAG-1.0/test6frame2.html | 5 +++++ guidelines/WCAG-1.0/test7.html | 17 ++++++++++++++ 6 files changed, 100 insertions(+) create mode 100644 guidelines/WCAG-1.0/foo.gif create mode 100644 guidelines/WCAG-1.0/guideline-6.js create mode 100644 guidelines/WCAG-1.0/guideline-7.js create mode 100644 guidelines/WCAG-1.0/test6.html create mode 100644 guidelines/WCAG-1.0/test6frame2.html create mode 100644 guidelines/WCAG-1.0/test7.html (limited to 'guidelines') diff --git a/guidelines/WCAG-1.0/foo.gif b/guidelines/WCAG-1.0/foo.gif new file mode 100644 index 0000000..2170592 Binary files /dev/null and b/guidelines/WCAG-1.0/foo.gif differ diff --git a/guidelines/WCAG-1.0/guideline-6.js b/guidelines/WCAG-1.0/guideline-6.js new file mode 100644 index 0000000..59ec2b7 --- /dev/null +++ b/guidelines/WCAG-1.0/guideline-6.js @@ -0,0 +1,42 @@ +exports.name = "WCAG 1.0 Guideline 6: New Technologies"; +exports.description = "Web Accessibility Guideline: Ensure that pages featuring new technologies" + + "transform gracefully"; +exports.rule = function(report) { + + /* + * Note: the rules contained in this file check properties of elements that + * are not supported under HTML5 + */ + + /* Checkpoint 6.2 *********************************************************** + * + * Ensure that equivalents for dynamic content are updated when the dynamic + * content changes. + * + * In particular, http://www.w3.org/TR/WCAG10-HTML-TECHS/#frame-has-html-src + * requires that FRAME elements have only HTML documents as their src. + */ + + var isNotHtml = function (s) { return !(/html$/.test(s)); }; + $5('frame,iframe').attrFilter('src', isNotHtml).each(function () { + report.error('Frame src is not an HTML doc', this); + }); + + /* Note: we can make the same selection as above using only jQuery: + $('frame,iframe').not('[src$="html"]') */ + + /* Checkpoint 6.3 *********************************************************** + * + * Links should not use the `javascript:` target. + */ + + var startsWithJava = function (s) { return /^javascript/.test(s); }; + $5('a').attrFilter('href', startsWithJava).each(function () { + report.error('link uses `javascript:` target', this); + }); + + /* Note: we can make the same selection as above using only jQuery: + $('a').filter('[href^="javascript"]') */ + +}; + diff --git a/guidelines/WCAG-1.0/guideline-7.js b/guidelines/WCAG-1.0/guideline-7.js new file mode 100644 index 0000000..edc2d87 --- /dev/null +++ b/guidelines/WCAG-1.0/guideline-7.js @@ -0,0 +1,28 @@ +exports.name = "WCAG 1.0 Guideline 6: Time Sensitive Content Changes"; +exports.description = "Web Accessibility Guideline: Ensure user control of" + + "time-sensitive content changes."; +exports.rule = function(report) { + + /* + * Note: the rules contained in this file check properties of elements that + * are not supported under HTML5 + */ + + /* Checkpoint 7.2 *********************************************************** + * + * Avoid causing content to blink. + * + * Note: the BLINK and MARQUEE tags are not standard HTML, but were somewhat + * common once upon a time. + */ + + $5('blink,marquee').each(function () { + report.warning('BLINK and MARQUEE are non-standard HTML elements', this); + }); + + $5('*').cssIs('text-decoration', 'blink').each(function () { + report.warning('Avoid causing content to blink', this); + }); + +}; + diff --git a/guidelines/WCAG-1.0/test6.html b/guidelines/WCAG-1.0/test6.html new file mode 100644 index 0000000..806ef0e --- /dev/null +++ b/guidelines/WCAG-1.0/test6.html @@ -0,0 +1,8 @@ + + Test 6 + + + + + + diff --git a/guidelines/WCAG-1.0/test6frame2.html b/guidelines/WCAG-1.0/test6frame2.html new file mode 100644 index 0000000..9f75e8c --- /dev/null +++ b/guidelines/WCAG-1.0/test6frame2.html @@ -0,0 +1,5 @@ + + Test 6 Frame 2 + A bad link: link + + diff --git a/guidelines/WCAG-1.0/test7.html b/guidelines/WCAG-1.0/test7.html new file mode 100644 index 0000000..9372208 --- /dev/null +++ b/guidelines/WCAG-1.0/test7.html @@ -0,0 +1,17 @@ + + Test 7 + + +

This is some text.

+ +

This is some seriously annoying text.

+ +

+ This MARQUEE is some seriously annoying text. +

+ +
Blink from CSS, seriously?
+ + + + -- cgit v1.2.3