Constructor: MainElement

OpenAjax.a11y.cache.MainElement

new MainElement(dom_element, parent_landmark)

Creates a main landmark element object used to hold information about a main landmark

Parameters:
Name Type Description
dom_element DOMElement The dom element object representing the landmark element
parent_landmark MainElement Information about the parent landmark (NOTE: can be null)
Properties:
Name Type Description
dom_element DOMElement Reference to the dom element representing the main landmark element
cache_id String String that uniquely identifies the cache element object in the cache
document_order Number Ordinal position of the title and main cache items in the document to other title and main cache items
role String String identifying the landmark as "main"
parent_landmark MainElement Information about the parent main landmark (NOTE: can be null)
child_cache_elements Array List of child cache title element, main landmarks and h1 heading element objects as part of cache title and main elements tree
h1_elements Array List of all the h1 heading elements that are children of the main landmark
type Number Constant representing the type of main landmark
label String Accessible label of the landmark
label_length Number Length of label text
label_source Number Constant representing the source of the label (i.e. aria-label, aria-labelledby, title...)
label_for_comparison String Accessible label for comparison (i.e. lowercase, trimmed and space normalized)
Source:
  • scripts/cache_headings_landmarks.js, line 1295

Methods

<static> addChildElement(cache_element)

Adds a child landmark or heading object to the tree of landmarks and heading elements

Parameters:
Name Type Description
cache_element Object landmark or heading element object to add to the tree
Source:
  • scripts/cache_headings_landmarks.js, line 1347

<static> addH1Element(h1_element)

Adds a H1 element to the list of H1 elements that are a child elements of the main content

Parameters:
Name Type Description
h1_element H1Element H1 element object to add to list
Source:
  • scripts/cache_headings_landmarks.js, line 1365

<static> addToElementCount(n)

Adds N elements to the count of elements with content

Parameters:
Name Type Description
n Number Number of elements to add to count
Source:
  • scripts/cache_headings_landmarks.js, line 1384

<static> getAttributes(unsorted) → {Array}

Returns an array of attributes for the element, sorted in alphabetical order

Parameters:
Name Type Description
unsorted Boolean If defined and true the results will NOT be sorted alphabetically
Source:
  • scripts/cache_headings_landmarks.js, line 1488
Returns:
Returns a array of attribute display object
Type
Array

<static> getCacheProperties(unsorted) → {Array}

Returns an array of cache properties sorted by property name

Parameters:
Name Type Description
unsorted Boolean If defined and true the results will NOT be sorted alphabetically
Source:
  • scripts/cache_headings_landmarks.js, line 1512
Returns:
Returns a array of cache property display object
Type
Array

<static> getCachePropertyValue(property) → {String|Number}

Returns the value of a property

Parameters:
Name Type Description
property String The property to retreive the value
Source:
  • scripts/cache_headings_landmarks.js, line 1542
Returns:
Returns the value of the property
Type
String | Number

<static> getElementsWithContentCount() → {Number}

Get the number of child elements with content, inlcuding the elements with content of child landmark elements

Source:
  • scripts/cache_headings_landmarks.js, line 1400
Returns:
Number of elements with content
Type
Number

<static> getEvents() → {Array}

Returns an array of events for the element, sorted in alphabetical order

Source:
  • scripts/cache_headings_landmarks.js, line 1564
Returns:
Returns a array of event item display objects
Type
Array

<static> getHeadings() → {Array}

Get all the heading elements in a landmark

Source:
  • scripts/cache_headings_landmarks.js, line 1430
Returns:
Array of heading elements
Type
Array

<static> getNodeResults() → {Array}

Returns an array of node results in severity order

Source:
  • scripts/cache_headings_landmarks.js, line 1458
Returns:
Returns a array of node results
Type
Array

<static> getStyle() → {Array}

Returns an array of style items

Source:
  • scripts/cache_headings_landmarks.js, line 1472
Returns:
Returns a array of style display objects
Type
Array

<static> toString() → {String}

Returns a text string representation of the main landmark element

Source:
  • scripts/cache_headings_landmarks.js, line 1581
Returns:
Returns string represention the landmark element object
Type
String