Accessibility Cache Objects

From MemberWiki

Jump to: navigation, search

Accessibility Home | Issue Tracker | Rules for Ruleset 2.0 | Evaluation API 2.0 | Ruleset Format 2.0 | DOM Cache Objects | Results Object | Log Object | Rules Format 1.0


Contents

DOMCache

Usage Example

DOMCache

Properties

Name Type Description
url String URL of the page being evaluated
base_url String Base URL of the page being evaluated calculated from the URL
title String The value of title property (i.e. content of the title element) of the document being evaluated
language String The language the document should be analyzed against
document Object The document object reference of the document being evaluated
log Log Object The Log object to store progress information during the evaluation

Methods

Name Usage Parameters Returns Description
initCache() Private none none Initialize specialized element group caches
isUpToDate(cache_name) Private
cache_name
Type: String
Description: String property name of cache to check
Object
  • Checks to see if a cache is up to date with the current DOMElementCache
  • This is used when the cache is built only when a rule needs it
updateCache(cache_name) Private
cache_name
Type: String
Description: property name of cache to check
Boolean
  • Calls update property of a specialized element group cache, if the cache is part of the DOMCache Object
traverseDOMElementsForAllCaches Private
  1. dom_element Object Current DOMElement object being processed
  2. landmark_info Object LandmarkInfo object containing current landmark and heading information for tree representations
  3. main_info Object MainInfo object containing current main, h1 and title information for tree representations
  4. table_info Object TableInfo object containing current table information for tree representations
  5. control_info Object ControlInfo object containing current control information for tree representations
  6. list_info Object Current LanguageElement object that contains the DOMElement
none Continuation of traversal of DOMElement objects and updates all the specialized caches at one time, in general this is faster than updating the caches individually based on the needs of rules, but may create caches that will not be used if some rules are disabled
updateAllCaches Private none none Starts traversal of DOMElement objects
updateDOMElementCache Private none none Updates a DOMElement object caches by traversing the DOM of the browser object
updateDOMElementCache Private none none Updates a DOMElement object caches by traversing the DOM of the browser object
addTitleDOMElement Private none none Creates a DOMElement object for the title element of the web page
updateDOMElements Private
  1. node Object node is the current node object tbing analyzed
  2. parent_dom_element Object DOMElement object that is the parent of the current node
none Traverse document DOM and create a tree of DOMElement objects. The DOMElement objects will be used to generate more specific lists of elements without need to touch the document DOM. Additional information is collected on tables to be used in creating the table cache
getNameFromARIALabel Private
  1. element Object Cache element object
none Adds ARIA label for cache element
getTextFromIDs Private
  1. ids String An string with space separated ids
String Returns the text content of the elements identified in the list of ids
sortArrayOfObjects Private
  1. objects Array array of objects to sort
  2. property String text string of property to sort
  3. ascending Boolean whether to sort ascending or descending
none Sorts a list of objects by one of the object properties

DOMElementCache Object

Properties

Property Type Description
dom_elements Array A simple array of all the DOMElement objects in the cache
child_dom_elements Array The roor of a tree of DOMElement objects representing the node relationships on the DOM
sort_property String The DOMElement property the dom_elements array is sorted by
length Number The running length of the dom_elements array used for calculating the cache_id property of a DOMElement

Methods

Name Usage Parameters Returns Description
initCache Private none none Initializes properties of the DOMElementCache
addDOMElement Private
  1. dom_element Object DOMElement object
Number Adds a DOMElement object to a dom_elements array
addChild Private
  1. dom_object Object DOMElement or DOMText object
none Adds a DOMElement or DOMText object to the root level of the tree
getDOMElementById Private
  • id String id of DOMElement object to find
none Finds the the DOMElement object with the matching id value
getDOMElementByCacheId Public
  1. cache_id String cache_id of DOMElement object to find
Object Finds the the DOMElement object with the matching cache_id value
sortDOMElements Public
  1. property String DOMElement object property used to sort the array
  2. ascending Boolean true if sort in ascending order; false in descending order
Boolean Sorts the dom_elements array based on a property of the DOMElement object
getTextFromIds Private
  1. ids String a space separated list of ids
String Get the accessible text content dom nodes from a list of ids
checkForUniqueIDs Private none none Check DOMElements for unique ids and set id_unique property for all DOMElements in the cache

DOMElement Object

Properties

Property Type Description
property String | Object | Array | Number property description

Methods

Name Usage Parameters Returns Description
method name Public or Private inputs returns method description

DOMText Object

Properties

Property Type Description
property String | Object | Array | Number property description

Methods

Name Usage Parameters Returns Description
method name Public or Private inputs returns method description

Specialized Element Group Caches