new DOMElement(node, parent_element, node, parent_element)
The DOMElement object represents a dom node of a document
Parameters:
Name | Type | Description |
---|---|---|
node |
Object | DOM node object of the element |
parent_element |
Object | DOMElement object that is the parent element of this node |
node |
DOM node Object | The DOM text node |
parent_element |
DOMElement Object | DOMElement object that is the parent DOMElement object in the tree |
- Source:
- scripts/cache_dom_element.js, line 840
Properties:
Name | Type | Description |
---|---|---|
cache_id |
String | String that uniquely identifies the cache element in the DOMCache |
xpath |
String | String that identifies the position of the element in the document |
child_dom_elements |
Array | The child DOMElement and DOMText objects of this DOMElement in the tree |
parent_element |
DOMElement | The parent DOMElement of this DOMElement in the tree |
parent_landmark |
LandmarkElement | LandmarkElement object that contains this element |
type |
Number | Type of DOM node is element |
document_order |
Number | The ordinal position of this DOM element node in the DOM |
node |
Object | Reference to the 'live' DOM element represented by this object |
tag_name |
String | Tag name of the HTML element in lowercase characters (i.e. p, div, h1, span ...) |
aria_attributes |
Array | Array of ARIA properties and states defined for the node |
id |
String | id attribute value of the DOM node (can be empty) |
id_unique |
Number | Indicates if id is defined, unique or has a duplicate in the document |
character_count |
Number | Count of text charcters in the immediate child DOM text nodes |
class_name |
String | The value of the class attribute of the DOM node |
role |
String | The value of the role attribute of the DOM node |
alt |
String | String The value of the alt attribute of the DOM node |
has_alt_attribute |
Boolean | true if the alt attribute is defined, otherwise false |
title |
String | The value of the title attribute of the DOM node |
aria_describedby |
String | The value of the aria-describedby attribute of the DOM node |
aria_hidden |
String | The value of the aria-hidden attribute of the DOM node |
aria_label |
String | The value of the aria-label attribute of the DOM node |
aria_labelledby |
String | The value of the aria-labelledby attribute of the DOM node |
has_activedescendant |
Boolean | True if the current element has defined aria-activedescendent attribute, otherwise false |
ancestor_has_activedescendant |
Boolean | True if a ancestor element has defined aria-activedescendent attribute, otherwise false |
calculated_aria_description |
String | If aria-describedby defined this is a string of the description content |
has_role |
Boolean | True if element has a role value, otherwise false |
has_owns |
Boolean | True if element has a aria-owns property, otherwise false |
has_aria-attributes |
Boolean | True if element has a aria attributes, otherwise false |
is_widget |
Boolean | True if element is a ARIA widget, otherwise false |
is_landmark |
Boolean | True if element is a ARIA landmark, otherwise false |
is_live |
Boolean | True if element is a ARIA live region, otherwise false |
is_section |
Boolean | True if element is a section role, otherwise false |
aria_attributes |
Array | Array of ARIA property and state attributes (i.e. attributes beginning with 'aria-') |
invalid_aria_attributes |
Array | Array of attributes that start with aria-, but are not defined by aria |
aria_attributes_with_invlaid_values |
Array | Array of attributes who have |
role_info |
Object | Object containing information about a widget |
events |
Object | Object that contains information about events associated with the node |
computed_style |
Object | Object that contains information about run time styling of the node |
has_rule_results |
Boolean | Boolean indicating if the node has any rule results |
rules_passed |
Array | Array of NodeResult objects with severity of 'Passed' |
rules_violations |
Array | Array of NodeResult objects with severity of 'Violation' |
rules_manual_checks |
Array | Array of NodeResult objects with severity of 'Manual Check' |
rules_warnings |
Array | Array of NodeResult objects with severity of 'Warning' |
rules_hidden |
Array | Array of NodeResult objects with severity of 'Hidden' |
Methods
-
<static> addChild(child_object)
-
Adds a DOMElement or DOMText object to the tree of DOM text/elements
Parameters:
Name Type Description child_object
DOMElement | DOMText DOMElement or DOMText object - Source:
- scripts/cache_dom_element.js, line 2520
Returns:
Nothing -
<static> addComputedStyle(parent_element)
-
Adds computed style information to the DOMElement object and calculate the color contrast ratio
Parameters:
Name Type Description parent_element
DOMElement The parent DOMElement object, used for information about inherited style information - Source:
- scripts/cache_dom_element.js, line 2559
Returns:
Nothing -
<static> addToCharacterCount(length)
-
Adds to the current character count of the text content of the contained in the DOMelement and its immediate children
Parameters:
Name Type Description length
Number Number to add to the character count - Source:
- scripts/cache_dom_element.js, line 2540
Returns:
Nothing -
<static> calculateXPath(parent_element)
-
Calculate the XPath string that uniquely identifies the DOM node referenced by this DOMElement's node property and set its xpath property to this calculated value.
Parameters:
Name Type Description parent_element
DOMElement The parent DOMElement object, used for information for xpath calculation - Source:
- scripts/cache_dom_element.js, line 2584
Returns:
Nothing -
<static> containsInteractiveElements() → {Boolean}
-
Tests if a DOM element has any descendants that are widgets
- Source:
- scripts/cache_dom_element.js, line 1443
Returns:
'True' if at least one descendant dom element is a widget, otherwise 'false'- Type
- Boolean
-
<static> EnumerateFaeUtilEvents(node, parent_dom_element) → {Object}
-
Finds the event information of the node for a DOMElement object
Parameters:
Name Type Description node
Object Object The DOM element node that corresponds to this DOMElement object, and from which common information is derived for the DOM element cache. parent_dom_element
DOMElement Parent DOMElement object associated with the node's parent node - Source:
- scripts/cache_dom_element.js, line 2397
Returns:
Returns an object with event information- Type
- Object
-
<static> EnumerateFirefoxEvents(node, parent_dom_element) → {Object}
-
Finds the event information of the node for a DOMElement object
Parameters:
Name Type Description node
Object Object The DOM element node that corresponds to this DOMElement object, and from which common information is derived for the DOM element cache. parent_dom_element
DOMElement Parent DOMElement object associated with the node's parent node - Source:
- scripts/cache_dom_element.js, line 2171
Returns:
Returns an object with event information- Type
- Object
-
<static> getAccessibility() → {Object}
-
Returns the worst severity level of rule results
- Source:
- scripts/cache_dom_element.js, line 1531
Returns:
Results an object wiith two properties: 'severity' : nls value of the severity, 'style' : a severity styling constant- Type
- Object
-
<static> getAttributes() → {Array}
-
Returns an array of attributes for the element, sorted in alphabetical order
- Source:
- scripts/cache_dom_element.js, line 1578
Returns:
Returns a array of node results- Type
- Array
-
<static> getCacheProperties() → {Array}
-
Returns an array of styling information for the element, sorted in alphabetical order
- Source:
- scripts/cache_dom_element.js, line 2049
Returns:
Returns a array of NLS objects for styling- Type
- Array
-
<static> getCachePropertyValue(property) → {String|Number|Object}
-
Returns the value of a property
Parameters:
Name Type Description property
String The property to retreive the value - Source:
- scripts/cache_dom_element.js, line 2100
Returns:
Returns the value of the property- Type
- String | Number | Object
-
<static> getClassName() → {String}
-
If defined, return the class attribute value of the dom node
- Source:
- scripts/cache_dom_element.js, line 1330
Returns:
If defined return class value value, else empty string- Type
- String
-
<static> getElementCount() → {Number}
-
Returns a String of the text content of a DOMElement and all its descendent DOMElements
- Source:
- scripts/cache_dom_element.js, line 2775
Returns:
Returns the number of descendent elements in a DOMElement object- Type
- Number
-
<static> getEvents() → {Array}
-
Returns an array of objects representing events associated with the element
- Source:
- scripts/cache_dom_element.js, line 1928
Returns:
Returns a array of event object results- Type
- Array
-
<static> getHasDescribedBy() → {String}
-
Returns NLS string on whether the dom element has a aria-describedby attribute
- Source:
- scripts/cache_dom_element.js, line 1512
Returns:
If true returns "Yes", else "No"- Type
- String
-
<static> getId() → {String}
-
If definded, return the id of the dom node
- Source:
- scripts/cache_dom_element.js, line 1312
Returns:
If defined return id value, else empty string- Type
- String
-
<static> getNodeResults() → {Array}
-
Returns an array of node results in severity order
- Source:
- scripts/cache_dom_element.js, line 1408
Returns:
Returns a array of node results- Type
- Array
-
<static> getParentLandmark() → {String}
-
If defined, return the parent landmark element information
- Source:
- scripts/cache_dom_element.js, line 1349
Returns:
If defined return class value value, else empty string- Type
- String
-
<static> getStyle() → {Array}
-
Returns an array of styling information for the element, sorted in alphabetical order
- Source:
- scripts/cache_dom_element.js, line 2006
Returns:
Returns a array of NLS objects for styling- Type
- Array
-
<static> getText() → {String}
-
Returns text content of a DOMElement, including the ALT text of images through recursion through the DOMText and DOMElement descendents of the DOMElement
- Source:
- scripts/cache_dom_element.js, line 2638
Returns:
Returns the text content of an element and its children- Type
- String
-
<static> getTextObject(visible) → {Object}
-
Returns an object with information about the accessible text of a DOMElement object and its descendents
Parameters:
Name Type Description visible
Boolean Optional, if true text must be visible to be included. default false - Source:
- scripts/cache_dom_element.js, line 2689
Returns:
Returns an object with the following properties: 'height', 'width', 'image_count', 'name', 'name_from_text_nodes', 'name_from_image_alt',- Type
- Object
-
<static> hasAttrWithValue(name, value) → {boolean}
-
Check DOMElement for presence of attribute with specified value
Parameters:
Name Type Description name
String name of attribute value
String value of attribute - Source:
- scripts/cache_dom_element.js, line 1368
Returns:
Indicates whether or not DOMElement has the specified attribute with the specified value.- Type
- boolean
-
<static> hasChangeEvents(prop_list) → {Boolean}
-
Returns true if the element has change events
Parameters:
Name Type Description prop_list
Array : If defined, the names of the event handlers defined will be added to the list as property object - Source:
- scripts/cache_dom_element.js, line 1664
Returns:
Returns "True" element has change event- Type
- Boolean
-
<static> hasClickEvents(prop_list) → {Boolean}
-
Returns true if the element has click or double click events
Parameters:
Name Type Description prop_list
Array : If defined, the names of the event handlers defined will be added to the list as property object - Source:
- scripts/cache_dom_element.js, line 1746
Returns:
Returns "True" element has click and double click events- Type
- Boolean
-
<static> hasDragEvents(prop_list) → {Boolean}
-
Returns true if the element has drag specfic event handlers
Parameters:
Name Type Description prop_list
Array : If defined, the names of the event handlers defined will be added to the list as property object - Source:
- scripts/cache_dom_element.js, line 1832
Returns:
Returns true if element has drag events. otherwise false- Type
- Boolean
-
<static> hasEvents() → {Boolean}
-
Returns if an element has user interface events attached to it
- Source:
- scripts/cache_dom_element.js, line 1616
Returns:
Returns true if event user interface event handlers are attached to the node, otherwise false- Type
- Boolean
-
<static> hasFocusEvents(prop_list) → {Boolean}
-
Returns true if the element has focus or blur events
Parameters:
Name Type Description prop_list
Array : If defined, the names of the event handlers defined will be added to the list as property object - Source:
- scripts/cache_dom_element.js, line 1704
Returns:
Returns "True" element has focus and blur events- Type
- Boolean
-
<static> hasKeyboardEvents(prop_list) → {Boolean}
-
Returns true if the element has keyboard specfic event handlers
Parameters:
Name Type Description prop_list
Array : If defined, the names of the event handlers defined will be added to the list as property object - Source:
- scripts/cache_dom_element.js, line 1884
Returns:
Returns true if element has keyboard events, otherwise false- Type
- Boolean
-
<static> hasMouseEvents(prop_list) → {Boolean}
-
Returns true if the element has mouse specfic event handlers (i.e. up, down, move, over, out)
Parameters:
Name Type Description prop_list
Array : If defined, the names of the event handlers defined will be added to the list as property object - Source:
- scripts/cache_dom_element.js, line 1787
Returns:
Returns "True" element has mouse up, down, move, over and/or out events- Type
- Boolean
-
<static> hasOwns() → {boolean}
-
Check DOMElement for presence of aria-owns attribute
- Source:
- scripts/cache_dom_element.js, line 1392
Returns:
Indicates whether or not DOMElement has aria-owns attribute with values- Type
- boolean
-
<static> hasParentRole(role) → {Boolean}
-
Tests if a widget has a parent element with a certain role
Parameters:
Name Type Description role
String Role to find - Source:
- scripts/cache_dom_element.js, line 1481
Returns:
Returns true if widget has child element with role, otherwise false- Type
- Boolean
-
<static> setImpliedRole(role)
-
Sets an implid role for the DOM element
Parameters:
Name Type Description role
String new role for the element - Source:
- scripts/cache_dom_element.js, line 1256
-
<static> sortItems() → {Array}
-
Returns an array of attributes for the element, sorted in alphabetical order
- Source:
- scripts/cache_dom_element.js, line 2139
Returns:
Returns a array of node results- Type
- Array
-
<static> toString() → {String}
-
Create a text String that represents the DOMElement object
- Source:
- scripts/cache_dom_element.js, line 2807
Returns:
- Type
- String