diff options
author | Trevor Elliott <trevor@galois.com> | 2013-06-25 17:25:16 -0700 |
---|---|---|
committer | Trevor Elliott <trevor@galois.com> | 2013-06-25 17:25:16 -0700 |
commit | 83fd5d7eac15eda9ffcedf1d60dfeeadc722e24c (patch) | |
tree | dbdfcd2775b58ae13866e65c0d8e02d2717a90d1 | |
parent | c53e0808b0b9310e217ecd7135b3c3da3f6d93da (diff) |
Start working on section 3
-rw-r--r-- | guidelines/accessibility/conformance-A.json | 1 | ||||
-rw-r--r-- | guidelines/accessibility/guideline-2.js | 9 | ||||
-rw-r--r-- | guidelines/accessibility/guideline-3.js | 66 |
3 files changed, 76 insertions, 0 deletions
diff --git a/guidelines/accessibility/conformance-A.json b/guidelines/accessibility/conformance-A.json index f5bc5f6..fe49346 100644 --- a/guidelines/accessibility/conformance-A.json +++ b/guidelines/accessibility/conformance-A.json @@ -4,5 +4,6 @@ , "rules": [ "guideline-1.js" , "guideline-2.js" + , "guideline-3.js" ] } diff --git a/guidelines/accessibility/guideline-2.js b/guidelines/accessibility/guideline-2.js index f3dc1e5..7dcf28d 100644 --- a/guidelines/accessibility/guideline-2.js +++ b/guidelines/accessibility/guideline-2.js @@ -1,6 +1,15 @@ exports.name = "colorDifference"; exports.description = "Elements should provide sufficient color difference"; exports.rule = function(report) { + + /* Checkpoint 2.1 ***********************************************************/ + + // TODO: not sure about the best way to test that information isn't hidden + // when colors go away. + + + /* Checkpoint 2.2 ***********************************************************/ + var fc = fiveui.color; var MIN_COLOR_DIFF = 500; // http://www.w3.org/TR/2000/WD-AERT-20000426#color diff --git a/guidelines/accessibility/guideline-3.js b/guidelines/accessibility/guideline-3.js new file mode 100644 index 0000000..1be4354 --- /dev/null +++ b/guidelines/accessibility/guideline-3.js @@ -0,0 +1,66 @@ + +exports.name = 'W3C Guideline 3'; +exports.description = ''; +exports.rule = function(report) { + + /* Checkpoint 3.1 [Priority 2] **********************************************/ + + // TODO: this seems pretty subjective, as you have to be able to understand + // the intent of the content. The math example is tough, as you'd have to be + // able to pick out a situation where text wasn't marked up, but was also + // mathematical notation. + + + /* Checkpoint 3.2 [Priority 2] **********************************************/ + + // require that the document contains a dtd. + // TODO: how should we apply this check to iframes and such? + if(!document.doctype) { + report.error('No doctype given for the document', null); + } + + + /* Checkpoint 3.3 [Priority 2] **********************************************/ + + // use style sheets instead of HTML attributes to specify formatting + // information. + $5('b').each(function() { + report.error('The b tag shouldn\'t be used, use strong instead', this); + }); + + $5('i').each(function() { + report.error('The i tag shouldn\'t be used, use em', this); + }); + + $5('[font]').each(function() { + report.error('Use css instead of the font attribute for formatting', this); + }); + + // TODO: there are other cases to handle here, not sure about the best path + // forward. + + + /* Checkpoint 3.4 [Priority 2] **********************************************/ + + // TODO: not sure what the best way to select everything that's not + // automatically positioned. Additionally, many fancy user interfaces will + // use pixels when positioning content, which isn't necessarily wrong. + + + /* Checkpoint 3.5 [Priority 2] **********************************************/ + + // TODO: what's the best way to select siblings that match a given pattern in + // jquery? Essentially, we just want to match situations where h1 is followed + // by something that's both a header, and not h2 (for example). + + + /* Checkpoint 3.6 [Priority 2] **********************************************/ + + + /* Checkpoint 3.7 [Priority 2] **********************************************/ + + // TODO: is there any way that we can detect quotations that aren't inside of + // a blockquote region? + + +}; |