Constructor: DOMElementComputedStyle

OpenAjax.a11y.cache.DOMElementComputedStyle

new DOMElementComputedStyle(dom_element, parent_element)

Create a dom element computed style object is used to add style properties to dom element cache objects

Parameters:
Name Type Description
dom_element DOMElement dom element node to add computed style information to
parent_element DOMElement parent dom element node for computing inherited properties
Properties:
Name Type Description
display String Computed value of the CSS 'display' property
visibility String Computed value of the CSS 'visibility' property
is_visible_onscreen Number Constant representing the graphical visibility of the element (i.e is it visible to people with sight)
is_visible_to_at Number Constant representing the assistive technology visibility of the element (i.e is it visible to people using a screen reader)
color String Computed value of the CSS 'color' property
color_hex String Computed value of the CSS 'color' property in hexidecimal format
opacity String Computed value of the CSS 'opacity' property
background_color String Computed value of the CSS 'background-color' property
background_color_hex String Computed value of the CSS 'background-color' property in hexidecimal format
background_image String Computed value of the CSS 'background-image' property
background_repeat String Computed value of the CSS 'background-repeat' property
background_position String Computed value of the CSS 'background-position' property
font_family String Computed value of the CSS 'font-family' property
font_size String Computed value of the CSS 'font-size' property
font_weight String Computed value of the CSS 'font-weight' property
position String Computed value of the CSS 'position' property
left String Computed value of the CSS 'left' property
top String Computed value of the CSS 'top' property
width String Computed value of the width of the rendered element in pixels
height String Computed value of the height of the rendered element in pixels
Source:
  • scripts/cache_style.js, line 4

Methods

<static> calculateColorContrast() → {Number}

Calculates a color contrast raio (CCR) value for the element style object

Source:
  • scripts/cache_style.js, line 294
Returns:
Returns a number representing the color contrast ratio (CCR)
Type
Number

<static> getLuminance(color) → {Number}

Get the luminance value of a hex incoded color

Parameters:
Name Type Description
color String Hex representation of a CSS color value
Source:
  • scripts/cache_style.js, line 323
Returns:
Returns a number representing the limnance value
Type
Number

<static> toString() → {String}

Creates a text string representation of the computed style object

Source:
  • scripts/cache_style.js, line 357
Returns:
Returns a text string representation of the computed style object
Type
String