//**************************************************************************
//
//
// National Institute Of Standards and Technology
// DTS Version 1.1
//
// HTMLLabelElement Interface
//**************************************************************************
function HTMLLabelElement()
{
var tests = new Array (HTML0001LE(),HTML0002LE(),HTML0003LE(),HTML0004LE());
return tests;
}
//------------------------ test case HTML-0001LE-------------------------
//
// Testing feature - The "form" attribute returns the FORM containing
// this control.
//
// Testing approach - Retrieve the "form" attribute of the first LABEL
// element of the testing document and examine its
// value. It should be equal to an HTMLFormElement
// whose name attribute is "form1".
//
// Semantic Requirements: 1
//
// Last modification date - November 01, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0001LE()
{
var computedValue = "";
var expectedValue = "FORM1";
var results = "";
var testNode = "";
results = new testResults("HTML0001LE");
results.description = "The \"form\" attribute returns the FORM containing "+
"this control.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LABEL,FIRST);
//
// and access attribute.
//
// computedValue = testNode.node.form.id;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//----------------------- End test case HTML-0001LE -------------------
//
//---------------------- test case HTML-0002LE -------------------
//
// Testing feature - The "form" attribute returns null if this control
// is not within the context of a form.
//
// Testing approach - Retrieve the "form" attribute of the first LABEL
// element of the testing document and examine its
// value. It should be equal to null.
//
// Semantic Requirements: 2
//
// Last modification date - October 6, 1999
//
// Written by: Carmelo Montanez
//----------------------------------------------------------------------------
function HTML0002LE()
{
var computedValue = "";
var expectedValue = null;
var results = "";
var testNode = "";
results = new testResults("HTML0002LE");
results.description = "The \"form\" attribute returns null if the control "+
"is not within the context of a form.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LABEL,SECOND);
//
// and access attribute.
//
computedValue = testNode.node.form;
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0002LE ------------------------
//
//------------------------ test case HTML-0003LE -------------------------
//
// Testing feature - The "accessKey" attribute is a single character
// access key to give access to the form control.
//
// Testing approach - Retrieve the "acessKey" attribute of the first LABEL
// element of the testing document and examine its
// value. It should be equal to "b".
//
// Semantic Requirements: 3
//
// Last modification date - October 6, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0003LE()
{
var computedValue = "";
var expectedValue = "B";
var results = "";
var testNode = "";
results = new testResults("HTML0003LE");
results.description = "The \"accessKey\" attribute is a single "+
"character access key to give access to the "+
"form control.";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LABEL,FIRST);
//
// and access attribute.
//
computedValue = testNode.node.accessKey;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0003LE ----------------------
//
//------------------------ test case HTML-0004LE ----------------------
//
// Testing feature - The "htmlFor" attribute links this label with another
// form control by id attribute.
//
// Testing approach - Retrieve the "htmlFor" attribute of the first LABEL
// element of the testing document and examine its
// value. It should be equal to "input1".
//
// Semantic Requirements: 4
//
// Last modification date - October 6, 1999
//
// Written by: Mark LaRoy Zimmerman
//----------------------------------------------------------------------------
function HTML0004LE()
{
var computedValue = "";
var expectedValue = "INPUT1";
var results = "";
var testNode = "";
results = new testResults("HTML0004LE");
results.description = "The \"htmlFor\" attribute links this label with "+
"another form control by id attribute";
//
// Retrieve targeted data.
//
testNode = new HTMLNodeObject(LABEL,FIRST);
//
// and access attribute.
//
computedValue = testNode.node.htmlFor;
computedValue = computedValue.toUpperCase();
//
// Write out results
//
results.expected = expectedValue;
results.actual = computedValue;
return results;
}
//------------------------ End test case HTML-0004LE ------------------------