Constructor: NodeResult

OpenAjax.a11y.NodeResult

new NodeResult(rule_result, result_value, cache_item, message_id, message_arguements, props)

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

Parameters:
Name Type Description
rule_result ResultRule reference to the rule result object
result_value Number Constant representing result value of the evaluation result
cache_item DOMElement Object reference to cache item associated with the test
message_id String String reference to the message string in the NLS file
message_arguements Array Array array of values used in the message string
props Array Array of properties that are defined in the validation function (NOTE: typically undefined)
Source:
  • scripts/node_result.js, line 8

Methods

<static> getCacheItem() → {Object}

Gets the cache item associated with the node result

Source:
  • scripts/node_result.js, line 731
Returns:
Returns a cache item object
Type
Object

<static> getDOMElement() → {String}

Returns the dom element object

Source:
  • scripts/node_result.js, line 712
Returns:
Returns a dom element associated with the cache item
Type
String

Get information links related to understanding or implementation of the rule

Source:
  • scripts/node_result.js, line 569
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/node_result.js, line 549
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> getOrdinalPosition() → {Number}

Returns a the ordinal position of the element in a list of node results

Source:
  • scripts/node_result.js, line 238
Returns:
Returns a number indicating the position in a list of node results
Type
Number

<static> getPrimarySuccessCriterion() → {Object}

Get information about primary WCAG 2.0 Success Criteria for the rule

Source:
  • scripts/node_result.js, line 605
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> getPropertyValue(property) → {value|null}

Returns the value of a property in the cache

Parameters:
Name Type Description
property String Property of the cache element object
Source:
  • scripts/node_result.js, line 748
Returns:
Returns a value if property is defined, null if not
Type
value | null

<static> getPurpose() → {Array}

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

Source:
  • scripts/node_result.js, line 479
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/node_result.js, line 638
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 localized node result message

Source:
  • scripts/node_result.js, line 67
Returns:
String with node result message
Type
String

<static> getResultProperties() → {Array}

Get the DOM cache values for the properties associated with a rule

Source:
  • scripts/node_result.js, line 151
Returns:
Array of objects with the following properties:
'label' : String label of the property
'value' : String value of the property
'description' : String providing additional information about the property
Type
Array

<static> getResultValue() → {Object}

Gets result value label, abbreviation, description and style

Source:
  • scripts/node_result.js, line 217
Returns:
Returns a object with the following properties:
'label' : String representing the result value
'abbrev' : Abbreviation string of the label
'description' : String describing the result value
'style' : String that can used for styling the label
Type
Object

<static> getResultValueConstant() → {Number}

Gets the numerical value of the result value of the result

Source:
  • scripts/node_result.js, line 201
Returns:
Returns a number representing the result value of the result
Type
Number

<static> getRuleCategory() → {Object}

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

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

<static> getRuleDefinition() → {String}

Gets the definition of the rule

Source:
  • scripts/node_result.js, line 445
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/node_result.js, line 328
Returns:
The rule id
Type
String

<static> getRuleIdNLS() → {String}

Get a localized human readable id for uniquely identifying the rule

Source:
  • scripts/node_result.js, line 344
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/node_result.js, line 311

<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/node_result.js, line 295

<static> getRuleScope() → {String}

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

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

<static> getRuleSummary() → {String}

Gets the summary of the rule

Source:
  • scripts/node_result.js, line 462
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/node_result.js, line 512
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/node_result.js, line 496
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/node_result.js, line 530
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/node_result.js, line 677
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/node_result.js, line 660
Returns:
Number representing the WCAG 2.0 level
Type
Number

<static> getXPath() → {String}

Returns the xpath of the associated element

Source:
  • scripts/node_result.js, line 695
Returns:
information about the node result
Type
String

<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/node_result.js, line 262

<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/node_result.js, line 278

<static> isScopeElement() → {Boolean}

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

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

<static> toJSON(prefix)

Creates JSON object descibing the properties of the node result

Parameters:
Name Type Description
prefix String A prefix string typically spaces
Source:
  • scripts/node_result.js, line 798
Returns:
String information about the node result

<static> toString() → {String}

Creates a text string representation of the node result object

Source:
  • scripts/node_result.js, line 781
Returns:
Returns a text string representation of the node result object
Type
String