//**************************************************************************
//
//
// National Institute Of Standards and Technology
// DTS Version 1.1
//
// HTMLAnchorElement Interface
//**************************************************************************
function HTMLAnchorElement()
{
var tests = new Array (HTML0001HANE(),HTML0002HANE(),HTML0003HANE(),HTML0004HANE(),HTML0005HANE(),HTML0006HANE(),HTML0007HANE(),HTML0008HANE(),HTML0009HANE(),HTML0010HANE(),HTML0011HANE(),HTML0012HANE(),HTML0013HANE(),HTML0014HANE());
return tests;
}
//------------------------ test case HTML-0001HANE -------------------------
//
// Testing feature - The "accessKey" attribute is a single character access
// key to give access to the form control.
//
// Testing approach - Retrieve the "accessKey" attribute from the A
// element of the testing document and examine its
// value. It Should be equal to "g".
//
// Semantic Requirements: 1
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0001HANE()
{
var computedValue = "";
var expectedValue = "G";
var results = "";
var testNode = "";
results = new testResults("HTML0001HANE");
results.description = "The \"accessKey\" attribute is a single "+
"character access key to give access to the "+
"form control.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "accessKey" attribute.
//
computedValue = testNode.node.accessKey;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0001HANE -------------------------
//
//------------------------ test case HTML-0002HANE -------------------------
//
// Testing feature - The "charset" attribute indicates the character
// encoding of the linked resource.
//
// Testing approach - Retrieve the "charset" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:2
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0002HANE()
{
var computedValue = "";
var expectedValue = "US-ASCII";
var results = "";
var testNode = "";
results = new testResults("HTML0002HANE");
results.description = "The \"charset\" attribute indicates the "+
"character encoding of the linked resource.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "charset" attribute.
//
computedValue = testNode.node.charset;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0002HANE -------------------------
//
//------------------------ test case HTML-0003HANE -------------------------
//
// Testing feature - The "coords" attribute is a comma-seperated list of
// lengths, defining an active region geometry.
//
// Testing approach - Retrieve the "coords" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:3
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0003HANE()
{
var computedValue = "";
var expectedValue = "0,0,100,100";
var results = "";
var testNode = "";
results = new testResults("HTML0003HANE");
results.description = "The \"coords\" attribute is a comma-seperated "+
"list of lengths, defining an active region "+
"geometry.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "coords" attribute.
//
computedValue = testNode.node.coords;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0003HANE -------------------------
//
//------------------------ test case HTML-0004HANE -------------------------
//
// Testing feature - The "href" attribute contains the URL of the linked
// resource.
//
// Testing approach - Retrieve the "href" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:4
//
// Last modification date - October 5, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0004HANE()
{
var computedValue = "";
var expectedValue = "HTTP://XW2K.SDCT.ITL.NIST.GOV/BRADY/DOM/PIX/SUBMIT.GIF";
var results = "";
var testNode = "";
results = new testResults("HTML0004HANE");
results.description = "The \"href\" attribute contains the URL of the "+
"linked resource.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "href" attribute.
//
computedValue = testNode.node.href;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0004HANE -------------------------
//------------------------ test case HTML-0005HANE -------------------------
//
// Testing feature - The "hreflang" attribute contains the language code
// of the linked resource.
//
// Testing approach - Retrieve the "hreflang" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:5
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0005HANE()
{
var computedValue = "";
var expectedValue = "EN";
var results = "";
var testNode = "";
results = new testResults("HTML0005HANE");
results.description = "The \"hreflang\" attribute contains the language "+
"code of the linked resource.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "hreflang" attribute.
//
computedValue = testNode.node.hreflang;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0005HANE -------------------------
//
//------------------------ test case HTML-0006HANE -------------------------
//
// Testing feature - The "name" attribute contains the anchor name.
//
// Testing approach - Retrieve the "name" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:6
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0006HANE()
{
var computedValue = "";
var expectedValue = "ANCHOR";
var results = "";
var testNode = "";
results = new testResults("HTML0006HANE");
results.description = "The \"name\" attribute contains the anchor name.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "name" attribute.
//
computedValue = testNode.node.name;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0006HANE -------------------------
//
//------------------------ test case HTML-0007HANE -------------------------
//
// Testing feature - The "rel" attribute contains the forward link type.
//
// Testing approach - Retrieve the "rel" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:7
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0007HANE()
{
var computedValue = "";
var expectedValue = "GLOSSARY";
var results = "";
var testNode = "";
results = new testResults("HTML0007HANE");
results.description = "The \"rel\" attribute contains the forward "+
"link type.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "rel" attribute.
//
computedValue = testNode.node.rel;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0007HANE -------------------------
//
//------------------------ test case HTML-0008HANE -------------------------
//
// Testing feature - The "rev" attribute contains the reverse link type.
//
// Testing approach - Retrieve the "rev" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:8
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0008HANE()
{
var computedValue = "";
var expectedValue = "STYLESHEET";
var results = "";
var testNode = "";
results = new testResults("HTML0008HANE");
results.description = "The \"rev\" attribute contains the reverse link "+
"type.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "rev" attribute.
//
computedValue = testNode.node.rev;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0008HANE -------------------------
//
//------------------------ test case HTML-0009HANE -------------------------
//
// Testing feature - The "shape" attribute contains the shape of the
// active area.
//
// Testing approach - Retrieve the "shape" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements:9
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0009HANE()
{
var computedValue = "";
var expectedValue = "RECT";
var results = "";
var testNode = "";
results = new testResults("HTML0009HANE");
results.description = "The \"shape\" attribute contains the shape of the "+
"active area.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "shape" attribute.
//
computedValue = testNode.node.shape;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0009HANE -------------------------
//
//------------------------ test case HTML-0010HANE -------------------------
//
// Testing feature - The "tabIndex" attribute contains an index that
// represents the element's position in the tabbing order.
//
// Testing approach - Retrieve the "tabIndex" attribute from the A
// element of the testing document and examine its
// value. It should be equal to 22.
//
// Semantic Requirements: 10
//
// Last modification date - October 25, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0010HANE()
{
var computedValue = "";
var expectedValue = 22;
var results = "";
var testNode = "";
results = new testResults("HTML0010HANE");
results.description = "The \"tabIndex\" attribute contains an index "+
"represents the element's position in the "+
"tabbing order.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "tabIndex" attribute.
//
computedValue = testNode.node.tabIndex;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0010HANE -------------------------
//
//------------------------ test case HTML-0011HANE -------------------------
//
// Testing feature - The "target" attribute contains the frame to
// render the source in.
//
// Testing approach - Retrieve the "target" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements: 11
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0011HANE()
{
var computedValue = "";
var expectedValue = "_BLANK";
var results = "";
var testNode = "";
results = new testResults("HTML0011HANE");
results.description = "The \"target\" attribute contains the frame to "+
"render the source in.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "target" attribute.
//
computedValue = testNode.node.target;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0011HANE -------------------------
//
//------------------------ test case HTML-0012HANE -------------------------
//
// Testing feature - The "type" attribute contains the advisory content model.
//
// Testing approach - Retrieve the "type" attribute from the A
// element of the testing document and examine its
// value.
//
// Semantic Requirements: 12
//
// Last modification date - September 15, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0012HANE()
{
var computedValue = "";
var expectedValue = "IMAGE/GIF";
var results = "";
var testNode = "";
results = new testResults("HTML0012HANE");
results.description = "The \"type\" attribute contains the advisory "+
"content model.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Access its "type" attribute.
//
computedValue = testNode.node.type;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0012HANE -------------------------
//
//------------------------ test case HTML-0013HANE -------------------------
//
// Testing feature - The "blur()" method removes keyboard focus from this
// element.
//
// Testing approach - Retrieve the first Anchor element from the testing
// document and invoke its "blur()" method. Upon
// invocation of this method, the element should become
// "blurred". This should trigger an "onblur" event that
// will invoke the "setIdBlur()" function which changes the
// element's id attribute to "newId_Blur".
//
// Semantic Requirements: 13
//
// Last modification date - October 25, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0013HANE()
{
var computedValue = "";
var expectedValue = "NEWID_BLUR";
var results = "";
var testNode = "";
results = new testResults("HTML0013HANE");
results.description = "The \"blur()\" method removes keyboard focus "+
"focus from this element.";
//
// Retrieve targeted data
//
testNode = new HTMLNodeObject (ANCHOR,FIRST);
//
// Invoke its blur() method.
//
testNode.node.blur();
computedValue = testNode.node.id;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
// resetHTMLData();
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0013HANE -------------------------
//
//------------------------ test case HTML-0014HANE -------------------------
//
// Testing feature - The "focus()" method gives keyboard focus to this
// element.
//
// Testing approach - Retrieve the first ANCHOR element from the testing
// document and invoke its "focus()" method. upon this
// method being invoked, focus should be given to
// this element. This should trigger an "onfocus" event
// that will invoke the "setDir()" function which changes the
// element's dir attribute to to "RTL".
//
// Semantic Requirements: 14
//
// Last modification date - October 25, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0014HANE()
{
var computedValue = "";
var expectedValue = "RTL";
var results = "";
var testNode = "";
results = new testResults("HTML0014HANE");
results.description = "The \"focus()\" method gives keyboard focus to "+
"this element.";
//
// Retrieve targeted data
//
testNode = new HTMLNodeObject(ANCHOR,FIRST);
//
// Invoke its focus() method.
//
testNode.node.focus();
computedValue = testNode.node.dir;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
resetHTMLData();
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//--------------------- End test case HTML-0014HANE -------------------------