new FilteredNodeResult(node_result)
Constructor for an object that contains a the results of the evaluation of a rule on a dom node and is part of a ordered list
Parameters:
Name | Type | Description |
---|---|---|
node_result |
NodeResult | reference to the rule result object |
- Source:
- scripts/filtered_node_result.js, line 8
Methods
-
<static> getCacheItem() → {Object}
-
Gets the cache item associated with the node result
- Source:
- scripts/filtered_node_result.js, line 608
Returns:
Returns a cache item object- Type
- Object
-
<static> getDOMElement() → {String}
-
Returns the dom element object
- Source:
- scripts/filtered_node_result.js, line 590
Returns:
Returns a dom element associated with the cache item- Type
- String
-
<static> getInformationalLinks() → {Array}
-
Get information links related to understanding or implementation of the rule
- Source:
- scripts/filtered_node_result.js, line 448
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_node_result.js, line 428
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/filtered_node_result.js, line 123
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/filtered_node_result.js, line 485
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_node_result.js, line 358
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_node_result.js, line 517
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/filtered_node_result.js, line 50
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/filtered_node_result.js, line 66
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 severity label, abbreviation, description and style
- Source:
- scripts/filtered_node_result.js, line 103
Returns:
Returns a object with the following properties:
'label' : String representing the severity
'abbrev' : Abbreviation string of the label
'description' : String describing the severity
'style' : String that can used for styling the label
- Type
- Object
-
<static> getResultValueConstant() → {Number}
-
Gets the numerical value of the severity of the result
- Source:
- scripts/filtered_node_result.js, line 87
Returns:
Returns a number representing the severity of the result- Type
- Number
-
<static> getRuleCategory() → {Object}
-
Get a localized title, url and description of the rule category
- Source:
- scripts/filtered_node_result.js, line 240
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_node_result.js, line 260
Returns:
Numeric value of the rule category- Type
- Number
-
<static> getRuleDefinition() → {String}
-
Gets the definition of the rule
- Source:
- scripts/filtered_node_result.js, line 324
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/filtered_node_result.js, line 206
Returns:
The rule id- Type
- String
-
<static> getRuleIdNLS() → {String}
-
Get a localized human readable id for uniquely identifying the rule
- Source:
- scripts/filtered_node_result.js, line 222
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/filtered_node_result.js, line 188
-
<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_node_result.js, line 172
-
<static> getRuleScope() → {String}
-
Get a localized string of the rule scope (i.e. 'element' or 'page')
- Source:
- scripts/filtered_node_result.js, line 276
Returns:
Localized string of the rule scope- Type
- String
-
<static> getRuleSummary() → {String}
-
Gets the summary of the rule
- Source:
- scripts/filtered_node_result.js, line 341
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_node_result.js, line 391
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_node_result.js, line 375
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_node_result.js, line 409
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/filtered_node_result.js, line 556
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_node_result.js, line 539
Returns:
Number representing the WCAG 2.0 level- Type
- Number
-
<static> getXPath() → {String}
-
Returns the xpath of the associated element
- Source:
- scripts/filtered_node_result.js, line 574
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/filtered_node_result.js, line 139
-
<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_node_result.js, line 155
-
<static> isScopeElement() → {Boolean}
-
Returns an localized string of the rule scope (i.e. element or page)
- Source:
- scripts/filtered_node_result.js, line 308
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_node_result.js, line 292
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/filtered_node_result.js, line 641
Returns:
String information about the node result -
<static> toString() → {String}
-
Creates a text string representation of the node result object
- Source:
- scripts/filtered_node_result.js, line 625
Returns:
Returns a text string representation of the node result object- Type
- String