1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/dom-level2-html/test_HTMLTableElement09.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,157 @@ 1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 1.5 +<html> 1.6 +<head> 1.7 +<META http-equiv="Content-Type" content="text/html; charset=UTF-8"> 1.8 +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> 1.9 +<title>http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLTableElement09</title> 1.10 +<link type="text/css" rel="stylesheet" href="/tests/SimpleTest/test.css"> 1.11 +<script src="/tests/SimpleTest/SimpleTest.js" type="text/javascript"></script> 1.12 +<script src="DOMTestCase.js" type="text/javascript"></script> 1.13 +<script type="text/javascript"> 1.14 +// expose test function names 1.15 +function exposeTestFunctionNames() 1.16 +{ 1.17 +return ['HTMLTableElement09']; 1.18 +} 1.19 + 1.20 +var docsLoaded = -1000000; 1.21 +var builder = null; 1.22 + 1.23 +// 1.24 +// This function is called by the testing framework before 1.25 +// running the test suite. 1.26 +// 1.27 +// If there are no configuration exceptions, asynchronous 1.28 +// document loading is started. Otherwise, the status 1.29 +// is set to complete and the exception is immediately 1.30 +// raised when entering the body of the test. 1.31 +// 1.32 +function setUpPage() { 1.33 + setUpPageStatus = 'running'; 1.34 + try { 1.35 + // 1.36 + // creates test document builder, may throw exception 1.37 + // 1.38 + builder = createConfiguredBuilder(); 1.39 + 1.40 + docsLoaded = 0; 1.41 + 1.42 + var docRef = null; 1.43 + if (typeof(this.doc) != 'undefined') { 1.44 + docRef = this.doc; 1.45 + } 1.46 + docsLoaded += preload(docRef, "doc", "table"); 1.47 + 1.48 + if (docsLoaded == 1) { 1.49 + setUpPage = 'complete'; 1.50 + } 1.51 + } catch(ex) { 1.52 + catchInitializationError(builder, ex); 1.53 + setUpPage = 'complete'; 1.54 + } 1.55 +} 1.56 + 1.57 + 1.58 + 1.59 +// 1.60 +// This method is called on the completion of 1.61 +// each asychronous load started in setUpTests. 1.62 +// 1.63 +// When every synchronous loaded document has completed, 1.64 +// the page status is changed which allows the 1.65 +// body of the test to be executed. 1.66 +function loadComplete() { 1.67 + if (++docsLoaded == 1) { 1.68 + setUpPageStatus = 'complete'; 1.69 + runJSUnitTests(); 1.70 + SimpleTest.finish(); 1.71 + } 1.72 +} 1.73 + 1.74 + 1.75 +/** 1.76 +* 1.77 + The tBodies attribute returns a collection of all the defined 1.78 + table bodies. 1.79 + 1.80 + Retrieve the tBodies attribute from the third TABLE element and 1.81 + examine the items of the returned collection. Tests multiple TBODY 1.82 + elements. 1.83 + 1.84 +* @author NIST 1.85 +* @author Mary Brady 1.86 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-63206416 1.87 +*/ 1.88 +function HTMLTableElement09() { 1.89 + var success; 1.90 + if(checkInitialization(builder, "HTMLTableElement09") != null) return; 1.91 + var nodeList; 1.92 + var tbodiesnodeList; 1.93 + var testNode; 1.94 + var doc; 1.95 + var tbodiesName; 1.96 + var vtbodies; 1.97 + var result = new Array(); 1.98 + 1.99 + expectedOptions = new Array(); 1.100 + expectedOptions[0] = "tbody"; 1.101 + expectedOptions[1] = "tbody"; 1.102 + expectedOptions[2] = "tbody"; 1.103 + 1.104 + 1.105 + var docRef = null; 1.106 + if (typeof(this.doc) != 'undefined') { 1.107 + docRef = this.doc; 1.108 + } 1.109 + doc = load(docRef, "doc", "table"); 1.110 + nodeList = doc.getElementsByTagName("table"); 1.111 + assertSize("Asize",3,nodeList); 1.112 +testNode = nodeList.item(2); 1.113 + tbodiesnodeList = testNode.tBodies; 1.114 + 1.115 + for(var indexN10066 = 0;indexN10066 < tbodiesnodeList.length; indexN10066++) { 1.116 + vtbodies = tbodiesnodeList.item(indexN10066); 1.117 + tbodiesName = vtbodies.nodeName; 1.118 + 1.119 + result[result.length] = tbodiesName; 1.120 + 1.121 + } 1.122 + assertEqualsListAutoCase("element", "tbodiesLink",expectedOptions,result); 1.123 + 1.124 +} 1.125 + 1.126 +</script> 1.127 +</head> 1.128 +<body> 1.129 +<h2>Test http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLTableElement09</h2> 1.130 +<p><test name='HTMLTableElement09' schemaLocation='http://www.w3.org/2001/DOM-Test-Suite/Level-1 dom1.xsd'><br> <metadata><br> <title>HTMLTableElement09</title> 1.131 +<br> <creator>NIST</creator> 1.132 +<br> <description> 1.133 + The tBodies attribute returns a collection of all the defined 1.134 + table bodies. 1.135 + 1.136 + Retrieve the tBodies attribute from the third TABLE element and 1.137 + examine the items of the returned collection. Tests multiple TBODY 1.138 + elements. 1.139 +</description> 1.140 +<br> <contributor>Mary Brady</contributor> 1.141 +<br> <date qualifier='created'>2002-02-22</date> 1.142 +<br> <subject resource='<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-63206416">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html#ID-63206416</a>'/> 1.143 +<br></metadata><br> <var name='nodeList' type='NodeList'/><br> <var name='tbodiesnodeList' type='HTMLCollection'/><br> <var name='testNode' type='Node'/><br> <var name='doc' type='Document'/><br> <var name='tbodiesName' type='DOMString'/><br> <var name='vtbodies' type='Node'/><br> <var name='result' type='List'/><br> <var name='expectedOptions' type='List'><br> <member/><br> <member/><br> <member/><br> </var><br> <load var='doc' href='table' willBeModified='false'/><br> <getElementsByTagName interface='Document' obj='doc' var='nodeList' tagname='"table"'/><br> <assertSize collection='nodeList' size='3' <a id="Asize">id='Asize'</a>/><br> <item interface='NodeList' obj='nodeList' var='testNode' index='2'/><br> <tBodies interface='HTMLTableElement' obj='testNode' var='tbodiesnodeList'/><br> <for-each collection='tbodiesnodeList' member='vtbodies'><br> <nodeName obj='vtbodies' var='tbodiesName'/><br> <append collection='result' item='tbodiesName'/><br> </for-each><br> <assertEquals actual='result' expected='expectedOptions' <a id="tbodiesLink">id='tbodiesLink'</a> ignoreCase='auto'/><br></test><br> 1.144 +</p> 1.145 +<p> 1.146 + Copyright (c) 2001-2004 World Wide Web Consortium, 1.147 + (Massachusetts Institute of Technology, Institut National de 1.148 + Recherche en Informatique et en Automatique, Keio University). All 1.149 + Rights Reserved. This program is distributed under the W3C's Software 1.150 + Intellectual Property License. This program is distributed in the 1.151 + hope that it will be useful, but WITHOUT ANY WARRANTY; without even 1.152 + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 1.153 + PURPOSE. 1.154 + </p> 1.155 +<p>See W3C License <a href="http://www.w3.org/Consortium/Legal/">http://www.w3.org/Consortium/Legal/</a> 1.156 + for more details.</p> 1.157 +<iframe name="doc" src="files/table.html"></iframe> 1.158 +<br> 1.159 +</body> 1.160 +</html>