Accessibility DOM Elements Cache

From MemberWiki

Jump to: navigation, search

Accessibility Home | Issue Tracker | WCAG 2.0 Rules | Evaluation API 2.0 | Ruleset, Rule and NLS Format 2.0 | Cache Objects | Reporting Practices


Contents

Cache Overview

The cache is designed to provide information in a object form for use by the OAA rules and rules processing engines. The cache will reduce the need to use DOM requests to collect information needed for the evaluation of a rule.

List Cache Base Object

Computed Style Object

The computed style object contains information about the run time styling of the node, especially the calculation of color contrast and node position.


property Type Description
display String Text string of the computed value of the 'display' style property of the node
visibility String Text string of the computed value of the 'hidden' style property of the node
color String RGB value of the computed CSS color property of the node
background_color String RGB value of the computed CSS background-color property of the node
background_image String computed CSS background-image property of the node
color_contrast_ratio Number computed color contrast ratio using the color and background_color values
font_family String computed CSS font-family property of the node
font_size String computed CSS font-size property of the node in pixels
font_weight String computed CSS font-weight property of the node
position String computed CSS position property of the node
top String computed CSS top property of the node
left String computed CSS left property of the node

DOM Object

This serves as the base element object for other element caches

property Type Description
node Object DOM Node reference of element in cache
id String value of node.id property
class String value of node.className property
xpath String computed xpath of the current node for identifying the location in the document
document_order Number Integer value of the ordinal position of the element in a particular cache
tag_name String Text string of the tag name of the element
role String Text string of the 'role' attribute value
aria_hidden String Text string of the 'aria-hidden' attribute value
computed_style Object Object containing the computed style of the node
rules_conditions_not_met Array Array of ids of rules that matched the context, but not the test conditions
rules_passed Array Array of ids of rules that matched the context and passed
rules_failed Array Array of ids of rules that matched the context and failed
rules_not_supported Array Array of ids of rules that matched the context and could not be evaluated

Link Elements Cache

An array of objects with information about A and AREA elements. The link object inherits from DOM Element Base Cache.

 OpenAjax.a11y.cache.links = [{link object 1}, {link object 2},....]

Link Element Object

The link object inherits from DOM Element Base Object.

property Type Description
href String 'href' attribute content that has been normalized to the full URI of the link,
type String 'type' attribute content that identifies the content type
name String 'name' attribute content
tabIndex Number tabindex value of the link
text_accessible_name String Calculated accessible name for the link, including ALT attribute content
text_for_comparison String Accessible name string that has been normalized and converted to lower case for comparison purposes
text_node_content String Concatenated Text node children of the link
text_from_image_alt String Concatenated alt text content of child IMG and AREA elements
image_count Number Number of images contained in the link
text_only_from_image Boolean true is all the accessible name text comes from the image
context_text_from_title String 'title' attribute content of the link
context_element_object Object ContentElement object of P or LI element containing the link
context_table_cell_object Object TableCell object of the table cell containing the link
context_landmark_object Object Landmark object of the landmark role containing the link
context_heading_object Object Heading object of the last heading before the link in document order
target String the target attribute content of the A or AREA element
height Number The height in pixels of the clickable area of the A or AREA element
width Number The width in pixels of the clickable area of the A or AREA element

Headings Cache

An array of objects in document order with information about headings (h1-h6). The link object inherits from DOM Element Base Cache.

 OpenAjax.a11y.cache.headings = [{heading object}, {heading object},....]

Heading Element Object

property Type Description
level Number Number corresponding to the heading level (h1 is 1, h2 is 2, ....)
text_accessible_name String Calculated accessible name for the link, including ALT attribute content
text_for_comparison String Accessible name string that has been normalized and converted to lower case for comparison purposes
text_node_content String Concatenated Text node children of the link
text_from_image_alt String Concatenated alt text content of child IMG and AREA elements
image_count Number Number of images contained in the link
text_only_from_image Boolean true is all the accessible name text comes from the image

Images Cache

An array of objects with information about images. The link object inherits from DOM Element Base Cache.

 OpenAjax.a11y.cache.images = [{image object 1}, {image object 2},....]

Image Element Object

property Type Description
src String URI of the link, should be fully calculated
text_alt String 'alt' attribute value of the image
text_alt_for_comparison String Normalized string that can be used for comparison of image alt text
longdesc String String content of the longdesc URL
width Integer width of image in pixels
height Integer height of image in pixels

Landmark Cache

An array of objects in document order with information about landmarks. The link object inherits from DOM Element Base Cache.

 OpenAjax.a11y.cache.landmarks = [{landmark object 1}, {landmark object 2},....]

Landmark Element Cache

property Type Description
children Array LandmarkObjects that are children of this LandmarkObject
parent Array LandmarkObject that is the parent of this LandmarkObject
text_accessible_name String Calculated accessible name for the landmark, including ALT attribute content of images
text_for_comparison String Accessible name string that has been normalized and converted to lower case for comparison purposes

Form Control Cache (under development)

An array of objects with information about form controls.

 OpenAjax.a11y.cache.html_controls = [{control object 1}, {control object 2},....]

Form Control Object

property Type Description
type String "text" | "select" | "textarea" | "button" | "checkbox" | "radio" | "reset" | "submit" | "password" | "file"
label String Text content of any associates label elements, including alt text for images, or title attribute
aria-label String String value of aria-labelledby references, aria-label attribute, can be empty
id String id attribute value of control, can be null
node Object Reference to the DOM node

Color Cache (under development)

An array of objects in document order with information about tables.

 OpenAjax.a11y.cache.colorcontrast = [{color object 1}, {color object 2},....]

Color Object

property Type Description
color Number Foreground color of text element
background Number background color of text element
contrast Number Contrast ration of foreground/background colors
font_size Number font size in in points
length Number number of characters in node
bold Boolean false
disabled Boolean false depending on part of a disabled widget
presentation Boolean false depending on part of a element with role=presentation
style_display String The calculated value of the CSS display property
style_visibility String The calculated value of the CSS visibility property
node Object reference to the DOM node of the table

Table Cache (under development)

An array of objects in document order with information about tables.

 OpenAjax.a11y.cache.tables = [{table object 1}, {table object 1},....]

Table Object

property Type Description
type String "layout" | "simple" | "complex"
caption String caption element content, including alt text from images
summary String summary attribute content of table element
rows Integer number of rows
columns Integer number of columns
node Object reference to the DOM node of the table

Rule and Cache Processing APIs

Consumers of the Rules

Browser Toolbar Developers (Inspection)

  • Visualizations of accessibility information
  • Information is transient
  • Teaching or learning about how rules apply to developers design patterns

Web App Developers (Auditing)

  • Reporting
  • Archiving
  • Correlating (Analysis) multiple results

OAA API Must Support the Following Use Cases

Configure ruleset for evaluation
  1. Select a ruleset
  2. Specify language
  3. Select rule filters (if any)
  4. Run selected rules of a ruleset on a document
  5. Select evaluation result filters by:
    • Severity (e.g. violations, manual check)
    • Result type
Generate an accessibility report for a document
  1. Provide progress information on rules processing
  2. Provide evaluation results (in XML, JSON and/or HTML formats)
    • For each requirement list the rules
      • For each rule in the requirement list the nodes that:
        1. Failed
        2. Passed
        3. Require manual checks
        4. Provide a means to identify each node in the list


Inspect a node of the document for accessibility issues
  1. For each node provide the following information:
  2. List of rules that fail
    • Provide information on why the node failed
  3. List of rules that pass
  4. List of rules that require manual evaluation
    • Provide data useful for performing manual evaluation for each rule (e.g. from DOM or other Element cache information)
  5. List of rules that met a node context, but did not meet test conditions
    • Provide information on what test conditions were not met


Inspect a class or group of nodes for accessibility issues
  1. Provide information to identify the nodes in the class or group of nodes
  2. For each member in the class or group of nodes, provide a list of:
    1. Rules that fail
      • Provide information on why each node failed
    2. Rules that pass
    3. Rules that require manual checks
      • Provide data useful for performing manual evaluations for the class or group of nodes (e.g. from DOM or other Element cache information)
    4. Rules that met the rule context, but did not meet test conditions
      • Provide information on why the test conditions were not met

Browser Tool APIs

  1. Manage Rulesets
    • Enumerate rulesets that are available
    • Validate ruleset and rules with respect to format
    • Add ruleset
    • Add rules to a ruleset(s)
    • Remove rules from a ruleset(s)
  2. Select Ruleset
    • for ruleset(id), disable rules ([rule_id1, rule_id2, ...])
    • for ruleset(id), add rule (requirementNumber, rule_object)
    • for ruleset(id), replace rule (rule_id, rule_object)
    • for ruleset(id), define minimum requirement level (requirementLevel)
  3. Traverse DOM to create data cache
    • Create data objects in cache (data and cache level test results)
  4. Evaluate and Process Ruleset
    • Use cache to provide data for rules
    • Provide information on ruleset evaluation progress (through call back function)
    • for each requirement in a ruleset:
      • for each rule in the requirement:
        • evaluate each node that is in the context of the rule and return a rule result object
    • for each rule result object add to rule results object
      • for each rule results object add to requirement results object
        • for each requirements results object add to ruleset results object
    • for each node in the DOM save rule results associated with that node
  5. Use of Evaluation Results
    • For a node in the DOM return evaluation results
      • Rules that passed
      • Rules that failed
      • Rules that require a manual check
      • Rules for which test conditions were not met
      • Information about the node or its context in the document important for evaluating manual checks
    • Use results to generate reports
      • Generate JSON and XML formatted evaluation result data
      • Generate an HTML report of evaluation results
  6. Triggers for updating evaluation
    • Change in ruleset or rules
    • DOM node not found in evaluation results
    • Time (after a certain amount of time update evaluation, user preference)
    • User Initiated Events
      • Keyboard events
      • Mouse events
    • Application Initiated changes in content
      • Time (after a certain amount of time update evaluation)
      • Changes in page or node content (DOM Mutation Events on specific nodes)

Cache and Evaluation Refresh Triggers

Potential sources of updates:

  • On focus changes
  • DOM node not found in cache
  • Timeout
  • Live regions
Personal tools