Constructor: TextCache

OpenAjax.a11y.cache.TextCache

new TextCache(dom_cache)

Creates cache object representing information related to text nodes in a document

Parameters:
Name Type Description
dom_cache DOMCache Reference to the DOMCache object
Properties:
Name Type Description
dom_cache DOMCache Reference to the DOMCache object
up_to_date Boolean Boolean true if the cache has been creating using the current DOMElements, else false NOTE: This is a common property of all caches and is used when selectively build caches based on whether a rule needs the cache
text_nodes Array List of text nodes in the document
length Number Number of image element objects in the list
Source:
  • scripts/cache_text.js, line 7

Methods

getTextNodeByCacheId(cache_id) → {DOMText|null}

Finds the the text node object with the matching cache id

Parameters:
Name Type Description
cache_id String Cache id of image element object
Deprecated:
  • getTextNodeByCacheId
    Source:
    • scripts/cache_text.js, line 94
    Returns:
    Returns cache text node object if cache id is found, otherwise null
    Type
    DOMText | null

    <static> addTextNode(text_node) → {Number}

    Adds a text node to the list of image elements and generates a cache id for the object.

    Parameters:
    Name Type Description
    text_node DOMText text_node object to add
    Source:
    • scripts/cache_text.js, line 50
    Returns:
    Returns the length of the list of image element objects
    Type
    Number

    <static> emptyCache()

    Resests the TextCache object properties and empties all the lists and arrays

    Source:
    • scripts/cache_text.js, line 127

    <static> getItemByCacheId(cache_id) → {ImageElement|null}

    Finds the the text node object with the matching cache id

    Parameters:
    Name Type Description
    cache_id String Cache id of text node object
    Source:
    • scripts/cache_text.js, line 98
    Returns:
    Returns cache text node object if cache id is found, otherwise null
    Type
    ImageElement | null

    <static> traverseDOMElementsForTextNodes(dom_element)

    Traverses DOM Element objects in the tree to update the text cache

    Parameters:
    Name Type Description
    dom_element DOMElement dom element object to check for inclusion in images cache
    Source:
    • scripts/cache_text.js, line 165

    <static> updateCache()

    Traverses the DOMElements to update the text cache NOTE: This function is only used when the specialized caches are build as rules need them. In this condition, if the rules dependent on the links cache are disabled, this cache would not be updated

    Source:
    • scripts/cache_text.js, line 191

    <static> updateCacheItems(dom_element)

    Updates the images cache object by checking to see if a dom element should be added to the cache

    Parameters:
    Name Type Description
    dom_element DOMElement dom element object to check for inclusion in images cache
    Source:
    • scripts/cache_text.js, line 142