new ListsCache(dom_cache)
Constructor for lists cache object which contains a list of list items representing the list (i.e ul, ol , dl, li, dt and dd) elements defined in a document.
Parameters:
Name | Type | Description |
---|---|---|
dom_cache |
DOMCache | Reference to the DOMCache object |
- Source:
- scripts/cache_lists.js, line 56
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 |
child_cache_elements |
Array | Root array of the tree representation of the list elements in the document |
container_elements |
Array | List of the container element objects in the document that are not children of a container item |
listitem_elements |
Array | List of the listitem element objects |
length |
Number | Number of containter element objects in list |
sort_property |
String | Property of contanter element objectthe list is sorted on |
sort_ascending |
Boolean | true if list is sorted by ascending values, otherwise false |
landmark_count |
Number | Number of containter element objects in list |
rule_summary_result |
ResultRuleSummary | Rule results associated with this cache |
Methods
-
getListElementByCacheId(cache_id) → {ListElement}
-
retrieve list element from lists cache based on its cache id
Parameters:
Name Type Description cache_id
String cache id of the list cache element object to find - Deprecated:
- getListElementByCacheId
- Source:
- scripts/cache_lists.js, line 331
Returns:
Returns list cache object if cache id found, otherwise null- Type
- ListElement
-
<static> addChildElement(list_element) → {boolean}
-
Add a top-level list element object to the lists cache
Parameters:
Name Type Description list_element
ContainerElement | ListElement | LandmarkElement list cache element object to add to the list cache - Source:
- scripts/cache_lists.js, line 296
Returns:
indicating success or failure- Type
- boolean
-
<static> addContainerElement(container_element) → {Number}
-
Adds a container element object to the list of container elements
Parameters:
Name Type Description container_element
ContainerElement Container element object to add - Source:
- scripts/cache_lists.js, line 105
Returns:
Returns the number of container element objects in the list of container element objects- Type
- Number
-
<static> emptyCache()
-
Empties all the properties of the list cache
- Source:
- scripts/cache_lists.js, line 375
-
<static> getItemByCacheId(cache_id) → {ListElement}
-
retrieve list element from lists cache based on its cache id
Parameters:
Name Type Description cache_id
String cache id of the list cache element object to find - Source:
- scripts/cache_lists.js, line 335
Returns:
Returns list cache object if cache id found, otherwise null- Type
- ListElement
-
<static> toString() → {String}
-
Returns a text string representation of the lists cache object
- Source:
- scripts/cache_lists.js, line 398
Returns:
Returns string represention the lists cache object- Type
- String
-
<static> traverseDOMElementsForListElements()
-
Traverses the DOMElements to update the abbreviation cache
- Source:
- scripts/cache_lists.js, line 244
-
<static> updateCache()
-
Traverses the DOMElements to update the list cache This function is used to update the list cache when needed by a rule, it sets the up to date flag when done
- Source:
- scripts/cache_lists.js, line 271
-
<static> updateCacheItems(dom_element, list_info) → {ListInfo}
-
Update the ListsCache by checking to see if the current DOMElement is a list-related element and that consequently a new list element object should be added to this cache.
Parameters:
Name Type Description dom_element
DOMElement dom element object to check for inclusion in lists cache list_info
ListInfo Information about the current list relationships in the DOM - Source:
- scripts/cache_lists.js, line 131
Returns:
Returns updated list information object- Type
- ListInfo