new Ruleset(ruleset_data)
Parameters:
Name | Type | Description |
---|---|---|
ruleset_data |
Object | JSON object representing rule mapping |
- Source:
- scripts/ruleset.js, line 186
Example
function updateProgess(message, percent) {
.....
}
var url = window.location.href;
var title = window.title;
var doc = window.document;
var ruleset = OpenAjax.a11y.all_rulesets.getRuleset('WCAG20_TRANS');
var result = ruleset.evaluate(url, title, doc, updateProgress, true);
Methods
-
<static> evaluate(url, title, doc, progress_callback, build_cache)
-
Evaluate a document using the OpenAjax ruleset and return an evaluation object
Parameters:
Name Type Description url
String url of document being analyzed title
String Title of document being analyzed doc
Object Browser document object model (DOM) to be evaluated progress_callback
Object Progress call back function (NOTE: not used right now) build_cache
Boolean When true will build all cache in one tranversal of the DOMElements cache, when false specialized caches will be built when they are need by a rule - Source:
- scripts/ruleset.js, line 806
-
<static> getBrokenLinkTesting() → {Boolean}
-
Get whether broken link testing is enabled or disabled
- Source:
- scripts/ruleset.js, line 653
Returns:
True if broken link testing is enabled- Type
- Boolean
-
<static> getDataTableAssumption() → {Boolean}
-
Get whether table markup should be assumed to be used for layout or tabular data The assumption is used when no indicators of layout (i.e. role="presentation") or tabular data (i.e. no TH cells, summary attributes, headers attributes ....) are found in the markup
- Deprecated
- Yes
- Source:
- scripts/ruleset.js, line 689
Returns:
if false table markup is assumed to be for layout; if true the assumption is tabular data- Type
- Boolean
-
<static> getEvaluationLevels() → {String}
-
Get NLS WCAG levels to evaluate
- Source:
- scripts/ruleset.js, line 585
Returns:
String representing the levels of success criteria evaluated- Type
- String
-
<static> getEvaluationLevelsConstant() → {Number}
-
Get WCAG levels to evaluate
- Source:
- scripts/ruleset.js, line 569
Returns:
Number represents the levels of success criteria to test- Type
- Number
-
<static> getEventHandlerProcessor() → {String}
-
Get the current option for event handler processining
- Source:
- scripts/ruleset.js, line 790
Returns:
Returns the current setting of the option for even handler processing- Type
- String
-
<static> getLayoutTableAssumption() → {Boolean}
-
Set whether table markup should be assumed to be used for layout or data table The assumption is used when no indicators of layout (i.e. role="presentation") or tabular data (i.e. no TH cells, summary attributes, headers attributes ....) are found in the markup
- Source:
- scripts/ruleset.js, line 729
Returns:
if true table markup is assumed to be for layout; if false the table markup is assumed to be for tabular data- Type
- Boolean
-
<static> getNumberOfRecommendedRules() → {Number}
-
Return number of recommended rules
- Source:
- scripts/ruleset.js, line 525
Returns:
Number of recommended rules in the ruleset- Type
- Number
-
<static> getNumberOfRequiredRules() → {Number}
-
Return number of required rules
- Source:
- scripts/ruleset.js, line 511
Returns:
Number of required rules in the ruleset- Type
- Number
-
<static> getNumberOfRules() → {Number}
-
Return total number of rules
- Source:
- scripts/ruleset.js, line 539
Returns:
Total number of rules in the ruleset- Type
- Number
-
<static> getRecommendedRulesEnabled() → {Boolean}
-
Get the state of the evaluation of recommeneded rules
- Source:
- scripts/ruleset.js, line 620
Returns:
True if evaluation included recommended rules, False if not to evaluate recommeneded rules- Type
- Boolean
-
<static> getRulesetAuthor() → {String}
-
Return the author of the ruleset
- Source:
- scripts/ruleset.js, line 482
Returns:
String representing the author- Type
- String
-
<static> getRulesetAuthorURL() → {String}
-
Return the author url of the ruleset
- Source:
- scripts/ruleset.js, line 496
Returns:
String representing the author url- Type
- String
-
<static> getRulesetDescription() → {String}
-
Return the description of the ruleset
- Source:
- scripts/ruleset.js, line 468
Returns:
String representing the version- Type
- String
-
<static> getRulesetId() → {String}
-
Return id of the ruleset
- Source:
- scripts/ruleset.js, line 426
Returns:
String representing the ruleset ID- Type
- String
-
<static> getRulesetInfo() → {RulesetInfo}
-
Return ruleset of information
- Source:
- scripts/ruleset.js, line 412
Returns:
RulesetInfo object- Type
- RulesetInfo
-
<static> getRulesetTitle() → {String}
-
Return title of the ruleset
- Source:
- scripts/ruleset.js, line 440
Returns:
String representing the NLS title- Type
- String
-
<static> getRulesetVersion() → {String}
-
Return version of the ruleset
- Source:
- scripts/ruleset.js, line 454
Returns:
String representing the version- Type
- String
-
<static> setBrokenLinkTesting(broken_links)
-
Enable and disable the cache from testing for broken urls
Parameters:
Name Type Description broken_links
Boolean If true enables cache to test for broken links - Source:
- scripts/ruleset.js, line 637
-
<static> setDataTableAssumption(assumption)
-
Set whether table markup should be assumed to be used for layout or tabular data The assumption is used when no indicators of layout (i.e. role="presentation") or tabular data (i.e. no TH cells, summary attributes, headers attributes ....) are found in the markup
Parameters:
Name Type Description assumption
Boolean If false asssumes tables are used for layout; otherwise assumes tabular data - Deprecated
- Yes
- Source:
- scripts/ruleset.js, line 669
-
<static> setEvaluationLevels(level)
-
Enable and disable rules based on the WCAG level
Parameters:
Name Type Description level
Number Level to success criteria to test - Source:
- scripts/ruleset.js, line 553
-
<static> setEventHandlerProcessor(option)
-
Set which process
Parameters:
Name Type Description option
String The event handler process to use to identify events on a DOM element Options currently implemented: firefox fae-util Any other option will result in no event handler processing - Source:
- scripts/ruleset.js, line 750
-
<static> setLayoutTableAssumption(assumption)
-
Set whether table markup should be assumed to be used for layout or tabular data The assumption is used when no indicators of layout (i.e. role="presentation") or tabular data (i.e. no TH cells, summary attributes, headers attributes ....) are found in the markup
Parameters:
Name Type Description assumption
Boolean If true asssumes table markup is used for layout; if false unless header cells or other indicator of a data table is found - Source:
- scripts/ruleset.js, line 710
-
<static> setRecommendedRulesEnabled(enabled)
-
Enable and disable evaluation of recommeneded rules
Parameters:
Name Type Description enabled
Boolean True to evaluate recommended rules, False if not to evaluated recommeneded rules - Source:
- scripts/ruleset.js, line 604
-
<static> toJSON(prefix, rule_category) → {String}
-
Creates a JSON representation of the rules in the ruleset
Parameters:
Name Type Description prefix
String A prefix string typically spaces for formatting output rule_category
Number Number representing the rule categories to include - Source:
- scripts/ruleset.js, line 910
Returns:
JSON formatted string representing the ruleset- Type
- String