Detailed Usage Instructions for Functions in
"clc_fetch.js"
List of Functions
Detailed Usage Instructions
bool CLC_AcontainsB(DOM-Obj_A, DOM-Obj_B)
Input parameters:
- DOM-Obj_A - DOM-Obj that is being checked to see if it
contains B.
- DOM-Obj_B - DOM-Obj that is being checked to see if it
contained by A.
Return parameter:
- bool - This is true if DOM-Obj_A contains DOM-Obj_B;
else it is false.
Error messages:
Additional notes:
- This function compares A with each element of B's
lineage to determine if A is an object in B's lineage.
DOM-ObjArray CLC_AllDOMObjWithAttribute(DOM-ObjArray_Targ, DOM-Obj_Root, String_Attrib)
Input parameters:
- DOM-ObjArray_Targ - Array of DOM-Objs that needs to be added to if any DOM-Objs with the String_Attrib are found.
- DOM-Obj_Root - Starting DOM-Obj that is be examined to determine if it has the String_Attrib as an attribute. All of its childNodes (and their childNodes and so on) will be checked in the same manner.
- String_Attrib - String that is the text of the attribute to search for.
Return parameter:
- DOM-ObjArray - This returns an array of DOM-Objs that contain the desired attribute.
Error messages:
Additional notes:
int CLC_CompareLineages(Lineage_A, Lineage_B)
Input parameters:
- Lineage_A - The lineage that is used as the baseline
for measuring divergence.
- Lineage_B - The lineage that is being checked to see
where it diverges from the baseline.
Return parameter:
- int - The index value of Lineage_B at which Lineage_B
first diverges from Lineage_A.
Error messages:
Additional notes:
- If B does not diverge from A, the return value will be
-1.
- If B has more objects than A and is the same as A until
A runs out of objects, the return value will be the index
in B for the first object that B has which A does not
have.
- If B has fewer objects than A and is the same as A
until B runs out of objects, the return value will the the
length of B (ie, one more than the largest acceptable index
value of B).
DOM-Obj CLC_FindFocusable(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the most logical object to focus on since Firefox may not
be able to focus on the DOM-Obj_Target directly.
Return parameter:
- DOM-Obj - This DOM-Obj is something that Firefox can be
made to focus on.
Error messages:
Additional notes:
- Usually, the most logical object to focus on would be
the DOM-Obj closest to "DOM-Obj_Target" in the lineage for
"DOM-Obj_Target." However, if there is a link element in
the lineage, that will automatically take precedence in
order to make the link usable.
- If there is nothing focusable, the return value will be
null.
DOM-Obj CLC_FindHighlightable(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the most logical object that can be highlighted since
CLC_Highlight may not be able to highlight the
DOM-Obj_Target directly.
Return parameter:
- DOM-Obj - This DOM-Obj is something that can be
highlighted with CLC_Highlight.
Error messages:
Additional notes:
- For something to be highlightable, it must have the
style attribute.
- If there is nothing highlightable, the return value
will be null.
DOM-Obj CLC_FindScrollable(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the most logical object that can be scrolled to since it
may not be possible to scroll to the DOM-Obj_Target
directly.
Return parameter:
- DOM-Obj - This DOM-Obj is something that can be
scrolled to using Firefox's built in scrollTo
function.
Error messages:
Additional notes:
- For something to be scrollable, it must have the
offsetTop attribute. Anything with an offsetTop will have
an offsetLeft, so the existence of offsetLeft is
assumed.
- If there is nothing scrollable, the return value will
be null.
DOM-ObjArray CLC_GetAssociatedDescriptions(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the associated WAI-ARIA descriptions for.
Return parameter:
- DOM-ObjArray - Array of DOM-Objects which are descriptions for the specified target DOM object according to the WAI-ARIA "describedby" property.
Error messages:
Additional notes:
DOM-ObjArray CLC_GetAssociatedLabels(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the associated WAI-ARIA labels for.
Return parameter:
- DOM-ObjArray - Array of DOM-Objects which are labels for the specified target DOM object according to the WAI-ARIA "labelledby" property.
Error messages:
Additional notes:
- Note that this not get HTML label elements. This is only for the WAI-ARIA "labelledby" property.
DOM-Obj CLC_GetAtomicObjectAtCursor()
Input parameters:
Return parameter:
- DOM-Obj - This DOM-Obj is the atomic object that is
where the cursor is at.
Error messages:
Additional notes:
- If there is no atomic object at the cursor, the return
value will be null.
DOM-Obj CLC_GetClosestAncestorThatIs(DOM-Obj_Target, String_TagName)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the closest ancestor for.
- String_TagName - The tagname that the ancestor must have.
Return parameter:
- DOM-Obj - The ancestor that has the specified tagname and is the closest to the specified target DOM object.
Error messages:
Additional notes:
- If the object itself has this attribute, then the closest ancestor would be itself.
- If the tagname doesn't exist at all in the entire lineage, this function will return null.
DOM-Obj CLC_GetClosestAncestorWithAttribute(DOM-Obj_Target, String_AttributeName, String_AttributeValue)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the closest ancestor for.
- String_AttributeName - The attribute that the ancestor must have.
- String_AttributeValue - The value of that attribute
Return parameter:
- DOM-Obj - The ancestor that has the specified attribute with the specified value and is the closest to the specified target DOM object.
Error messages:
Additional notes:
- If the object itself has this attribute with this value, then the closest ancestor would be itself.
- If the tagname doesn't exist at all in the entire lineage, this function will return null.
string CLC_GetClosestAttributeOf(DOM-Obj_targ, String_targAttribute)
Input parameters:
- DOM-Obj_targ - The DOM-Object that you are trying to find the attribute value for.
- String_targAttribute - The name of the attribute that you are trying to find the attribute value for.
Return parameter:
- string - The value of the target attribute.
Error messages:
Additional notes:
- If the attribute doesn't exist at all in the entire lineage, the return value will be null.
string CLC_GetClosestNSAttributeOf(DOM-Obj_targ, String_NameSpace, String_targAttribute)
Input parameters:
- DOM-Obj_targ - The DOM-Object that you are trying to find the attribute value for.
- String_NameSpace - The namespace of the attribute.
- String_targAttribute - The name of the attribute that you are trying to find the attribute value for.
Return parameter:
- string - The value of the specified attribute which is under the specified namespace that is closest to the specified DOM object.
Error messages:
Additional notes:
- If the attribute doesn't exist at all in the entire lineage, the return value will be null.
DOM-ObjArray CLC_GetDescendentNodesWithAttribute(DOM-Obj_Target, String_AttributeName, String_AttributeValue)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to find
the descendents for.
- String_AttributeName - The attribute that the ancestor must have.
- String_AttributeValue - The value of that attribute
Return parameter:
- DOM-ObjArray - An array of DOM-Objects that have the specified attribute with the specified value and are descendents of DOM-Obj_Target
Error messages:
Additional notes:
DOM-Obj CLC_GetFirstAtomicObject(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to
retrieve the first atomic object from.
Return parameter:
- DOM-Obj - This DOM-Obj is atomic and has no child
nodes.
Error messages:
Additional notes:
- The DOM-Obj_Target may itself be atomic. If that is the
case, the returned DOM-Obj will the same as what you passed
in.
- The DOM-Obj_Target is not checked for validity. If you
pass in an invalid DOM-Obj_Target, the return result will
be the same as what you passed in.
DOM-Obj CLC_GetLastAtomicObject(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - DOM-Obj that you are trying to
retrieve the last atomic object from.
Return parameter:
- DOM-Obj - This DOM-Obj is atomic and has no child
nodes.
Error messages:
Additional notes:
- The DOM-Obj_Target may itself be atomic. If that is the
case, the returned DOM-Obj will the same as what you passed
in.
- The DOM-Obj_Target is not checked for validity. If you
pass in an invalid DOM-Obj_Target, the return result will
be the same as what you passed in.
lineage CLC_GetLineage(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - The DOM-Obj that you wish to retrieve
the lineage for.
Return parameter:
- lineage - The lineage of DOM-Obj_Target.
Error messages:
Additional notes:
- The lineage consists of the parentNode of
"DOM-Obj_Target," the parentNode of the parentNode of
"DOM-Obj_Target," etc.
- It is ordered such that "DOM-Obj_Target" will be the
last element of the array.
- This is a physical lineage.
lineage CLC_GetLogicalLineage(DOM-Obj_Target)
Input parameters:
- DOM-Obj_Target - The DOM-Obj that you wish to retrieve
the logical lineage for.
Return parameter:
- lineage - The logical lineage of DOM-Obj_Target.
Error messages:
Additional notes:
- The lineage consists of the logical parent of
"DOM-Obj_Target," the logical parent of the logical parent
of "DOM-Obj_Target," etc.
- It is ordered such that "DOM-Obj_Target" will be the
last element of the array.
- This is a logical lineage: parent-child relationships
may or may not be reflected in the actual DOM. Labels are
considered the parent of the inputs that they are labels
for, even though there is no parent-child relationship
visible in the DOM.
DOM-Obj
CLC_GetNextAtomicObject(DOM-Obj_CurrentAtomicObj)
Input parameters:
- DOM-Obj_CurrentAtomicObj - DOM-Obj that is the starting
point. It is assumed to be atomic and the function will
find and return the next DOM-Obj that is atomic.
Return parameter:
- DOM-Obj - The next atomic object that is found within
the Firefox JavaScript DOM. If there are no more atomic
objects, the return value will be a 0.
Error messages:
Additional notes:
- The atomic object that it returns does not have to be
in the same DOM-Obj that "DOM-Obj_CurrentAtomicObj" is
in.
- This function assumes that the
"DOM-Obj_CurrentAtomicObj" is atomic and will move on to
the next object. To ensure that you do not skip any nodes,
make sure that "DOM-Obj_CurrentAtomicObj" is really atomic.
This function will not verify the atomicity of
"DOM-Obj_CurrentAtomicObj."
- Text nodes in Firefox are atomic. Text nodes have a
nodeType of 3.
DOM-Obj
CLC_GetNextAtomicTextObject(DOM-Obj_CurrentAtomicObj)
Input parameters:
- DOM-Obj_CurrentAtomicObj - DOM-Obj that is the starting
point. It is assumed to be atomic and the function will
find and return the next DOM-Obj that is atomic and has
speakable text.
Return parameter:
- DOM-Obj - The next atomic object with speakable text
that is found within the Firefox JavaScript DOM. If there
are no more atomic objects, the return value will be a
0.
Error messages:
Additional notes:
- The atomic object that it returns does not have to be
in the same DOM-Obj that "DOM-Obj_CurrentAtomicObj" is
in.
- This function assumes that the
"DOM-Obj_CurrentAtomicObj" is atomic and will move on to
the previous object. To ensure that you do not skip any
nodes, make sure that "DOM-Obj_CurrentAtomicObj" is really
atomic. This function will not verify the atomicity of
"DOM-Obj_CurrentAtomicObj."
DOM-Obj
CLC_GetPrevAtomicObject(DOM-Obj_CurrentAtomicObj)
Input parameters:
- DOM-Obj_CurrentAtomicObj - DOM-Obj that is the starting
point. It is assumed to be atomic and the function will
find and return the previous DOM-Obj that is atomic.
Return parameter:
- DOM-Obj - The previous atomic object that is found
within the Firefox JavaScript DOM. If there are no more
atomic objects, the return value will be a 0.
Error messages:
Additional notes:
- The atomic object that it returns does not have to be
in the same DOM-Obj that "DOM-Obj_CurrentAtomicObj" is
in.
- This function assumes that the
"DOM-Obj_CurrentAtomicObj" is atomic and will move on to
the previous object. To ensure that you do not skip any
nodes, make sure that "DOM-Obj_CurrentAtomicObj" is really
atomic. This function will not verify the atomicity of
"DOM-Obj_CurrentAtomicObj."
- Text nodes in Firefox are atomic. Text nodes have a
nodeType of 3.
DOM-Obj
CLC_GetPrevAtomicTextObject(DOM-Obj_CurrentAtomicObj)
Input parameters:
- DOM-Obj_CurrentAtomicObj - DOM-Obj that is the starting
point. It is assumed to be atomic and the function will
find and return the previous DOM-Obj that is atomic and has
speakable text.
Return parameter:
- DOM-Obj - The previous atomic object with speakable
text that is found within the Firefox JavaScript DOM. If
there are no more atomic objects, the return value will be
a 0.
Error messages:
Additional notes:
- The atomic object that it returns does not have to be
in the same DOM-Obj that "DOM-Obj_CurrentAtomicObj" is
in.
- This function assumes that the
"DOM-Obj_CurrentAtomicObj" is atomic and will move on to
the previous object. To ensure that you do not skip any
nodes, make sure that "DOM-Obj_CurrentAtomicObj" is really
atomic. This function will not verify the atomicity of
"DOM-Obj_CurrentAtomicObj."
bool CLC_TagInLineage(Lineage_Target, String_Tag)
Input parameters:
- Lineage_Target - The lineage that holds the objects
being searched for "String_Tag."
- String_Tag - The HTML tag that is being searched
for.
Return parameter:
- bool - True if there is at least one object in
"Lineage_Target" that has the "String_Tag"; else, this is
false.
Error messages:
Additional notes: