Constructor: RuleResult

OpenAjax.a11y.RuleResult

new RuleResult(rule_mapping)

Constructor for an object that contains a the results of the evaluation of a ruleset rule

Parameters:
Name Type Description
rule_mapping RuleMapping RuleMapping object
Source:
  • scripts/rule_result.js, line 7

Methods

<static> addResult(test_result, cache_item, message_id, message_arguements)

Adds a result of an evaluation of rule on a node in the dom

Parameters:
Name Type Description
test_result Number Number representing if a node passed, failed, manual check or other test result
cache_item Object Reference to cache item associated with the test
message_id String Reference to the message string in the NLS file
message_arguements Array Array of values used in the message string
Source:
  • scripts/rule_result.js, line 308

<static> getGuidelineFilterConstant() → {Number}

Get a bit maskable filter constant that represents the WCAG 2.0 Guideline

Source:
  • scripts/rule_result.js, line 905
Returns:
Number representing the WCAG 2.0 Guideline
Type
Number

<static> getManualCheckProcedures() → {Array}

Gets manual checking proceedures for evaluating the rule requirements

Source:
  • scripts/rule_result.js, line 743
Returns:
Returns an array of objects with localized strings and urls.
Each object has the following properties:
'title' : Localized string describing the technique
'url': URL to more information about the technique
Type
Array

<static> getMessage(id, prefix) → {String}

Generates a localized rule result message

Parameters:
Name Type Description
id String Id of the rule result message string
prefix String Prefix message for the string
Source:
  • scripts/rule_result.js, line 117
Returns:
Strings with rule result message
Type
String

<static> getNodeResults() → {Array}

Returns an array of node results in severity order

Source:
  • scripts/rule_result.js, line 272
Returns:
Returns a array of node results
Type
Array

<static> getPrimarySuccessCriterion() → {Object}

Get information about primary WCAG 2.0 Success Criteria for the rule

Source:
  • scripts/rule_result.js, line 798
Returns:
Object representing the success criteria, each object has the following properties:
'id' : A "P.G.SC" formatted string representing the SC,
'title' : A localized title for the SC,
'description' : A localized description of the SC,
'url' : A url to the SC in the WCAG 2.0 document
'level' : The level of the Success Criterion (e.g. A, AA or AAA)
Type
Object
Example
var sc_info = rule.getPrimarySuccessCriterion();

// Creating a link element to the primary success criterion
var node = document.createElement('a');
node.appendChild(document.createTextNode(sc_info.id + " " + sc_info.title));
node.setAttribute('href',  sc_info.url);
node.setAttribute('title', sc_info.description);
} 

<static> getPrincipleFilterConstant() → {Number}

Get a bit maskable filter constant that represents the WCAG 2.0 Principle

Source:
  • scripts/rule_result.js, line 889
Returns:
Number representing the WCAG 2.0 Principle
Type
Number

<static> getPurpose() → {Array}

Gets an array strings representing the purpose, basically how does the rule help people with disabilities

Source:
  • scripts/rule_result.js, line 657
Returns:
Returns an array of localized string describing the purpose
Type
Array

<static> getRelatedSuccessCriteria() → {Array}

Get information about the related WCAG 2.0 Success Criteria for the rule

Source:
  • scripts/rule_result.js, line 831
Returns:
Array of objects representing the success criteria, each object has the following properties:
'id' : A "P.G.SC" formatted string representing the SC,
'title' : A localized title for the SC,
'description' : A localized description of the SC,
'url' : A url to the SC in the WCAG 2.0 document
'level' : The level of the Success Criterion (e.g. A, AA or AAA)
Type
Array

<static> getResultMessage(result_summary) → {String}

Generates a localized rule result messages

Parameters:
Name Type Description
result_summary SummaryResult Optional summary result object to over ride the current result settings
Source:
  • scripts/rule_result.js, line 245
Returns:
Returns a single string with all result messages
Type
String

<static> getResultMessages(result_summary) → {Array}

Generates a localized rule result messages

Parameters:
Name Type Description
result_summary SummaryResult Optional summary result object to over ride the current result settings
Source:
  • scripts/rule_result.js, line 189
Returns:
An array of strings with rule result messages (typically only one string in the array)
Type
Array

<static> getResultSummary() → {ResultSummary}

Gets numerical summary information about the rule results

Source:
  • scripts/rule_result.js, line 101
Returns:
Returns the ResultSummary object
Type
ResultSummary

<static> getRuleCategory() → {Object}

Get a localized title, url and description of the rule category

Source:
  • scripts/rule_result.js, line 551
Returns:
Returns an object with the following propertues:
'title': String representing the Title of the rule category
'desc': String providing a longer description of the rule category
'url': URL to more information about the rule category (maybe blank)
Type
Object

<static> getRuleCategoryConstant() → {Number}

Returns the numeric value for the rule category

Source:
  • scripts/rule_result.js, line 535
Returns:
Numeric value of the rule category
Type
Number

<static> getRuleDefinition() → {String}

Gets the definition of the rule

Source:
  • scripts/rule_result.js, line 624
Returns:
Localized string of the rule definition based on being required or recommended
Type
String

<static> getRuleId() → {String}

Get the programmatic id that uniquely identifies the rule

Source:
  • scripts/rule_result.js, line 503
Returns:
The rule id
Type
String

<static> getRuleIdNLS() → {String}

Get a localized human readable id for uniquely identifying the rule

Source:
  • scripts/rule_result.js, line 519
Returns:
Localized string of the rule id
Type
String

<static> getRuleRequiredOrRecommended(Returns)

Returns 'Required' or "Recommended' depending on whether the rule is required or recommended rule

Parameters:
Name Type Description
Returns String "Required" if required, otherwise "Recommended"
Source:
  • scripts/rule_result.js, line 481

<static> getRuleRequiredYesNo(Returns)

Returns 'Yes' or "No' depending on whether the rule is required or recommended rule

Parameters:
Name Type Description
Returns String "Yes" if required, otherwise "No"
Source:
  • scripts/rule_result.js, line 465

<static> getRuleScope() → {String}

Get a localized string of the rule scope (i.e. 'element' or 'page')

Source:
  • scripts/rule_result.js, line 570
Returns:
Localized string of the rule scope
Type
String

<static> getRuleSummary() → {String}

Gets the summary of the rule

Source:
  • scripts/rule_result.js, line 640
Returns:
Localized string of the rule summary based on being required or recommended
Type
String

<static> getSuccessCriterionFilterConstant() → {Number}

Get a filter constant that represents the WCAG 2.0 Success Criterion

Source:
  • scripts/rule_result.js, line 921
Returns:
Number representing the WCAG 2.0 Success Criterion
Type
Number

<static> getTargetResourceProperties() → {Array}

Get the attributes and properties of element used in evaluating a rule

Source:
  • scripts/rule_result.js, line 707
Returns:
Returns an array of strings identifying the elements and/or attributes that the rule evaluates
Type
Array

<static> getTargetResources() → {Array}

Returns an localized array strings representing target resources of the rule

Source:
  • scripts/rule_result.js, line 690
Returns:
Returns an array of strings identifying the elements and/or attributes that the rule evaluates
Type
Array

<static> getTargetResourcesDescription() → {String}

Get a description of the markup or page feature the rule is evaluates

Source:
  • scripts/rule_result.js, line 674
Returns:
Localized string representing the markup or page feature tested by the rule
Type
String

<static> getTechniques() → {Array}

Get the techniques to implement the requirements of the rule

Source:
  • scripts/rule_result.js, line 724
Returns:
Returns an array of objects with localized strings and urls.
Each object has the following properties:
'title' : Localized string describing the technique
'url': URL to more information about the technique
Type
Array

<static> getWCAG20Level() → {String}

Get the string representation of the the WCAG 2.0 Success Criterion Level based on the primary id of the rule

Source:
  • scripts/rule_result.js, line 870
Returns:
String representing the WCAG 2.0 success criterion level (i.e. A, AA or AAA)
Type
String

<static> getWCAG20LevelConstant() → {Number}

Get the numerical constant for the WCAG 2.0 Success Criterion Level based on the primary id of the rule

Source:
  • scripts/rule_result.js, line 853
Returns:
Number representing the WCAG 2.0 level
Type
Number

<static> hasResults() → {Boolean}

Tests if the rule applied to the content in the page

Source:
  • scripts/rule_result.js, line 84
Returns:
True if the rule has results, otherwise false
Type
Boolean

<static> isRuleEnabled(True)

Tests whether the rule is enabled or disabled for evaluation

Parameters:
Name Type Description
True Boolean if rule is enabled, false if rule disabled
Source:
  • scripts/rule_result.js, line 433

<static> isRuleRequired(True)

Tests whether the rule is a required or recommended rule in this ruleset

Parameters:
Name Type Description
True Boolean if rule is a required rule, false if a recommended rule
Source:
  • scripts/rule_result.js, line 449

<static> isScopeElement() → {Boolean}

Returns an localized string of the rule scope (i.e. element or page)

Source:
  • scripts/rule_result.js, line 604
Returns:
True if the rule has a scope of element, otherwise false
Type
Boolean

<static> isScopePage() → {Boolean}

Returns an localized string of the rule scope (i.e. element or page)

Source:
  • scripts/rule_result.js, line 586
Returns:
True if the rule has a scope of page, otherwise false
Type
Boolean

<static> setEvaluationLevelToDisabled()

Sets evaluation level of the rule result to disabled (i.e. rule was not evaluated due to user configuration settings)

Source:
  • scripts/rule_result.js, line 417

<static> toString() → {String}

Creates a text string representation of the rule result object

Source:
  • scripts/rule_result.js, line 938
Returns:
Returns a text string representation of the rule result object
Type
String