aboutsummaryrefslogtreecommitdiff
path: root/guidelines/WCAG-1.0/guideline-6.js
diff options
context:
space:
mode:
Diffstat (limited to 'guidelines/WCAG-1.0/guideline-6.js')
-rw-r--r--guidelines/WCAG-1.0/guideline-6.js42
1 files changed, 42 insertions, 0 deletions
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"]') */
+
+};
+