aboutsummaryrefslogtreecommitdiff
path: root/guidelines
diff options
context:
space:
mode:
authorGravatar Benjamin Jones <bjones@galois.com>2013-08-16 15:13:42 -0700
committerGravatar Benjamin Jones <bjones@galois.com>2013-08-16 15:13:42 -0700
commit86d49c07d3d1406bd56352869dae9eaf4d075e27 (patch)
tree515c67b6e667ef652799fb660a165d9f0b5c49dc /guidelines
parenta410249671fd93948550c9469a6bd10d709057a7 (diff)
WCAG 1.0 guidelines 6 and 7
Diffstat (limited to 'guidelines')
-rw-r--r--guidelines/WCAG-1.0/foo.gifbin0 -> 356086 bytes
-rw-r--r--guidelines/WCAG-1.0/guideline-6.js42
-rw-r--r--guidelines/WCAG-1.0/guideline-7.js28
-rw-r--r--guidelines/WCAG-1.0/test6.html8
-rw-r--r--guidelines/WCAG-1.0/test6frame2.html5
-rw-r--r--guidelines/WCAG-1.0/test7.html17
6 files changed, 100 insertions, 0 deletions
diff --git a/guidelines/WCAG-1.0/foo.gif b/guidelines/WCAG-1.0/foo.gif
new file mode 100644
index 0000000..2170592
--- /dev/null
+++ b/guidelines/WCAG-1.0/foo.gif
Binary files 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 @@
+<html>
+ <head> <title>Test 6</title> </head>
+ <body>
+ <iframe src="foo.gif"></iframe>
+
+ <iframe src="test6frame2.html"></iframe>
+ </body>
+</html>
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 @@
+<html>
+ <head><title>Test 6 Frame 2</title></head>
+ <body>A bad link: <a href="javascript://foo.js">link</a></body>
+</html>
+
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 @@
+<html>
+ <head> <title>Test 7</title> </head>
+ <body>
+
+ <p> This is some text. </p>
+
+ <p><blink>This is some seriously annoying text.</blink></p>
+
+ <p><marquee loop="infinite" bgcolor="yellow" width="300">
+ This MARQUEE is some seriously annoying text.</marquee>
+ </p>
+
+ <div style="text-decoration: blink;">Blink from CSS, seriously?</div>
+ </body>
+
+ <!-- 3 expected failures -->
+</html>