Constructor: FilteredRuleResult

OpenAjax.a11y.FilteredRuleResult

new FilteredRuleResult(rule_result)

Represents one of the rule result in a group of rule results. The count properties and filtered node results list represent the counts and node results that remain after the filter is applied to the node results for the rule results.

Parameters:
Name Type Description
rule_result RuleResult Rule result object for rule in a group
Source:
  • scripts/filtered_rule_result.js, line 7

Methods

<static> getFilteredNodeResults(filter)

Populate the filtered node results array with the nodes defined by the filter

Parameters:
Name Type Description
filter Number Number representing the types of results to include in the array
Source:
  • scripts/filtered_rule_result.js, line 67

Get information links related to understanding or implementation of the rule

Source:
  • scripts/filtered_rule_result.js, line 556
Returns:
Returns an array of objects, each object includes the following properties:
'type_const' : Number representing the type of information,
'title' : Title descriping the type of information,
'url' : Link to more information
Type
Array
Example
var node_list = [];
var info_links = rule.getInformationalLinks();

for(var i = 0; i < info_links.length; i++) {
  var info_link = info_links[i];

  // Using object properties to create a link element
  var node = document.createElement('a');
  node.appendChild(document.createTextNode(info_link.title));
  node.setAttribute('href',  info_link.url);
  node.setAttribute('class', info_link.type_const.toString());

  node_list.push(node);
}

<static> getManualCheckProcedures() → {Array}

Gets manual checking proceedures for evaluating the rule requirements

Source:
  • scripts/filtered_rule_result.js, line 535
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> getNodeResults() → {Array}

Returns an array of node results in severity order

Source:
  • scripts/filtered_rule_result.js, line 233
Returns:
Returns a array of NodeResult objects
Type
Array

<static> getPrimarySuccessCriterion() → {Object}

Get information about primary WCAG 2.0 Success Criteria for the rule

Source:
  • scripts/filtered_rule_result.js, line 592
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> getPurpose() → {Array}

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

Source:
  • scripts/filtered_rule_result.js, line 469
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/filtered_rule_result.js, line 625
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() → {String}

Returns an NLS string representing the evaluation result message for the rule

Source:
  • scripts/filtered_rule_result.js, line 217
Returns:
Returns a NLS string
Type
String

<static> getResultMessages() → {Array}

Returns an NLS string representing the evaluation result message for the rule

Source:
  • scripts/filtered_rule_result.js, line 195
Returns:
An array of strings with rule result messages (typically only one string)
Type
Array

<static> getResultSummary() → {ResultSummary}

Gets numerical summary information about the rule results

Source:
  • scripts/filtered_rule_result.js, line 180
Returns:
Returns the ResultSummary object
Type
ResultSummary

<static> getRuleCategory() → {Object}

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

Source:
  • scripts/filtered_rule_result.js, line 346
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/filtered_rule_result.js, line 365
Returns:
Numeric value of the rule category
Type
Number

<static> getRuleDefinition() → {String}

Gets the definition of the rule

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

<static> getRuleId() → {String}

Returns the id of the rule associated with this rule result

Source:
  • scripts/filtered_rule_result.js, line 314
Returns:
String representing the rule id
Type
String

<static> getRuleIdNLS() → {String}

Returns the nls id of the rule associated with this rule result

Source:
  • scripts/filtered_rule_result.js, line 330
Returns:
String representing the nls 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/filtered_rule_result.js, line 297

<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/filtered_rule_result.js, line 281

<static> getRuleScope() → {String}

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

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

<static> getRuleSummary() → {String}

Gets the summary of the rule

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

<static> getTargetResources() → {Array}

Returns an localized array strings representing target resources of the rule

Source:
  • scripts/filtered_rule_result.js, line 501
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/filtered_rule_result.js, line 485
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/filtered_rule_result.js, line 520
Returns:
Returns an array of localized strings
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/filtered_rule_result.js, line 665
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/filtered_rule_result.js, line 647
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/filtered_rule_result.js, line 164
Returns:
True if the application of the rule has results
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/filtered_rule_result.js, line 249

<static> isRuleRequired(True)

Tests whether the rule is mapped as a required or recommended rule

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

<static> isScopeElement() → {Boolean}

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

Source:
  • scripts/filtered_rule_result.js, line 414
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/filtered_rule_result.js, line 398
Returns:
True if the rule has a scope of page, otherwise false
Type
Boolean

<static> toJSON(prefix, flag) → {String}

Returns a JSON representation of the cache item

Parameters:
Name Type Description
prefix String A prefix string typically spaces
flag Boolean if true include node result details
Source:
  • scripts/filtered_rule_result.js, line 713
Returns:
String representing the cache item result object
Type
String

<static> toString() → {String}

Creates a text string representation of the filtered rule result object

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