Accessibility Evaluation Library Objects and APIs

From MemberWiki

Jump to: navigation, search

Accessibility Home | Downloads | Evaluation Library Objects and APIs | Rule Format | Issue Tracker


API Documentation


Getting Started Using the Evaluation Library to Evaluate a DOM

  • Top level file for loading evaluation library: [openajax_a11y.js]
  • example usage of API:


  
 // A tools developer wants to use the ARIAStrictRuleset
 var asRuleset = RulesetManager.getRuleset('ARIA_STRICT');
  
 // then needs to get an evaluatorFactory
 var evaluatorFactory = EvaluatorFactory.newInstance();
  
 // and configure it...
 evaluatorFactory.setParameter('ruleset', asRuleset);
  
 evaluatorFactory.setFeature('eventProcessing',   'firefox');
 evaluatorFactory.setFeature('brokenLinkTesting', 'false');
  
 // before getting the actual evaluator
 var evaluator = evaluatorFactory.newEvaluator();
  
 // and doing the evaluation
 var doc   = window.content.document;
 var title = doc.title;
 var url   = window.content.location.href;
  
 // perform an evaluation
 var evaluation_result = evaluator.evaluate(doc, title, url);
  
 var rs = evaluation_result.getRuleResultsAll().getRuleResultSummary();
  
 // Show summary results
 var str = "V: "  + rs.violations;
 str += " W: "  + rs.warnings;
 str += " MC: " + rs.manual_checks;
 str += " P: "  + rs.passed;
 str += " NA: " + rs.not_applicable;

 alert(str);  
  
 
Personal tools