From 033f36aa7125b327c65c4bc23d694ce5274f8224 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Fri, 9 Jul 2010 16:02:34 +0100 Subject: Add dom/xhtml/level1 layout tests at WebKit r62496 These all pass. Change-Id: If26268844fe87cd6ed8d0fc823ecf59b6eab1938 --- .../core/documentgetdoctypenodtd-expected.txt | 2 + .../xhtml/level1/core/documentgetdoctypenodtd.js | 110 ++ .../level1/core/documentgetdoctypenodtd.xhtml | 10 + ...alidcharacterexceptioncreateentref-expected.txt | 2 + ...ocumentinvalidcharacterexceptioncreateentref.js | 143 +++ ...mentinvalidcharacterexceptioncreateentref.xhtml | 60 + ...lidcharacterexceptioncreateentref1-expected.txt | 2 + ...cumentinvalidcharacterexceptioncreateentref1.js | 140 +++ ...entinvalidcharacterexceptioncreateentref1.xhtml | 60 + ...tinvalidcharacterexceptioncreatepi-expected.txt | 2 + .../documentinvalidcharacterexceptioncreatepi.js | 143 +++ ...documentinvalidcharacterexceptioncreatepi.xhtml | 60 + ...invalidcharacterexceptioncreatepi1-expected.txt | 2 + .../documentinvalidcharacterexceptioncreatepi1.js | 140 +++ ...ocumentinvalidcharacterexceptioncreatepi1.xhtml | 60 + .../level1/core/hc_attrappendchild1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrappendchild1.js | 132 +++ .../xhtml/level1/core/hc_attrappendchild1.xhtml | 60 + .../level1/core/hc_attrappendchild2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrappendchild2.js | 127 ++ .../xhtml/level1/core/hc_attrappendchild2.xhtml | 60 + .../level1/core/hc_attrappendchild3-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrappendchild3.js | 138 +++ .../xhtml/level1/core/hc_attrappendchild3.xhtml | 60 + .../level1/core/hc_attrappendchild4-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrappendchild4.js | 152 +++ .../xhtml/level1/core/hc_attrappendchild4.xhtml | 60 + .../level1/core/hc_attrappendchild5-expected.txt | 3 + .../dom/xhtml/level1/core/hc_attrappendchild5.js | 141 +++ .../xhtml/level1/core/hc_attrappendchild5.xhtml | 60 + .../level1/core/hc_attrappendchild6-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrappendchild6.js | 127 ++ .../xhtml/level1/core/hc_attrappendchild6.xhtml | 60 + .../level1/core/hc_attrchildnodes1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrchildnodes1.js | 124 ++ .../dom/xhtml/level1/core/hc_attrchildnodes1.xhtml | 60 + .../level1/core/hc_attrchildnodes2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrchildnodes2.js | 130 +++ .../dom/xhtml/level1/core/hc_attrchildnodes2.xhtml | 60 + .../level1/core/hc_attrclonenode1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrclonenode1.js | 132 +++ .../dom/xhtml/level1/core/hc_attrclonenode1.xhtml | 60 + .../hc_attrcreatedocumentfragment-expected.txt | 2 + .../level1/core/hc_attrcreatedocumentfragment.js | 138 +++ .../core/hc_attrcreatedocumentfragment.xhtml | 60 + .../level1/core/hc_attrcreatetextnode-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrcreatetextnode.js | 127 ++ .../xhtml/level1/core/hc_attrcreatetextnode.xhtml | 60 + .../core/hc_attrcreatetextnode2-expected.txt | 2 + .../xhtml/level1/core/hc_attrcreatetextnode2.js | 127 ++ .../xhtml/level1/core/hc_attrcreatetextnode2.xhtml | 60 + .../level1/core/hc_attreffectivevalue-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attreffectivevalue.js | 118 ++ .../xhtml/level1/core/hc_attreffectivevalue.xhtml | 60 + .../level1/core/hc_attrfirstchild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrfirstchild.js | 127 ++ .../dom/xhtml/level1/core/hc_attrfirstchild.xhtml | 60 + .../level1/core/hc_attrgetvalue1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrgetvalue1.js | 117 ++ .../dom/xhtml/level1/core/hc_attrgetvalue1.xhtml | 60 + .../level1/core/hc_attrgetvalue2-expected.txt | 3 + .../dom/xhtml/level1/core/hc_attrgetvalue2.js | 146 +++ .../dom/xhtml/level1/core/hc_attrgetvalue2.xhtml | 60 + .../level1/core/hc_attrhaschildnodes-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrhaschildnodes.js | 114 ++ .../xhtml/level1/core/hc_attrhaschildnodes.xhtml | 60 + .../level1/core/hc_attrinsertbefore1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrinsertbefore1.js | 140 +++ .../xhtml/level1/core/hc_attrinsertbefore1.xhtml | 60 + .../level1/core/hc_attrinsertbefore2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrinsertbefore2.js | 141 +++ .../xhtml/level1/core/hc_attrinsertbefore2.xhtml | 60 + .../level1/core/hc_attrinsertbefore3-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrinsertbefore3.js | 146 +++ .../xhtml/level1/core/hc_attrinsertbefore3.xhtml | 60 + .../level1/core/hc_attrinsertbefore4-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrinsertbefore4.js | 147 +++ .../xhtml/level1/core/hc_attrinsertbefore4.xhtml | 60 + .../level1/core/hc_attrinsertbefore5-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrinsertbefore5.js | 153 +++ .../xhtml/level1/core/hc_attrinsertbefore5.xhtml | 60 + .../level1/core/hc_attrinsertbefore6-expected.txt | 3 + .../dom/xhtml/level1/core/hc_attrinsertbefore6.js | 142 +++ .../xhtml/level1/core/hc_attrinsertbefore6.xhtml | 60 + .../level1/core/hc_attrinsertbefore7-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrinsertbefore7.js | 160 +++ .../xhtml/level1/core/hc_attrinsertbefore7.xhtml | 60 + .../level1/core/hc_attrlastchild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrlastchild.js | 127 ++ .../dom/xhtml/level1/core/hc_attrlastchild.xhtml | 60 + .../dom/xhtml/level1/core/hc_attrname-expected.txt | 2 + LayoutTests/dom/xhtml/level1/core/hc_attrname.js | 123 ++ .../dom/xhtml/level1/core/hc_attrname.xhtml | 60 + .../core/hc_attrnextsiblingnull-expected.txt | 2 + .../xhtml/level1/core/hc_attrnextsiblingnull.js | 118 ++ .../xhtml/level1/core/hc_attrnextsiblingnull.xhtml | 60 + .../level1/core/hc_attrnormalize-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrnormalize.js | 133 +++ .../dom/xhtml/level1/core/hc_attrnormalize.xhtml | 60 + .../level1/core/hc_attrparentnodenull-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrparentnodenull.js | 118 ++ .../xhtml/level1/core/hc_attrparentnodenull.xhtml | 60 + .../core/hc_attrprevioussiblingnull-expected.txt | 2 + .../level1/core/hc_attrprevioussiblingnull.js | 118 ++ .../level1/core/hc_attrprevioussiblingnull.xhtml | 60 + .../level1/core/hc_attrremovechild1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrremovechild1.js | 131 +++ .../xhtml/level1/core/hc_attrremovechild1.xhtml | 60 + .../level1/core/hc_attrremovechild2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrremovechild2.js | 126 ++ .../xhtml/level1/core/hc_attrremovechild2.xhtml | 60 + .../level1/core/hc_attrreplacechild1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrreplacechild1.js | 135 +++ .../xhtml/level1/core/hc_attrreplacechild1.xhtml | 60 + .../level1/core/hc_attrreplacechild2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrreplacechild2.js | 141 +++ .../xhtml/level1/core/hc_attrreplacechild2.xhtml | 60 + .../level1/core/hc_attrsetvalue1-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrsetvalue1.js | 135 +++ .../dom/xhtml/level1/core/hc_attrsetvalue1.xhtml | 60 + .../level1/core/hc_attrsetvalue2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrsetvalue2.js | 138 +++ .../dom/xhtml/level1/core/hc_attrsetvalue2.xhtml | 60 + .../level1/core/hc_attrspecifiedvalue-expected.txt | 2 + .../dom/xhtml/level1/core/hc_attrspecifiedvalue.js | 121 ++ .../xhtml/level1/core/hc_attrspecifiedvalue.xhtml | 60 + .../core/hc_attrspecifiedvaluechanged-expected.txt | 2 + .../level1/core/hc_attrspecifiedvaluechanged.js | 123 ++ .../level1/core/hc_attrspecifiedvaluechanged.xhtml | 60 + .../core/hc_characterdataappenddata-expected.txt | 2 + .../level1/core/hc_characterdataappenddata.js | 124 ++ .../level1/core/hc_characterdataappenddata.xhtml | 60 + .../hc_characterdataappenddatagetdata-expected.txt | 2 + .../core/hc_characterdataappenddatagetdata.js | 123 ++ .../core/hc_characterdataappenddatagetdata.xhtml | 60 + ...hc_characterdatadeletedatabegining-expected.txt | 2 + .../core/hc_characterdatadeletedatabegining.js | 122 ++ .../core/hc_characterdatadeletedatabegining.xhtml | 60 + .../hc_characterdatadeletedataend-expected.txt | 2 + .../level1/core/hc_characterdatadeletedataend.js | 123 ++ .../core/hc_characterdatadeletedataend.xhtml | 60 + ...aracterdatadeletedataexceedslength-expected.txt | 2 + .../hc_characterdatadeletedataexceedslength.js | 125 ++ .../hc_characterdatadeletedataexceedslength.xhtml | 60 + ...cterdatadeletedatagetlengthanddata-expected.txt | 2 + .../hc_characterdatadeletedatagetlengthanddata.js | 132 +++ ...c_characterdatadeletedatagetlengthanddata.xhtml | 60 + .../hc_characterdatadeletedatamiddle-expected.txt | 2 + .../core/hc_characterdatadeletedatamiddle.js | 123 ++ .../core/hc_characterdatadeletedatamiddle.xhtml | 60 + .../core/hc_characterdatagetdata-expected.txt | 2 + .../xhtml/level1/core/hc_characterdatagetdata.js | 124 ++ .../level1/core/hc_characterdatagetdata.xhtml | 60 + .../core/hc_characterdatagetlength-expected.txt | 2 + .../xhtml/level1/core/hc_characterdatagetlength.js | 119 ++ .../level1/core/hc_characterdatagetlength.xhtml | 60 + ...ndexsizeerrdeletedatacountnegative-expected.txt | 2 + ...acterdataindexsizeerrdeletedatacountnegative.js | 130 +++ ...erdataindexsizeerrdeletedatacountnegative.xhtml | 60 + ...ndexsizeerrdeletedataoffsetgreater-expected.txt | 2 + ...acterdataindexsizeerrdeletedataoffsetgreater.js | 131 +++ ...erdataindexsizeerrdeletedataoffsetgreater.xhtml | 60 + ...dexsizeerrdeletedataoffsetnegative-expected.txt | 2 + ...cterdataindexsizeerrdeletedataoffsetnegative.js | 130 +++ ...rdataindexsizeerrdeletedataoffsetnegative.xhtml | 60 + ...ndexsizeerrinsertdataoffsetgreater-expected.txt | 2 + ...acterdataindexsizeerrinsertdataoffsetgreater.js | 130 +++ ...erdataindexsizeerrinsertdataoffsetgreater.xhtml | 60 + ...dexsizeerrinsertdataoffsetnegative-expected.txt | 2 + ...cterdataindexsizeerrinsertdataoffsetnegative.js | 129 ++ ...rdataindexsizeerrinsertdataoffsetnegative.xhtml | 60 + ...dexsizeerrreplacedatacountnegative-expected.txt | 2 + ...cterdataindexsizeerrreplacedatacountnegative.js | 131 +++ ...rdataindexsizeerrreplacedatacountnegative.xhtml | 60 + ...dexsizeerrreplacedataoffsetgreater-expected.txt | 2 + ...cterdataindexsizeerrreplacedataoffsetgreater.js | 131 +++ ...rdataindexsizeerrreplacedataoffsetgreater.xhtml | 60 + ...exsizeerrreplacedataoffsetnegative-expected.txt | 2 + ...terdataindexsizeerrreplacedataoffsetnegative.js | 131 +++ ...dataindexsizeerrreplacedataoffsetnegative.xhtml | 60 + ...indexsizeerrsubstringcountnegative-expected.txt | 2 + ...racterdataindexsizeerrsubstringcountnegative.js | 130 +++ ...terdataindexsizeerrsubstringcountnegative.xhtml | 60 + ...ndexsizeerrsubstringnegativeoffset-expected.txt | 2 + ...acterdataindexsizeerrsubstringnegativeoffset.js | 130 +++ ...erdataindexsizeerrsubstringnegativeoffset.xhtml | 60 + ...indexsizeerrsubstringoffsetgreater-expected.txt | 2 + ...racterdataindexsizeerrsubstringoffsetgreater.js | 131 +++ ...terdataindexsizeerrsubstringoffsetgreater.xhtml | 60 + ...c_characterdatainsertdatabeginning-expected.txt | 2 + .../core/hc_characterdatainsertdatabeginning.js | 122 ++ .../core/hc_characterdatainsertdatabeginning.xhtml | 60 + .../hc_characterdatainsertdataend-expected.txt | 2 + .../level1/core/hc_characterdatainsertdataend.js | 123 ++ .../core/hc_characterdatainsertdataend.xhtml | 60 + .../hc_characterdatainsertdatamiddle-expected.txt | 2 + .../core/hc_characterdatainsertdatamiddle.js | 123 ++ .../core/hc_characterdatainsertdatamiddle.xhtml | 60 + ...c_characterdatareplacedatabegining-expected.txt | 2 + .../core/hc_characterdatareplacedatabegining.js | 122 ++ .../core/hc_characterdatareplacedatabegining.xhtml | 60 + .../hc_characterdatareplacedataend-expected.txt | 2 + .../level1/core/hc_characterdatareplacedataend.js | 123 ++ .../core/hc_characterdatareplacedataend.xhtml | 60 + ...rdatareplacedataexceedslengthofarg-expected.txt | 2 + ...c_characterdatareplacedataexceedslengthofarg.js | 124 ++ ...haracterdatareplacedataexceedslengthofarg.xhtml | 60 + ...datareplacedataexceedslengthofdata-expected.txt | 2 + ..._characterdatareplacedataexceedslengthofdata.js | 122 ++ ...aracterdatareplacedataexceedslengthofdata.xhtml | 60 + .../hc_characterdatareplacedatamiddle-expected.txt | 2 + .../core/hc_characterdatareplacedatamiddle.js | 123 ++ .../core/hc_characterdatareplacedatamiddle.xhtml | 60 + .../core/hc_characterdatasetnodevalue-expected.txt | 2 + .../level1/core/hc_characterdatasetnodevalue.js | 122 ++ .../level1/core/hc_characterdatasetnodevalue.xhtml | 60 + ...characterdatasubstringexceedsvalue-expected.txt | 2 + .../core/hc_characterdatasubstringexceedsvalue.js | 120 ++ .../hc_characterdatasubstringexceedsvalue.xhtml | 60 + .../hc_characterdatasubstringvalue-expected.txt | 2 + .../level1/core/hc_characterdatasubstringvalue.js | 119 ++ .../core/hc_characterdatasubstringvalue.xhtml | 60 + .../level1/core/hc_commentgetcomment-expected.txt | 2 + .../dom/xhtml/level1/core/hc_commentgetcomment.js | 144 +++ .../xhtml/level1/core/hc_commentgetcomment.xhtml | 60 + .../core/hc_documentcreateattribute-expected.txt | 2 + .../level1/core/hc_documentcreateattribute.js | 122 ++ .../level1/core/hc_documentcreateattribute.xhtml | 60 + .../core/hc_documentcreatecomment-expected.txt | 2 + .../xhtml/level1/core/hc_documentcreatecomment.js | 120 ++ .../level1/core/hc_documentcreatecomment.xhtml | 60 + .../hc_documentcreatedocumentfragment-expected.txt | 2 + .../core/hc_documentcreatedocumentfragment.js | 126 ++ .../core/hc_documentcreatedocumentfragment.xhtml | 60 + .../core/hc_documentcreateelement-expected.txt | 2 + .../xhtml/level1/core/hc_documentcreateelement.js | 121 ++ .../level1/core/hc_documentcreateelement.xhtml | 60 + ...documentcreateelementcasesensitive-expected.txt | 2 + .../core/hc_documentcreateelementcasesensitive.js | 132 +++ .../hc_documentcreateelementcasesensitive.xhtml | 60 + .../core/hc_documentcreatetextnode-expected.txt | 2 + .../xhtml/level1/core/hc_documentcreatetextnode.js | 120 ++ .../level1/core/hc_documentcreatetextnode.xhtml | 60 + .../level1/core/hc_documentgetdoctype-expected.txt | 2 + .../dom/xhtml/level1/core/hc_documentgetdoctype.js | 149 +++ .../xhtml/level1/core/hc_documentgetdoctype.xhtml | 60 + ...documentgetelementsbytagnamelength-expected.txt | 2 + .../core/hc_documentgetelementsbytagnamelength.js | 110 ++ .../hc_documentgetelementsbytagnamelength.xhtml | 60 + ...entgetelementsbytagnametotallength-expected.txt | 2 + .../hc_documentgetelementsbytagnametotallength.js | 221 ++++ ...c_documentgetelementsbytagnametotallength.xhtml | 60 + ..._documentgetelementsbytagnamevalue-expected.txt | 2 + .../core/hc_documentgetelementsbytagnamevalue.js | 120 ++ .../hc_documentgetelementsbytagnamevalue.xhtml | 60 + .../core/hc_documentgetimplementation-expected.txt | 2 + .../level1/core/hc_documentgetimplementation.js | 126 ++ .../level1/core/hc_documentgetimplementation.xhtml | 60 + .../core/hc_documentgetrootnode-expected.txt | 2 + .../xhtml/level1/core/hc_documentgetrootnode.js | 123 ++ .../xhtml/level1/core/hc_documentgetrootnode.xhtml | 60 + ...dcharacterexceptioncreateattribute-expected.txt | 2 + ...mentinvalidcharacterexceptioncreateattribute.js | 124 ++ ...tinvalidcharacterexceptioncreateattribute.xhtml | 60 + ...characterexceptioncreateattribute1-expected.txt | 2 + ...entinvalidcharacterexceptioncreateattribute1.js | 117 ++ ...invalidcharacterexceptioncreateattribute1.xhtml | 60 + ...lidcharacterexceptioncreateelement-expected.txt | 2 + ...cumentinvalidcharacterexceptioncreateelement.js | 124 ++ ...entinvalidcharacterexceptioncreateelement.xhtml | 60 + ...idcharacterexceptioncreateelement1-expected.txt | 2 + ...umentinvalidcharacterexceptioncreateelement1.js | 117 ++ ...ntinvalidcharacterexceptioncreateelement1.xhtml | 60 + ..._domimplementationfeaturenoversion-expected.txt | 2 + .../core/hc_domimplementationfeaturenoversion.js | 126 ++ .../hc_domimplementationfeaturenoversion.xhtml | 60 + .../hc_domimplementationfeaturenull-expected.txt | 2 + .../level1/core/hc_domimplementationfeaturenull.js | 129 ++ .../core/hc_domimplementationfeaturenull.xhtml | 60 + .../hc_domimplementationfeaturexml-expected.txt | 2 + .../level1/core/hc_domimplementationfeaturexml.js | 125 ++ .../core/hc_domimplementationfeaturexml.xhtml | 60 + .../core/hc_elementaddnewattribute-expected.txt | 2 + .../xhtml/level1/core/hc_elementaddnewattribute.js | 117 ++ .../level1/core/hc_elementaddnewattribute.xhtml | 60 + .../hc_elementassociatedattribute-expected.txt | 2 + .../level1/core/hc_elementassociatedattribute.js | 119 ++ .../core/hc_elementassociatedattribute.xhtml | 60 + .../hc_elementchangeattributevalue-expected.txt | 2 + .../level1/core/hc_elementchangeattributevalue.js | 119 ++ .../core/hc_elementchangeattributevalue.xhtml | 60 + .../core/hc_elementcreatenewattribute-expected.txt | 2 + .../level1/core/hc_elementcreatenewattribute.js | 124 ++ .../level1/core/hc_elementcreatenewattribute.xhtml | 60 + .../core/hc_elementgetattributenode-expected.txt | 2 + .../level1/core/hc_elementgetattributenode.js | 114 ++ .../level1/core/hc_elementgetattributenode.xhtml | 60 + .../hc_elementgetattributenodenull-expected.txt | 2 + .../level1/core/hc_elementgetattributenodenull.js | 115 ++ .../core/hc_elementgetattributenodenull.xhtml | 60 + .../core/hc_elementgetelementempty-expected.txt | 2 + .../xhtml/level1/core/hc_elementgetelementempty.js | 123 ++ .../level1/core/hc_elementgetelementempty.xhtml | 60 + .../hc_elementgetelementsbytagname-expected.txt | 2 + .../level1/core/hc_elementgetelementsbytagname.js | 112 ++ .../core/hc_elementgetelementsbytagname.xhtml | 60 + ...getelementsbytagnameaccessnodelist-expected.txt | 2 + ...hc_elementgetelementsbytagnameaccessnodelist.js | 144 +++ ...elementgetelementsbytagnameaccessnodelist.xhtml | 60 + ...elementgetelementsbytagnamenomatch-expected.txt | 2 + .../core/hc_elementgetelementsbytagnamenomatch.js | 110 ++ .../hc_elementgetelementsbytagnamenomatch.xhtml | 60 + ...ntgetelementsbytagnamespecialvalue-expected.txt | 2 + .../hc_elementgetelementsbytagnamespecialvalue.js | 134 +++ ...c_elementgetelementsbytagnamespecialvalue.xhtml | 60 + .../level1/core/hc_elementgettagname-expected.txt | 2 + .../dom/xhtml/level1/core/hc_elementgettagname.js | 123 ++ .../xhtml/level1/core/hc_elementgettagname.xhtml | 60 + .../core/hc_elementinuseattributeerr-expected.txt | 2 + .../level1/core/hc_elementinuseattributeerr.js | 131 +++ .../level1/core/hc_elementinuseattributeerr.xhtml | 60 + ...c_elementinvalidcharacterexception-expected.txt | 2 + .../core/hc_elementinvalidcharacterexception.js | 125 ++ .../core/hc_elementinvalidcharacterexception.xhtml | 60 + ..._elementinvalidcharacterexception1-expected.txt | 2 + .../core/hc_elementinvalidcharacterexception1.js | 119 ++ .../hc_elementinvalidcharacterexception1.xhtml | 60 + .../level1/core/hc_elementnormalize-expected.txt | 2 + .../dom/xhtml/level1/core/hc_elementnormalize.js | 126 ++ .../xhtml/level1/core/hc_elementnormalize.xhtml | 60 + .../level1/core/hc_elementnormalize2-expected.txt | 2 + .../dom/xhtml/level1/core/hc_elementnormalize2.js | 129 ++ .../xhtml/level1/core/hc_elementnormalize2.xhtml | 60 + .../level1/core/hc_elementnotfounderr-expected.txt | 2 + .../dom/xhtml/level1/core/hc_elementnotfounderr.js | 130 +++ .../xhtml/level1/core/hc_elementnotfounderr.xhtml | 60 + .../core/hc_elementremoveattribute-expected.txt | 3 + .../xhtml/level1/core/hc_elementremoveattribute.js | 113 ++ .../level1/core/hc_elementremoveattribute.xhtml | 60 + ..._elementremoveattributeaftercreate-expected.txt | 2 + .../core/hc_elementremoveattributeaftercreate.js | 124 ++ .../hc_elementremoveattributeaftercreate.xhtml | 60 + .../hc_elementremoveattributenode-expected.txt | 2 + .../level1/core/hc_elementremoveattributenode.js | 119 ++ .../core/hc_elementremoveattributenode.xhtml | 60 + ...hc_elementreplaceattributewithself-expected.txt | 2 + .../core/hc_elementreplaceattributewithself.js | 117 ++ .../core/hc_elementreplaceattributewithself.xhtml | 60 + ...hc_elementreplaceexistingattribute-expected.txt | 2 + .../core/hc_elementreplaceexistingattribute.js | 122 ++ .../core/hc_elementreplaceexistingattribute.xhtml | 60 + ...entreplaceexistingattributegevalue-expected.txt | 2 + .../hc_elementreplaceexistingattributegevalue.js | 123 ++ ...hc_elementreplaceexistingattributegevalue.xhtml | 60 + .../hc_elementretrieveallattributes-expected.txt | 2 + .../level1/core/hc_elementretrieveallattributes.js | 144 +++ .../core/hc_elementretrieveallattributes.xhtml | 60 + .../core/hc_elementretrieveattrvalue-expected.txt | 2 + .../level1/core/hc_elementretrieveattrvalue.js | 113 ++ .../level1/core/hc_elementretrieveattrvalue.xhtml | 60 + .../core/hc_elementretrievetagname-expected.txt | 2 + .../xhtml/level1/core/hc_elementretrievetagname.js | 118 ++ .../level1/core/hc_elementretrievetagname.xhtml | 60 + .../hc_elementsetattributenodenull-expected.txt | 2 + .../level1/core/hc_elementsetattributenodenull.js | 120 ++ .../core/hc_elementsetattributenodenull.xhtml | 60 + .../core/hc_elementwrongdocumenterr-expected.txt | 2 + .../level1/core/hc_elementwrongdocumenterr.js | 147 +++ .../level1/core/hc_elementwrongdocumenterr.xhtml | 60 + .../core/hc_entitiesremovenameditem1-expected.txt | 3 + .../level1/core/hc_entitiesremovenameditem1.js | 133 +++ .../level1/core/hc_entitiesremovenameditem1.xhtml | 60 + .../core/hc_entitiessetnameditem1-expected.txt | 3 + .../xhtml/level1/core/hc_entitiessetnameditem1.js | 144 +++ .../level1/core/hc_entitiessetnameditem1.xhtml | 60 + .../hc_namednodemapchildnoderange-expected.txt | 2 + .../level1/core/hc_namednodemapchildnoderange.js | 141 +++ .../core/hc_namednodemapchildnoderange.xhtml | 60 + .../core/hc_namednodemapgetnameditem-expected.txt | 2 + .../level1/core/hc_namednodemapgetnameditem.js | 121 ++ .../level1/core/hc_namednodemapgetnameditem.xhtml | 60 + .../hc_namednodemapinuseattributeerr-expected.txt | 2 + .../core/hc_namednodemapinuseattributeerr.js | 139 +++ .../core/hc_namednodemapinuseattributeerr.xhtml | 60 + .../core/hc_namednodemapnotfounderr-expected.txt | 2 + .../level1/core/hc_namednodemapnotfounderr.js | 131 +++ .../level1/core/hc_namednodemapnotfounderr.xhtml | 60 + .../core/hc_namednodemapnumberofnodes-expected.txt | 2 + .../level1/core/hc_namednodemapnumberofnodes.js | 127 ++ .../level1/core/hc_namednodemapnumberofnodes.xhtml | 60 + .../hc_namednodemapremovenameditem-expected.txt | 2 + .../level1/core/hc_namednodemapremovenameditem.js | 124 ++ .../core/hc_namednodemapremovenameditem.xhtml | 60 + .../hc_namednodemapreturnattrnode-expected.txt | 2 + .../level1/core/hc_namednodemapreturnattrnode.js | 126 ++ .../core/hc_namednodemapreturnattrnode.xhtml | 60 + .../hc_namednodemapreturnfirstitem-expected.txt | 2 + .../level1/core/hc_namednodemapreturnfirstitem.js | 150 +++ .../core/hc_namednodemapreturnfirstitem.xhtml | 60 + .../hc_namednodemapreturnlastitem-expected.txt | 2 + .../level1/core/hc_namednodemapreturnlastitem.js | 152 +++ .../core/hc_namednodemapreturnlastitem.xhtml | 60 + .../core/hc_namednodemapreturnnull-expected.txt | 2 + .../xhtml/level1/core/hc_namednodemapreturnnull.js | 121 ++ .../level1/core/hc_namednodemapreturnnull.xhtml | 60 + .../core/hc_namednodemapsetnameditem-expected.txt | 2 + .../level1/core/hc_namednodemapsetnameditem.js | 131 +++ .../level1/core/hc_namednodemapsetnameditem.xhtml | 60 + ...amednodemapsetnameditemreturnvalue-expected.txt | 2 + .../core/hc_namednodemapsetnameditemreturnvalue.js | 132 +++ .../hc_namednodemapsetnameditemreturnvalue.xhtml | 60 + ...namednodemapsetnameditemthatexists-expected.txt | 2 + .../core/hc_namednodemapsetnameditemthatexists.js | 134 +++ .../hc_namednodemapsetnameditemthatexists.xhtml | 60 + ...mednodemapsetnameditemwithnewvalue-expected.txt | 2 + .../hc_namednodemapsetnameditemwithnewvalue.js | 126 ++ .../hc_namednodemapsetnameditemwithnewvalue.xhtml | 60 + .../hc_namednodemapwrongdocumenterr-expected.txt | 2 + .../level1/core/hc_namednodemapwrongdocumenterr.js | 149 +++ .../core/hc_namednodemapwrongdocumenterr.xhtml | 60 + .../level1/core/hc_nodeappendchild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodeappendchild.js | 123 ++ .../dom/xhtml/level1/core/hc_nodeappendchild.xhtml | 60 + .../hc_nodeappendchildchildexists-expected.txt | 2 + .../level1/core/hc_nodeappendchildchildexists.js | 160 +++ .../core/hc_nodeappendchildchildexists.xhtml | 60 + .../hc_nodeappendchilddocfragment-expected.txt | 2 + .../level1/core/hc_nodeappendchilddocfragment.js | 158 +++ .../core/hc_nodeappendchilddocfragment.xhtml | 60 + .../hc_nodeappendchildgetnodename-expected.txt | 2 + .../level1/core/hc_nodeappendchildgetnodename.js | 123 ++ .../core/hc_nodeappendchildgetnodename.xhtml | 60 + .../hc_nodeappendchildinvalidnodetype-expected.txt | 2 + .../core/hc_nodeappendchildinvalidnodetype.js | 130 +++ .../core/hc_nodeappendchildinvalidnodetype.xhtml | 60 + ...odeappendchildnewchilddiffdocument-expected.txt | 3 + .../core/hc_nodeappendchildnewchilddiffdocument.js | 144 +++ .../hc_nodeappendchildnewchilddiffdocument.xhtml | 60 + .../hc_nodeappendchildnodeancestor-expected.txt | 2 + .../level1/core/hc_nodeappendchildnodeancestor.js | 132 +++ .../core/hc_nodeappendchildnodeancestor.xhtml | 60 + .../hc_nodeattributenodeattribute-expected.txt | 2 + .../level1/core/hc_nodeattributenodeattribute.js | 120 ++ .../core/hc_nodeattributenodeattribute.xhtml | 60 + .../core/hc_nodeattributenodename-expected.txt | 2 + .../xhtml/level1/core/hc_nodeattributenodename.js | 115 ++ .../level1/core/hc_nodeattributenodename.xhtml | 60 + .../core/hc_nodeattributenodetype-expected.txt | 2 + .../xhtml/level1/core/hc_nodeattributenodetype.js | 123 ++ .../level1/core/hc_nodeattributenodetype.xhtml | 60 + .../core/hc_nodeattributenodevalue-expected.txt | 2 + .../xhtml/level1/core/hc_nodeattributenodevalue.js | 118 ++ .../level1/core/hc_nodeattributenodevalue.xhtml | 60 + .../level1/core/hc_nodechildnodes-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodechildnodes.js | 149 +++ .../dom/xhtml/level1/core/hc_nodechildnodes.xhtml | 60 + .../core/hc_nodechildnodesappendchild-expected.txt | 2 + .../level1/core/hc_nodechildnodesappendchild.js | 159 +++ .../level1/core/hc_nodechildnodesappendchild.xhtml | 60 + .../core/hc_nodechildnodesempty-expected.txt | 2 + .../xhtml/level1/core/hc_nodechildnodesempty.js | 123 ++ .../xhtml/level1/core/hc_nodechildnodesempty.xhtml | 60 + .../core/hc_nodecloneattributescopied-expected.txt | 2 + .../level1/core/hc_nodecloneattributescopied.js | 149 +++ .../level1/core/hc_nodecloneattributescopied.xhtml | 60 + .../core/hc_nodeclonefalsenocopytext-expected.txt | 2 + .../level1/core/hc_nodeclonefalsenocopytext.js | 122 ++ .../level1/core/hc_nodeclonefalsenocopytext.xhtml | 60 + .../core/hc_nodeclonegetparentnull-expected.txt | 2 + .../xhtml/level1/core/hc_nodeclonegetparentnull.js | 117 ++ .../level1/core/hc_nodeclonegetparentnull.xhtml | 60 + .../level1/core/hc_nodeclonenodefalse-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodeclonenodefalse.js | 126 ++ .../xhtml/level1/core/hc_nodeclonenodefalse.xhtml | 60 + .../level1/core/hc_nodeclonenodetrue-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodeclonenodetrue.js | 145 +++ .../xhtml/level1/core/hc_nodeclonenodetrue.xhtml | 60 + .../core/hc_nodeclonetruecopytext-expected.txt | 2 + .../xhtml/level1/core/hc_nodeclonetruecopytext.js | 121 ++ .../level1/core/hc_nodeclonetruecopytext.xhtml | 60 + .../core/hc_nodecommentnodeattributes-expected.txt | 2 + .../level1/core/hc_nodecommentnodeattributes.js | 135 +++ .../level1/core/hc_nodecommentnodeattributes.xhtml | 60 + .../core/hc_nodecommentnodename-expected.txt | 2 + .../xhtml/level1/core/hc_nodecommentnodename.js | 134 +++ .../xhtml/level1/core/hc_nodecommentnodename.xhtml | 60 + .../core/hc_nodecommentnodetype-expected.txt | 2 + .../xhtml/level1/core/hc_nodecommentnodetype.js | 133 +++ .../xhtml/level1/core/hc_nodecommentnodetype.xhtml | 60 + .../core/hc_nodecommentnodevalue-expected.txt | 2 + .../xhtml/level1/core/hc_nodecommentnodevalue.js | 133 +++ .../level1/core/hc_nodecommentnodevalue.xhtml | 60 + .../hc_nodedocumentfragmentnodename-expected.txt | 2 + .../level1/core/hc_nodedocumentfragmentnodename.js | 114 ++ .../core/hc_nodedocumentfragmentnodename.xhtml | 60 + .../hc_nodedocumentfragmentnodetype-expected.txt | 2 + .../level1/core/hc_nodedocumentfragmentnodetype.js | 114 ++ .../core/hc_nodedocumentfragmentnodetype.xhtml | 60 + .../hc_nodedocumentfragmentnodevalue-expected.txt | 2 + .../core/hc_nodedocumentfragmentnodevalue.js | 120 ++ .../core/hc_nodedocumentfragmentnodevalue.xhtml | 60 + .../core/hc_nodedocumentnodeattribute-expected.txt | 2 + .../level1/core/hc_nodedocumentnodeattribute.js | 111 ++ .../level1/core/hc_nodedocumentnodeattribute.xhtml | 60 + .../core/hc_nodedocumentnodename-expected.txt | 2 + .../xhtml/level1/core/hc_nodedocumentnodename.js | 111 ++ .../level1/core/hc_nodedocumentnodename.xhtml | 60 + .../core/hc_nodedocumentnodetype-expected.txt | 2 + .../xhtml/level1/core/hc_nodedocumentnodetype.js | 110 ++ .../level1/core/hc_nodedocumentnodetype.xhtml | 60 + .../core/hc_nodedocumentnodevalue-expected.txt | 2 + .../xhtml/level1/core/hc_nodedocumentnodevalue.js | 112 ++ .../level1/core/hc_nodedocumentnodevalue.xhtml | 60 + .../core/hc_nodeelementnodeattributes-expected.txt | 2 + .../level1/core/hc_nodeelementnodeattributes.js | 145 +++ .../level1/core/hc_nodeelementnodeattributes.xhtml | 60 + .../core/hc_nodeelementnodename-expected.txt | 2 + .../xhtml/level1/core/hc_nodeelementnodename.js | 125 ++ .../xhtml/level1/core/hc_nodeelementnodename.xhtml | 60 + .../core/hc_nodeelementnodetype-expected.txt | 2 + .../xhtml/level1/core/hc_nodeelementnodetype.js | 112 ++ .../xhtml/level1/core/hc_nodeelementnodetype.xhtml | 60 + .../core/hc_nodeelementnodevalue-expected.txt | 2 + .../xhtml/level1/core/hc_nodeelementnodevalue.js | 109 ++ .../level1/core/hc_nodeelementnodevalue.xhtml | 60 + .../level1/core/hc_nodegetfirstchild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodegetfirstchild.js | 130 +++ .../xhtml/level1/core/hc_nodegetfirstchild.xhtml | 60 + .../core/hc_nodegetfirstchildnull-expected.txt | 2 + .../xhtml/level1/core/hc_nodegetfirstchildnull.js | 117 ++ .../level1/core/hc_nodegetfirstchildnull.xhtml | 60 + .../level1/core/hc_nodegetlastchild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodegetlastchild.js | 117 ++ .../xhtml/level1/core/hc_nodegetlastchild.xhtml | 60 + .../core/hc_nodegetlastchildnull-expected.txt | 2 + .../xhtml/level1/core/hc_nodegetlastchildnull.js | 118 ++ .../level1/core/hc_nodegetlastchildnull.xhtml | 60 + .../level1/core/hc_nodegetnextsibling-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodegetnextsibling.js | 117 ++ .../xhtml/level1/core/hc_nodegetnextsibling.xhtml | 60 + .../core/hc_nodegetnextsiblingnull-expected.txt | 2 + .../xhtml/level1/core/hc_nodegetnextsiblingnull.js | 124 ++ .../level1/core/hc_nodegetnextsiblingnull.xhtml | 60 + .../core/hc_nodegetownerdocument-expected.txt | 2 + .../xhtml/level1/core/hc_nodegetownerdocument.js | 129 ++ .../level1/core/hc_nodegetownerdocument.xhtml | 60 + .../core/hc_nodegetownerdocumentnull-expected.txt | 2 + .../level1/core/hc_nodegetownerdocumentnull.js | 115 ++ .../level1/core/hc_nodegetownerdocumentnull.xhtml | 60 + .../core/hc_nodegetprevioussibling-expected.txt | 2 + .../xhtml/level1/core/hc_nodegetprevioussibling.js | 117 ++ .../level1/core/hc_nodegetprevioussibling.xhtml | 60 + .../hc_nodegetprevioussiblingnull-expected.txt | 2 + .../level1/core/hc_nodegetprevioussiblingnull.js | 124 ++ .../core/hc_nodegetprevioussiblingnull.xhtml | 60 + .../level1/core/hc_nodehaschildnodes-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodehaschildnodes.js | 113 ++ .../xhtml/level1/core/hc_nodehaschildnodes.xhtml | 60 + .../core/hc_nodehaschildnodesfalse-expected.txt | 2 + .../xhtml/level1/core/hc_nodehaschildnodesfalse.js | 117 ++ .../level1/core/hc_nodehaschildnodesfalse.xhtml | 60 + .../level1/core/hc_nodeinsertbefore-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodeinsertbefore.js | 153 +++ .../xhtml/level1/core/hc_nodeinsertbefore.xhtml | 60 + .../hc_nodeinsertbeforedocfragment-expected.txt | 2 + .../level1/core/hc_nodeinsertbeforedocfragment.js | 141 +++ .../core/hc_nodeinsertbeforedocfragment.xhtml | 60 + ...hc_nodeinsertbeforeinvalidnodetype-expected.txt | 2 + .../core/hc_nodeinsertbeforeinvalidnodetype.js | 136 +++ .../core/hc_nodeinsertbeforeinvalidnodetype.xhtml | 60 + ...deinsertbeforenewchilddiffdocument-expected.txt | 3 + .../hc_nodeinsertbeforenewchilddiffdocument.js | 147 +++ .../hc_nodeinsertbeforenewchilddiffdocument.xhtml | 60 + .../hc_nodeinsertbeforenewchildexists-expected.txt | 2 + .../core/hc_nodeinsertbeforenewchildexists.js | 151 +++ .../core/hc_nodeinsertbeforenewchildexists.xhtml | 60 + .../hc_nodeinsertbeforenodeancestor-expected.txt | 2 + .../level1/core/hc_nodeinsertbeforenodeancestor.js | 135 +++ .../core/hc_nodeinsertbeforenodeancestor.xhtml | 60 + .../core/hc_nodeinsertbeforenodename-expected.txt | 2 + .../level1/core/hc_nodeinsertbeforenodename.js | 126 ++ .../level1/core/hc_nodeinsertbeforenodename.xhtml | 60 + ...odeinsertbeforerefchildnonexistent-expected.txt | 2 + .../core/hc_nodeinsertbeforerefchildnonexistent.js | 133 +++ .../hc_nodeinsertbeforerefchildnonexistent.xhtml | 60 + .../hc_nodeinsertbeforerefchildnull-expected.txt | 2 + .../level1/core/hc_nodeinsertbeforerefchildnull.js | 131 +++ .../core/hc_nodeinsertbeforerefchildnull.xhtml | 60 + .../core/hc_nodelistindexequalzero-expected.txt | 2 + .../xhtml/level1/core/hc_nodelistindexequalzero.js | 135 +++ .../level1/core/hc_nodelistindexequalzero.xhtml | 60 + .../core/hc_nodelistindexgetlength-expected.txt | 2 + .../xhtml/level1/core/hc_nodelistindexgetlength.js | 129 ++ .../level1/core/hc_nodelistindexgetlength.xhtml | 60 + ..._nodelistindexgetlengthofemptylist-expected.txt | 2 + .../core/hc_nodelistindexgetlengthofemptylist.js | 122 ++ .../hc_nodelistindexgetlengthofemptylist.xhtml | 60 + .../core/hc_nodelistindexnotzero-expected.txt | 2 + .../xhtml/level1/core/hc_nodelistindexnotzero.js | 133 +++ .../level1/core/hc_nodelistindexnotzero.xhtml | 60 + .../core/hc_nodelistreturnfirstitem-expected.txt | 2 + .../level1/core/hc_nodelistreturnfirstitem.js | 129 ++ .../level1/core/hc_nodelistreturnfirstitem.xhtml | 60 + .../core/hc_nodelistreturnlastitem-expected.txt | 2 + .../xhtml/level1/core/hc_nodelistreturnlastitem.js | 133 +++ .../level1/core/hc_nodelistreturnlastitem.xhtml | 60 + .../core/hc_nodelisttraverselist-expected.txt | 2 + .../xhtml/level1/core/hc_nodelisttraverselist.js | 149 +++ .../level1/core/hc_nodelisttraverselist.xhtml | 60 + .../level1/core/hc_nodeparentnode-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodeparentnode.js | 117 ++ .../dom/xhtml/level1/core/hc_nodeparentnode.xhtml | 60 + .../level1/core/hc_nodeparentnodenull-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodeparentnodenull.js | 114 ++ .../xhtml/level1/core/hc_nodeparentnodenull.xhtml | 60 + .../level1/core/hc_noderemovechild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_noderemovechild.js | 133 +++ .../dom/xhtml/level1/core/hc_noderemovechild.xhtml | 60 + .../hc_noderemovechildgetnodename-expected.txt | 2 + .../level1/core/hc_noderemovechildgetnodename.js | 128 ++ .../core/hc_noderemovechildgetnodename.xhtml | 60 + .../core/hc_noderemovechildnode-expected.txt | 2 + .../xhtml/level1/core/hc_noderemovechildnode.js | 160 +++ .../xhtml/level1/core/hc_noderemovechildnode.xhtml | 60 + ...noderemovechildoldchildnonexistent-expected.txt | 2 + .../core/hc_noderemovechildoldchildnonexistent.js | 129 ++ .../hc_noderemovechildoldchildnonexistent.xhtml | 60 + .../level1/core/hc_nodereplacechild-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodereplacechild.js | 127 ++ .../xhtml/level1/core/hc_nodereplacechild.xhtml | 60 + ...hc_nodereplacechildinvalidnodetype-expected.txt | 2 + .../core/hc_nodereplacechildinvalidnodetype.js | 136 +++ .../core/hc_nodereplacechildinvalidnodetype.xhtml | 60 + ...dereplacechildnewchilddiffdocument-expected.txt | 3 + .../hc_nodereplacechildnewchilddiffdocument.js | 147 +++ .../hc_nodereplacechildnewchilddiffdocument.xhtml | 60 + .../hc_nodereplacechildnewchildexists-expected.txt | 2 + .../core/hc_nodereplacechildnewchildexists.js | 155 +++ .../core/hc_nodereplacechildnewchildexists.xhtml | 60 + .../hc_nodereplacechildnodeancestor-expected.txt | 2 + .../level1/core/hc_nodereplacechildnodeancestor.js | 135 +++ .../core/hc_nodereplacechildnodeancestor.xhtml | 60 + .../core/hc_nodereplacechildnodename-expected.txt | 2 + .../level1/core/hc_nodereplacechildnodename.js | 126 ++ .../level1/core/hc_nodereplacechildnodename.xhtml | 60 + ...odereplacechildoldchildnonexistent-expected.txt | 2 + .../core/hc_nodereplacechildoldchildnonexistent.js | 131 +++ .../hc_nodereplacechildoldchildnonexistent.xhtml | 60 + .../core/hc_nodetextnodeattribute-expected.txt | 2 + .../xhtml/level1/core/hc_nodetextnodeattribute.js | 118 ++ .../level1/core/hc_nodetextnodeattribute.xhtml | 60 + .../level1/core/hc_nodetextnodename-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodetextnodename.js | 113 ++ .../xhtml/level1/core/hc_nodetextnodename.xhtml | 60 + .../level1/core/hc_nodetextnodetype-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodetextnodetype.js | 124 ++ .../xhtml/level1/core/hc_nodetextnodetype.xhtml | 60 + .../level1/core/hc_nodetextnodevalue-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodetextnodevalue.js | 118 ++ .../xhtml/level1/core/hc_nodetextnodevalue.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue01-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodevalue01.js | 114 ++ .../dom/xhtml/level1/core/hc_nodevalue01.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue02-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodevalue02.js | 114 ++ .../dom/xhtml/level1/core/hc_nodevalue02.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue03-expected.txt | 3 + .../dom/xhtml/level1/core/hc_nodevalue03.js | 138 +++ .../dom/xhtml/level1/core/hc_nodevalue03.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue04-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodevalue04.js | 132 +++ .../dom/xhtml/level1/core/hc_nodevalue04.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue05-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodevalue05.js | 114 ++ .../dom/xhtml/level1/core/hc_nodevalue05.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue06-expected.txt | 2 + .../dom/xhtml/level1/core/hc_nodevalue06.js | 112 ++ .../dom/xhtml/level1/core/hc_nodevalue06.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue07-expected.txt | 3 + .../dom/xhtml/level1/core/hc_nodevalue07.js | 134 +++ .../dom/xhtml/level1/core/hc_nodevalue07.xhtml | 60 + .../xhtml/level1/core/hc_nodevalue08-expected.txt | 3 + .../dom/xhtml/level1/core/hc_nodevalue08.js | 134 +++ .../dom/xhtml/level1/core/hc_nodevalue08.xhtml | 60 + .../core/hc_notationsremovenameditem1-expected.txt | 3 + .../level1/core/hc_notationsremovenameditem1.js | 133 +++ .../level1/core/hc_notationsremovenameditem1.xhtml | 60 + .../core/hc_notationssetnameditem1-expected.txt | 3 + .../xhtml/level1/core/hc_notationssetnameditem1.js | 144 +++ .../level1/core/hc_notationssetnameditem1.xhtml | 60 + .../hc_textindexsizeerrnegativeoffset-expected.txt | 2 + .../core/hc_textindexsizeerrnegativeoffset.js | 130 +++ .../core/hc_textindexsizeerrnegativeoffset.xhtml | 60 + ..._textindexsizeerroffsetoutofbounds-expected.txt | 2 + .../core/hc_textindexsizeerroffsetoutofbounds.js | 131 +++ .../hc_textindexsizeerroffsetoutofbounds.xhtml | 60 + .../hc_textparseintolistofelements-expected.txt | 2 + .../level1/core/hc_textparseintolistofelements.js | 169 +++ .../core/hc_textparseintolistofelements.xhtml | 60 + .../level1/core/hc_textsplittextfour-expected.txt | 2 + .../dom/xhtml/level1/core/hc_textsplittextfour.js | 122 ++ .../xhtml/level1/core/hc_textsplittextfour.xhtml | 60 + .../level1/core/hc_textsplittextone-expected.txt | 2 + .../dom/xhtml/level1/core/hc_textsplittextone.js | 126 ++ .../xhtml/level1/core/hc_textsplittextone.xhtml | 60 + .../level1/core/hc_textsplittextthree-expected.txt | 2 + .../dom/xhtml/level1/core/hc_textsplittextthree.js | 124 ++ .../xhtml/level1/core/hc_textsplittextthree.xhtml | 60 + .../level1/core/hc_textsplittexttwo-expected.txt | 2 + .../dom/xhtml/level1/core/hc_textsplittexttwo.js | 123 ++ .../xhtml/level1/core/hc_textsplittexttwo.xhtml | 60 + .../level1/core/hc_textwithnomarkup-expected.txt | 2 + .../dom/xhtml/level1/core/hc_textwithnomarkup.js | 122 ++ .../xhtml/level1/core/hc_textwithnomarkup.xhtml | 60 + .../xhtml/level1/core/resources/COPYRIGHT.xhtml | 102 ++ LayoutTests/dom/xhtml/level1/core/selfxhtml.js | 743 ++++++++++++ LayoutTests/dom/xhtml/level1/core/staff.dtd | 17 + LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent | 196 ++++ .../dom/xhtml/level1/core/xhtml-special.ent | 80 ++ LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent | 237 ++++ .../dom/xhtml/level1/core/xhtml1-frameset.dtd | 1235 ++++++++++++++++++++ .../dom/xhtml/level1/core/xhtml1-strict.dtd | 978 ++++++++++++++++ .../dom/xhtml/level1/core/xhtml1-transitional.dtd | 1201 +++++++++++++++++++ 723 files changed, 50184 insertions(+) create mode 100644 LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.js create mode 100644 LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrlastchild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrname-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrname.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrname.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrnormalize-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgettagname-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnormalize-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue01-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue02-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue03-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue04-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue05-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue06-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue07-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue08-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextone-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup-expected.txt create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.js create mode 100644 LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/resources/COPYRIGHT.xhtml create mode 100644 LayoutTests/dom/xhtml/level1/core/selfxhtml.js create mode 100644 LayoutTests/dom/xhtml/level1/core/staff.dtd create mode 100644 LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent create mode 100644 LayoutTests/dom/xhtml/level1/core/xhtml-special.ent create mode 100644 LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent create mode 100644 LayoutTests/dom/xhtml/level1/core/xhtml1-frameset.dtd create mode 100644 LayoutTests/dom/xhtml/level1/core/xhtml1-strict.dtd create mode 100644 LayoutTests/dom/xhtml/level1/core/xhtml1-transitional.dtd (limited to 'LayoutTests/dom') diff --git a/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd-expected.txt b/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd-expected.txt new file mode 100644 index 0000000..a5c829e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctypenodtd +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.js b/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.js new file mode 100644 index 0000000..7d475f9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.js @@ -0,0 +1,110 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctypenodtd"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("validating", false); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_nodtdstaff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getDoctype()" method returns null for XML documents + without a document type declaration. + Retrieve the XML document without a DTD and invoke the + "getDoctype()" method. It should return null. + +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ +function documentgetdoctypenodtd() { + var success; + if(checkInitialization(builder, "documentgetdoctypenodtd") != null) return; + var doc; + var docType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_nodtdstaff"); + docType = doc.doctype; + + assertNull("documentGetDocTypeNoDTDAssert",docType); + +} + + + + +function runTest() { + documentgetdoctypenodtd(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.xhtml b/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.xhtml new file mode 100644 index 0000000..1a6bc84 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentgetdoctypenodtd.xhtml @@ -0,0 +1,10 @@ +hc_nodtdstaff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt new file mode 100644 index 0000000..d2d6d17 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js new file mode 100644 index 0000000..ce7e127 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.js @@ -0,0 +1,143 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createEntityReference(tagName)" method raises an + INVALID_CHARACTER_ERR DOMException if the specified + tagName contains an invalid character. + +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function documentinvalidcharacterexceptioncreateentref() { + var success; + if(checkInitialization(builder, "documentinvalidcharacterexceptioncreateentref") != null) return; + var doc; + var badEntityRef; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + badEntityRef = doc.createEntityReference("foo"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + + { + success = false; + try { + badEntityRef = doc.createEntityReference("invalid^Name"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + + } + +} + + + + +function runTest() { + documentinvalidcharacterexceptioncreateentref(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml new file mode 100644 index 0000000..d810983 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt new file mode 100644 index 0000000..df3bc99 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js new file mode 100644 index 0000000..b4d1ec9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.js @@ -0,0 +1,140 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreateentref1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Creating an entity reference with an empty name should cause an INVALID_CHARACTER_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-392B75AE +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-392B75AE')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ +function documentinvalidcharacterexceptioncreateentref1() { + var success; + if(checkInitialization(builder, "documentinvalidcharacterexceptioncreateentref1") != null) return; + var doc; + var badEntityRef; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + badEntityRef = doc.createEntityReference("foo"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + + { + success = false; + try { + badEntityRef = doc.createEntityReference(""); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + + } + +} + + + + +function runTest() { + documentinvalidcharacterexceptioncreateentref1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml new file mode 100644 index 0000000..f83bab9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreateentref1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt new file mode 100644 index 0000000..749db25 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js new file mode 100644 index 0000000..3216c53 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.js @@ -0,0 +1,143 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createProcessingInstruction(target,data) method + raises an INVALID_CHARACTER_ERR DOMException if the + specified tagName contains an invalid character. + +* @author NIST +* @author Mary Brady +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function documentinvalidcharacterexceptioncreatepi() { + var success; + if(checkInitialization(builder, "documentinvalidcharacterexceptioncreatepi") != null) return; + var doc; + var badPI; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + badPI = doc.createProcessingInstruction("foo","data"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + + { + success = false; + try { + badPI = doc.createProcessingInstruction("invalid^Name","data"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + + } + +} + + + + +function runTest() { + documentinvalidcharacterexceptioncreatepi(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml new file mode 100644 index 0000000..3c077c0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt new file mode 100644 index 0000000..5c3721e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js new file mode 100644 index 0000000..fb6104d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.js @@ -0,0 +1,140 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Creating a processing instruction with an empty target should cause an INVALID_CHARACTER_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-135944439')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ +function documentinvalidcharacterexceptioncreatepi1() { + var success; + if(checkInitialization(builder, "documentinvalidcharacterexceptioncreatepi1") != null) return; + var doc; + var badPI; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + badPI = doc.createProcessingInstruction("foo","data"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + + { + success = false; + try { + badPI = doc.createProcessingInstruction("","data"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + + } + +} + + + + +function runTest() { + documentinvalidcharacterexceptioncreatepi1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml new file mode 100644 index 0000000..0542c81 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/documentinvalidcharacterexceptioncreatepi1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1-expected.txt new file mode 100644 index 0000000..0583b5e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.js new file mode 100644 index 0000000..0bb0ad9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a text node to an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_attrappendchild1() { + var success; + if(checkInitialization(builder, "hc_attrappendchild1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + retval = titleAttr.appendChild(textNode); + value = titleAttr.value; + + assertEquals("attrValue","Yesterday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + value = retval.nodeValue; + + assertEquals("retvalValue","terday",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","terday",value); + +} + + + + +function runTest() { + hc_attrappendchild1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.xhtml new file mode 100644 index 0000000..429b928 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2-expected.txt new file mode 100644 index 0000000..dc46570 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.js new file mode 100644 index 0000000..ac53896 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Attempts to append an element to the child nodes of an attribute. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_attrappendchild2() { + var success; + if(checkInitialization(builder, "hc_attrappendchild2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var newChild; + var retval; + var lastChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + newChild = doc.createElement("terday"); + + { + success = false; + try { + retval = titleAttr.appendChild(newChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_attrappendchild2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.xhtml new file mode 100644 index 0000000..10b17e7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3-expected.txt new file mode 100644 index 0000000..de2a65a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild3 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.js b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.js new file mode 100644 index 0000000..66adc3d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.js @@ -0,0 +1,138 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild3"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a document fragment to an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_attrappendchild3() { + var success; + if(checkInitialization(builder, "hc_attrappendchild3") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var terNode; + var dayNode; + var retval; + var lastChild; + var docFrag; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + terNode = doc.createTextNode("ter"); + dayNode = doc.createTextNode("day"); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + retval = titleAttr.appendChild(docFrag); + value = titleAttr.value; + + assertEquals("attrValue","Yesterday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + value = retval.nodeValue; + + assertNull("retvalValue",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","day",value); + +} + + + + +function runTest() { + hc_attrappendchild3(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.xhtml new file mode 100644 index 0000000..9901398 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild3.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4-expected.txt new file mode 100644 index 0000000..04ba30c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild4 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.js b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.js new file mode 100644 index 0000000..dc70102 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.js @@ -0,0 +1,152 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild4"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Attempt to append a CDATASection to an attribute which should result +in a HIERARCHY_REQUEST_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_attrappendchild4() { + var success; + if(checkInitialization(builder, "hc_attrappendchild4") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + textNode = doc.createCDATASection("terday"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + textNode = doc.createCDATASection("terday"); + + { + success = false; + try { + retval = titleAttr.appendChild(textNode); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + + } + +} + + + + +function runTest() { + hc_attrappendchild4(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.xhtml new file mode 100644 index 0000000..e8659a4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild4.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5-expected.txt new file mode 100644 index 0000000..60f2a64 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5 +Status failure +Message throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.js b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.js new file mode 100644 index 0000000..c9e8855 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.js @@ -0,0 +1,141 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild5"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + var otherDocRef = null; + if (typeof(this.otherDoc) != 'undefined') { + otherDocRef = this.otherDoc; + } + docsLoaded += preload(otherDocRef, "otherDoc", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Attempt to append a node from another document to an attribute which should result +in a WRONG_DOCUMENT_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_attrappendchild5() { + var success; + if(checkInitialization(builder, "hc_attrappendchild5") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + var otherDoc; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + var otherDocRef = null; + if (typeof(this.otherDoc) != 'undefined') { + otherDocRef = this.otherDoc; + } + otherDoc = load(otherDocRef, "otherDoc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = otherDoc.createTextNode("terday"); + + { + success = false; + try { + retval = titleAttr.appendChild(textNode); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_attrappendchild5(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.xhtml new file mode 100644 index 0000000..6227713 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild5.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6-expected.txt new file mode 100644 index 0000000..a1a17e4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild6 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.js b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.js new file mode 100644 index 0000000..01b3d80 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrappendchild6"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Creates an new attribute node and appends a text node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_attrappendchild6() { + var success; + if(checkInitialization(builder, "hc_attrappendchild6") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + titleAttr = doc.createAttribute("title"); + textNode = doc.createTextNode("Yesterday"); + retval = titleAttr.appendChild(textNode); + value = titleAttr.value; + + assertEquals("attrValue","Yesterday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + value = retval.nodeValue; + + assertEquals("retvalValue","Yesterday",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","Yesterday",value); + +} + + + + +function runTest() { + hc_attrappendchild6(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.xhtml new file mode 100644 index 0000000..e42ab84 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrappendchild6.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1-expected.txt new file mode 100644 index 0000000..eee7614 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.js new file mode 100644 index 0000000..ac088f4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks that Node.childNodes for an attribute node contains +the expected text node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +*/ +function hc_attrchildnodes1() { + var success; + if(checkInitialization(builder, "hc_attrchildnodes1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var childNodes; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + childNodes = titleAttr.childNodes; + + assertSize("childNodesSize",1,childNodes); +textNode = childNodes.item(0); + value = textNode.nodeValue; + + assertEquals("child1IsYes","Yes",value); + textNode = childNodes.item(1); + assertNull("secondItemIsNull",textNode); + +} + + + + +function runTest() { + hc_attrchildnodes1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.xhtml new file mode 100644 index 0000000..3f552e6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2-expected.txt new file mode 100644 index 0000000..78b5622 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.js new file mode 100644 index 0000000..c6c6cd5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrchildnodes2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks Node.childNodes for an attribute with multiple child nodes. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +*/ +function hc_attrchildnodes2() { + var success; + if(checkInitialization(builder, "hc_attrchildnodes2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var childNodes; + var retval; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + childNodes = titleAttr.childNodes; + + textNode = doc.createTextNode("terday"); + retval = titleAttr.appendChild(textNode); + assertSize("childNodesSize",2,childNodes); +textNode = childNodes.item(0); + value = textNode.nodeValue; + + assertEquals("child1IsYes","Yes",value); + textNode = childNodes.item(1); + value = textNode.nodeValue; + + assertEquals("child2IsTerday","terday",value); + textNode = childNodes.item(2); + assertNull("thirdItemIsNull",textNode); + +} + + + + +function runTest() { + hc_attrchildnodes2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.xhtml new file mode 100644 index 0000000..b46083b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrchildnodes2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1-expected.txt new file mode 100644 index 0000000..13dc167 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrclonenode1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.js new file mode 100644 index 0000000..7667e85 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrclonenode1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a text node to an attribute and clones the node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ +function hc_attrclonenode1() { + var success; + if(checkInitialization(builder, "hc_attrclonenode1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + var clonedTitle; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + retval = titleAttr.appendChild(textNode); + clonedTitle = titleAttr.cloneNode(false); + textNode.nodeValue = "text_node_not_cloned"; + + value = clonedTitle.value; + + assertEquals("attrValue","Yesterday",value); + value = clonedTitle.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + lastChild = clonedTitle.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","terday",value); + +} + + + + +function runTest() { + hc_attrclonenode1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.xhtml new file mode 100644 index 0000000..b068421 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrclonenode1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt new file mode 100644 index 0000000..f0fd014 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatedocumentfragment +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.js b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.js new file mode 100644 index 0000000..b35e00f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.js @@ -0,0 +1,138 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatedocumentfragment"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Create a new DocumentFragment and add a newly created Element node(with one attribute). + Once the element is added, its attribute should be available as an attribute associated + with an Element within a DocumentFragment. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ +function hc_attrcreatedocumentfragment() { + var success; + if(checkInitialization(builder, "hc_attrcreatedocumentfragment") != null) return; + var doc; + var docFragment; + var newOne; + var domesticNode; + var attributes; + var attribute; + var attrName; + var appendedChild; + var langAttrCount = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docFragment = doc.createDocumentFragment(); + newOne = doc.createElement("html"); + newOne.setAttribute("lang","EN"); + appendedChild = docFragment.appendChild(newOne); + domesticNode = docFragment.firstChild; + + attributes = domesticNode.attributes; + + for(var indexN10078 = 0;indexN10078 < attributes.length; indexN10078++) { + attribute = attributes.item(indexN10078); + attrName = attribute.nodeName; + + + if( + equalsAutoCase("attribute", "lang", attrName) + ) { + langAttrCount += 1; + + } + + } + assertEquals("hasLangAttr",1,langAttrCount); + +} + + + + +function runTest() { + hc_attrcreatedocumentfragment(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml new file mode 100644 index 0000000..efbd914 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatedocumentfragment.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode-expected.txt new file mode 100644 index 0000000..2389a83 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.js b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.js new file mode 100644 index 0000000..0298426 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setValue()" method for an attribute creates a + Text node with the unparsed content of the string. + Retrieve the attribute named "class" from the last + child of of the fourth employee and assign the "Y&ent1;" + string to its value attribute. This value is not yet + parsed and therefore should still be the same upon + retrieval. This test uses the "getNamedItem(name)" method + from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html +*/ +function hc_attrcreatetextnode() { + var success; + if(checkInitialization(builder, "hc_attrcreatetextnode") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var streetAttr; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(3); + attributes = testNode.attributes; + + streetAttr = attributes.getNamedItem("class"); + streetAttr.value = "Y&ent1;"; + + value = streetAttr.value; + + assertEquals("value","Y&ent1;",value); + value = streetAttr.nodeValue; + + assertEquals("nodeValue","Y&ent1;",value); + +} + + + + +function runTest() { + hc_attrcreatetextnode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.xhtml new file mode 100644 index 0000000..52010a1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt new file mode 100644 index 0000000..58c61ac --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.js new file mode 100644 index 0000000..bfa0d05 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrcreatetextnode2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setNodeValue()" method for an attribute creates a + Text node with the unparsed content of the string. + Retrieve the attribute named "class" from the last + child of of the fourth employee and assign the "Y&ent1;" + string to its value attribute. This value is not yet + parsed and therefore should still be the same upon + retrieval. This test uses the "getNamedItem(name)" method + from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Apr/0057.html +*/ +function hc_attrcreatetextnode2() { + var success; + if(checkInitialization(builder, "hc_attrcreatetextnode2") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var streetAttr; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(3); + attributes = testNode.attributes; + + streetAttr = attributes.getNamedItem("class"); + streetAttr.nodeValue = "Y&ent1;"; + + value = streetAttr.value; + + assertEquals("value","Y&ent1;",value); + value = streetAttr.nodeValue; + + assertEquals("nodeValue","Y&ent1;",value); + +} + + + + +function runTest() { + hc_attrcreatetextnode2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.xhtml new file mode 100644 index 0000000..f87c341 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrcreatetextnode2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue-expected.txt new file mode 100644 index 0000000..89e4f88 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attreffectivevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.js new file mode 100644 index 0000000..89a41c0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attreffectivevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If an Attr is explicitly assigned any value, then that value is the attributes effective value. + Retrieve the attribute named "domestic" from the last child of of the first employee + and examine its nodeValue attribute. This test uses the "getNamedItem(name)" method + from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +*/ +function hc_attreffectivevalue() { + var success; + if(checkInitialization(builder, "hc_attreffectivevalue") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var domesticAttr; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(0); + attributes = testNode.attributes; + + domesticAttr = attributes.getNamedItem("title"); + value = domesticAttr.nodeValue; + + assertEquals("attrEffectiveValueAssert","Yes",value); + +} + + + + +function runTest() { + hc_attreffectivevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.xhtml new file mode 100644 index 0000000..1764cf8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attreffectivevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild-expected.txt new file mode 100644 index 0000000..ba2ab32 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrfirstchild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.js b/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.js new file mode 100644 index 0000000..68f8b52 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrfirstchild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks that Node.firstChild for an attribute node contains +the expected text node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +*/ +function hc_attrfirstchild() { + var success; + if(checkInitialization(builder, "hc_attrfirstchild") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var otherChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = titleAttr.firstChild; + + assertNotNull("textNodeNotNull",textNode); +value = textNode.nodeValue; + + assertEquals("child1IsYes","Yes",value); + otherChild = textNode.nextSibling; + + assertNull("nextSiblingIsNull",otherChild); + otherChild = textNode.previousSibling; + + assertNull("previousSiblingIsNull",otherChild); + +} + + + + +function runTest() { + hc_attrfirstchild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.xhtml new file mode 100644 index 0000000..5641a7b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrfirstchild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1-expected.txt new file mode 100644 index 0000000..2df7e21 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.js new file mode 100644 index 0000000..9ee328c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks the value of an attribute that contains entity references. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ +function hc_attrgetvalue1() { + var success; + if(checkInitialization(builder, "hc_attrgetvalue1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("class"); + value = titleAttr.value; + + assertEquals("attrValue1","Yα",value); + +} + + + + +function runTest() { + hc_attrgetvalue1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.xhtml new file mode 100644 index 0000000..100d85e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2-expected.txt new file mode 100644 index 0000000..0f209c3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue2 +Status failure +Message attrValue1: assertEquals failed, actual Yα, expected αYα. diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.js new file mode 100644 index 0000000..94cc2ae --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.js @@ -0,0 +1,146 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks the value of an attribute that contains entity references. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ +function hc_attrgetvalue2() { + var success; + if(checkInitialization(builder, "hc_attrgetvalue2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var firstChild; + var alphaRef; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("class"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + alphaRef = doc.createEntityReference("alpha"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + alphaRef = doc.createEntityReference("alpha"); + firstChild = titleAttr.firstChild; + + retval = titleAttr.insertBefore(alphaRef,firstChild); + value = titleAttr.value; + + assertEquals("attrValue1","αYα",value); + + } + +} + + + + +function runTest() { + hc_attrgetvalue2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.xhtml new file mode 100644 index 0000000..0a2e401 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrgetvalue2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes-expected.txt new file mode 100644 index 0000000..333e073 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrhaschildnodes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.js b/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.js new file mode 100644 index 0000000..71487c3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrhaschildnodes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks that Node.hasChildNodes() is true for an attribute with content. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +*/ +function hc_attrhaschildnodes() { + var success; + if(checkInitialization(builder, "hc_attrhaschildnodes") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var hasChildNodes; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + hasChildNodes = titleAttr.hasChildNodes(); + assertTrue("hasChildrenIsTrue",hasChildNodes); + +} + + + + +function runTest() { + hc_attrhaschildnodes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.xhtml new file mode 100644 index 0000000..c3fd476 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrhaschildnodes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1-expected.txt new file mode 100644 index 0000000..0a5c047 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.js new file mode 100644 index 0000000..89aa99e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.js @@ -0,0 +1,140 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a text node to an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore1() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var firstChild; + var lastChild; + var refChild = null; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + retval = titleAttr.insertBefore(textNode,refChild); + value = titleAttr.value; + + assertEquals("attrValue","Yesterday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + value = retval.nodeValue; + + assertEquals("retvalValue","terday",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","Yes",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","terday",value); + +} + + + + +function runTest() { + hc_attrinsertbefore1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.xhtml new file mode 100644 index 0000000..6bb5fa8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2-expected.txt new file mode 100644 index 0000000..85cb9bc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.js new file mode 100644 index 0000000..cc4f50e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.js @@ -0,0 +1,141 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Prepends a text node to an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore2() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var lastChild; + var firstChild; + var refChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + refChild = titleAttr.firstChild; + + retval = titleAttr.insertBefore(textNode,refChild); + value = titleAttr.value; + + assertEquals("attrValue","terdayYes",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","terdayYes",value); + value = retval.nodeValue; + + assertEquals("retvalValue","terday",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","terday",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","Yes",value); + +} + + + + +function runTest() { + hc_attrinsertbefore2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.xhtml new file mode 100644 index 0000000..f41e5e5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3-expected.txt new file mode 100644 index 0000000..033bb8d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore3 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.js new file mode 100644 index 0000000..3cb24cd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.js @@ -0,0 +1,146 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore3"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a document fragment to an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore3() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore3") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var terNode; + var dayNode; + var docFrag; + var retval; + var firstChild; + var lastChild; + var refChild = null; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + terNode = doc.createTextNode("ter"); + dayNode = doc.createTextNode("day"); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + retval = titleAttr.insertBefore(docFrag,refChild); + value = titleAttr.value; + + assertEquals("attrValue","Yesterday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + value = retval.nodeValue; + + assertNull("retvalValue",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","Yes",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","day",value); + +} + + + + +function runTest() { + hc_attrinsertbefore3(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.xhtml new file mode 100644 index 0000000..c579945 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore3.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4-expected.txt new file mode 100644 index 0000000..7d417a4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore4 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.js new file mode 100644 index 0000000..700e61d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.js @@ -0,0 +1,147 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore4"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Prepends a document fragment to an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore4() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore4") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var terNode; + var dayNode; + var docFrag; + var retval; + var firstChild; + var lastChild; + var refChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + terNode = doc.createTextNode("ter"); + dayNode = doc.createTextNode("day"); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + refChild = titleAttr.firstChild; + + retval = titleAttr.insertBefore(docFrag,refChild); + value = titleAttr.value; + + assertEquals("attrValue","terdayYes",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","terdayYes",value); + value = retval.nodeValue; + + assertNull("retvalValue",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","ter",value); + lastChild = titleAttr.lastChild; + + value = lastChild.nodeValue; + + assertEquals("lastChildValue","Yes",value); + +} + + + + +function runTest() { + hc_attrinsertbefore4(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.xhtml new file mode 100644 index 0000000..b493050 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore4.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5-expected.txt new file mode 100644 index 0000000..5272e63 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore5 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.js new file mode 100644 index 0000000..a9737ed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.js @@ -0,0 +1,153 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore5"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Attempt to append a CDATASection to an attribute which should result +in a HIERARCHY_REQUEST_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore5() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore5") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var refChild = null; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + textNode = doc.createCDATASection("terday"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + textNode = doc.createCDATASection("terday"); + + { + success = false; + try { + retval = titleAttr.insertBefore(textNode,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + + } + +} + + + + +function runTest() { + hc_attrinsertbefore5(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.xhtml new file mode 100644 index 0000000..eb2ada3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore5.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6-expected.txt new file mode 100644 index 0000000..55101a3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6 +Status failure +Message throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.js new file mode 100644 index 0000000..dc04f62 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.js @@ -0,0 +1,142 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore6"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + var otherDocRef = null; + if (typeof(this.otherDoc) != 'undefined') { + otherDocRef = this.otherDoc; + } + docsLoaded += preload(otherDocRef, "otherDoc", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Attempt to append a text node from another document to an attribute which should result +in a WRONG_DOCUMENT_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore6() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore6") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var refChild = null; + + var otherDoc; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + var otherDocRef = null; + if (typeof(this.otherDoc) != 'undefined') { + otherDocRef = this.otherDoc; + } + otherDoc = load(otherDocRef, "otherDoc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = otherDoc.createTextNode("terday"); + + { + success = false; + try { + retval = titleAttr.insertBefore(textNode,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_attrinsertbefore6(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.xhtml new file mode 100644 index 0000000..d3dfaed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore6.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7-expected.txt new file mode 100644 index 0000000..c169310 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore7 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.js b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.js new file mode 100644 index 0000000..f014502 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.js @@ -0,0 +1,160 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrinsertbefore7"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a document fragment containing a CDATASection to an attribute. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_attrinsertbefore7() { + var success; + if(checkInitialization(builder, "hc_attrinsertbefore7") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var terNode; + var dayNode; + var docFrag; + var retval; + var firstChild; + var lastChild; + var refChild = null; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + terNode = doc.createTextNode("ter"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + dayNode = doc.createCDATASection("day"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + dayNode = doc.createCDATASection("day"); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + + { + success = false; + try { + retval = titleAttr.insertBefore(docFrag,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + + } + +} + + + + +function runTest() { + hc_attrinsertbefore7(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.xhtml new file mode 100644 index 0000000..65928c0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrinsertbefore7.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild-expected.txt new file mode 100644 index 0000000..da41c24 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrlastchild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.js b/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.js new file mode 100644 index 0000000..1df7342 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrlastchild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Checks that Node.lastChild for an attribute node contains +the expected text node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +*/ +function hc_attrlastchild() { + var success; + if(checkInitialization(builder, "hc_attrlastchild") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var otherChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = titleAttr.firstChild; + + assertNotNull("textNodeNotNull",textNode); +value = textNode.nodeValue; + + assertEquals("child1IsYes","Yes",value); + otherChild = textNode.nextSibling; + + assertNull("nextSiblingIsNull",otherChild); + otherChild = textNode.previousSibling; + + assertNull("previousSiblingIsNull",otherChild); + +} + + + + +function runTest() { + hc_attrlastchild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.xhtml new file mode 100644 index 0000000..b1d42d8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrlastchild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrname-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrname-expected.txt new file mode 100644 index 0000000..b8ec73a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrname-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrname +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrname.js b/LayoutTests/dom/xhtml/level1/core/hc_attrname.js new file mode 100644 index 0000000..890fae1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrname.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrname"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the attribute named class from the last + child of of the second "p" element and examine its + NodeName. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +*/ +function hc_attrname() { + var success; + if(checkInitialization(builder, "hc_attrname") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var streetAttr; + var strong1; + var strong2; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(1); + attributes = testNode.attributes; + + streetAttr = attributes.getNamedItem("class"); + strong1 = streetAttr.nodeName; + + strong2 = streetAttr.name; + + assertEqualsAutoCase("attribute", "nodeName","class",strong1); + assertEqualsAutoCase("attribute", "name","class",strong2); + +} + + + + +function runTest() { + hc_attrname(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrname.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrname.xhtml new file mode 100644 index 0000000..47af556 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrname.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt new file mode 100644 index 0000000..85c225b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnextsiblingnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.js b/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.js new file mode 100644 index 0000000..12fc9f9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnextsiblingnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getNextSibling()" method for an Attr node should return null. +Retrieve the attribute named "domestic" from the last child of of the +first employee and examine its NextSibling node. This test uses the +"getNamedItem(name)" method from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ +function hc_attrnextsiblingnull() { + var success; + if(checkInitialization(builder, "hc_attrnextsiblingnull") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var domesticAttr; + var s; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(0); + attributes = testNode.attributes; + + domesticAttr = attributes.getNamedItem("title"); + s = domesticAttr.nextSibling; + + assertNull("attrNextSiblingNullAssert",s); + +} + + + + +function runTest() { + hc_attrnextsiblingnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.xhtml new file mode 100644 index 0000000..7188643 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrnextsiblingnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize-expected.txt new file mode 100644 index 0000000..7ef85b5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnormalize +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.js b/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.js new file mode 100644 index 0000000..d9f5e29 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrnormalize"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Appends a text node to an attribute, normalizes the attribute +and checks for a single child node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +*/ +function hc_attrnormalize() { + var success; + if(checkInitialization(builder, "hc_attrnormalize") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var firstChild; + var secondChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + retval = titleAttr.appendChild(textNode); + textNode = doc.createTextNode(""); + retval = titleAttr.appendChild(textNode); + testNode.normalize(); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Yesterday",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","Yesterday",value); + secondChild = firstChild.nextSibling; + + assertNull("secondChildIsNull",secondChild); + +} + + + + +function runTest() { + hc_attrnormalize(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.xhtml new file mode 100644 index 0000000..b88c2d2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrnormalize.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull-expected.txt new file mode 100644 index 0000000..d943f82 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrparentnodenull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.js b/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.js new file mode 100644 index 0000000..3c6a403 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrparentnodenull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getParentNode()" method for an Attr node should return null. Retrieve +the attribute named "domestic" from the last child of the first employee +and examine its parentNode attribute. This test also uses the "getNamedItem(name)" +method from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ +function hc_attrparentnodenull() { + var success; + if(checkInitialization(builder, "hc_attrparentnodenull") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var domesticAttr; + var s; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(0); + attributes = testNode.attributes; + + domesticAttr = attributes.getNamedItem("title"); + s = domesticAttr.parentNode; + + assertNull("attrParentNodeNullAssert",s); + +} + + + + +function runTest() { + hc_attrparentnodenull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.xhtml new file mode 100644 index 0000000..ef664a6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrparentnodenull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt new file mode 100644 index 0000000..b2513f7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrprevioussiblingnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.js b/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.js new file mode 100644 index 0000000..2773718 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrprevioussiblingnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getPreviousSibling()" method for an Attr node should return null. +Retrieve the attribute named "domestic" from the last child of of the +first employee and examine its PreviousSibling node. This test uses the +"getNamedItem(name)" method from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ +function hc_attrprevioussiblingnull() { + var success; + if(checkInitialization(builder, "hc_attrprevioussiblingnull") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var domesticAttr; + var s; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(0); + attributes = testNode.attributes; + + domesticAttr = attributes.getNamedItem("title"); + s = domesticAttr.previousSibling; + + assertNull("attrPreviousSiblingNullAssert",s); + +} + + + + +function runTest() { + hc_attrprevioussiblingnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml new file mode 100644 index 0000000..9e66565 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrprevioussiblingnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1-expected.txt new file mode 100644 index 0000000..7f426f6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.js new file mode 100644 index 0000000..5f98746 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Removes the child node of an attribute and checks that the value is empty. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ +function hc_attrremovechild1() { + var success; + if(checkInitialization(builder, "hc_attrremovechild1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var firstChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = titleAttr.firstChild; + + assertNotNull("attrChildNotNull",textNode); +retval = titleAttr.removeChild(textNode); + value = titleAttr.value; + + assertEquals("attrValue","",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","",value); + value = retval.nodeValue; + + assertEquals("retvalValue","Yes",value); + firstChild = titleAttr.firstChild; + + assertNull("firstChildNull",firstChild); + +} + + + + +function runTest() { + hc_attrremovechild1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.xhtml new file mode 100644 index 0000000..aeaafc5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2-expected.txt new file mode 100644 index 0000000..1a7d321 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.js new file mode 100644 index 0000000..3e19f4e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrremovechild2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Attempts to remove a freshly created text node which should result in a NOT_FOUND_ERR exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +*/ +function hc_attrremovechild2() { + var success; + if(checkInitialization(builder, "hc_attrremovechild2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("Yesterday"); + + { + success = false; + try { + retval = titleAttr.removeChild(textNode); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 8); + } + assertTrue("throw_NOT_FOUND_ERR",success); + } + +} + + + + +function runTest() { + hc_attrremovechild2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.xhtml new file mode 100644 index 0000000..09352c1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrremovechild2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1-expected.txt new file mode 100644 index 0000000..7617bf6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.js new file mode 100644 index 0000000..ff499e5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.js @@ -0,0 +1,135 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Replaces a text node of an attribute and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ +function hc_attrreplacechild1() { + var success; + if(checkInitialization(builder, "hc_attrreplacechild1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var firstChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + firstChild = titleAttr.firstChild; + + assertNotNull("attrChildNotNull",firstChild); +retval = titleAttr.replaceChild(textNode,firstChild); + value = titleAttr.value; + + assertEquals("attrValue","terday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","terday",value); + value = retval.nodeValue; + + assertEquals("retvalValue","Yes",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","terday",value); + +} + + + + +function runTest() { + hc_attrreplacechild1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.xhtml new file mode 100644 index 0000000..86b5a88 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2-expected.txt new file mode 100644 index 0000000..ecfae55 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.js new file mode 100644 index 0000000..c26d316 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.js @@ -0,0 +1,141 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrreplacechild2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Replaces a text node of an attribute with a document fragment and checks if the value of +the attribute is changed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ +function hc_attrreplacechild2() { + var success; + if(checkInitialization(builder, "hc_attrreplacechild2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var terNode; + var dayNode; + var docFrag; + var retval; + var firstChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + terNode = doc.createTextNode("ter"); + dayNode = doc.createTextNode("day"); + docFrag = doc.createDocumentFragment(); + retval = docFrag.appendChild(terNode); + retval = docFrag.appendChild(dayNode); + firstChild = titleAttr.firstChild; + + assertNotNull("attrChildNotNull",firstChild); +retval = titleAttr.replaceChild(docFrag,firstChild); + value = titleAttr.value; + + assertEquals("attrValue","terday",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","terday",value); + value = retval.nodeValue; + + assertEquals("retvalValue","Yes",value); + firstChild = titleAttr.firstChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","ter",value); + +} + + + + +function runTest() { + hc_attrreplacechild2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.xhtml new file mode 100644 index 0000000..62a3424 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrreplacechild2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1-expected.txt new file mode 100644 index 0000000..3769b43 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.js b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.js new file mode 100644 index 0000000..457f7b6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.js @@ -0,0 +1,135 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Sets Attr.value on an attribute that only has a simple value. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ +function hc_attrsetvalue1() { + var success; + if(checkInitialization(builder, "hc_attrsetvalue1") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var retval; + var firstChild; + var otherChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + firstChild = titleAttr.firstChild; + + assertNotNull("attrChildNotNull",firstChild); +titleAttr.value = "Tomorrow"; + + firstChild.nodeValue = "impl reused node"; + + value = titleAttr.value; + + assertEquals("attrValue","Tomorrow",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Tomorrow",value); + firstChild = titleAttr.lastChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","Tomorrow",value); + otherChild = firstChild.nextSibling; + + assertNull("nextSiblingIsNull",otherChild); + +} + + + + +function runTest() { + hc_attrsetvalue1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.xhtml new file mode 100644 index 0000000..d249ed4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2-expected.txt new file mode 100644 index 0000000..e99f64e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.js b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.js new file mode 100644 index 0000000..029d7d5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.js @@ -0,0 +1,138 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrsetvalue2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Sets Attr.value on an attribute that should contain multiple child nodes. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-221662474 +*/ +function hc_attrsetvalue2() { + var success; + if(checkInitialization(builder, "hc_attrsetvalue2") != null) return; + var doc; + var acronymList; + var testNode; + var attributes; + var titleAttr; + var value; + var textNode; + var retval; + var firstChild; + var otherChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + acronymList = doc.getElementsByTagName("acronym"); + testNode = acronymList.item(3); + attributes = testNode.attributes; + + titleAttr = attributes.getNamedItem("title"); + textNode = doc.createTextNode("terday"); + retval = titleAttr.appendChild(textNode); + firstChild = titleAttr.firstChild; + + assertNotNull("attrChildNotNull",firstChild); +titleAttr.value = "Tomorrow"; + + firstChild.nodeValue = "impl reused node"; + + value = titleAttr.value; + + assertEquals("attrValue","Tomorrow",value); + value = titleAttr.nodeValue; + + assertEquals("attrNodeValue","Tomorrow",value); + firstChild = titleAttr.lastChild; + + value = firstChild.nodeValue; + + assertEquals("firstChildValue","Tomorrow",value); + otherChild = firstChild.nextSibling; + + assertNull("nextSiblingIsNull",otherChild); + +} + + + + +function runTest() { + hc_attrsetvalue2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.xhtml new file mode 100644 index 0000000..badfccd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt new file mode 100644 index 0000000..56e1cff --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.js new file mode 100644 index 0000000..deb504d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.js @@ -0,0 +1,121 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getSpecified()" method for an Attr node should + be set to true if the attribute was explicitly given + a value. + Retrieve the attribute named "domestic" from the last + child of of the first employee and examine the value + returned by the "getSpecified()" method. This test uses + the "getNamedItem(name)" method from the NamedNodeMap + interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +*/ +function hc_attrspecifiedvalue() { + var success; + if(checkInitialization(builder, "hc_attrspecifiedvalue") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var domesticAttr; + var state; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(0); + attributes = testNode.attributes; + + domesticAttr = attributes.getNamedItem("title"); + state = domesticAttr.specified; + + assertTrue("acronymTitleSpecified",state); + +} + + + + +function runTest() { + hc_attrspecifiedvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.xhtml new file mode 100644 index 0000000..e3a1553 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt new file mode 100644 index 0000000..0d48141 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvaluechanged +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.js b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.js new file mode 100644 index 0000000..fd65931 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrspecifiedvaluechanged"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getSpecified()" method for an Attr node should return true if the + value of the attribute is changed. + Retrieve the attribute named "class" from the last + child of of the THIRD employee and change its + value to "Yes"(which is the default DTD value). This + should cause the "getSpecified()" method to be true. + This test uses the "setAttribute(name,value)" method + from the Element interface and the "getNamedItem(name)" + method from the NamedNodeMap interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-862529273 +*/ +function hc_attrspecifiedvaluechanged() { + var success; + if(checkInitialization(builder, "hc_attrspecifiedvaluechanged") != null) return; + var doc; + var addressList; + var testNode; + var attributes; + var streetAttr; + var state; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testNode = addressList.item(2); + testNode.setAttribute("class","Yα"); + attributes = testNode.attributes; + + streetAttr = attributes.getNamedItem("class"); + state = streetAttr.specified; + + assertTrue("acronymClassSpecified",state); + +} + + + + +function runTest() { + hc_attrspecifiedvaluechanged(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml new file mode 100644 index 0000000..eaf5b1d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_attrspecifiedvaluechanged.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata-expected.txt new file mode 100644 index 0000000..e8af24e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddata +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.js new file mode 100644 index 0000000..a479174 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddata"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "appendData(arg)" method appends a string to the end + of the character data of the node. + + Retrieve the character data from the second child + of the first employee. The appendData(arg) method is + called with arg=", Esquire". The method should append + the specified data to the already existing character + data. The new value return by the "getLength()" method + should be 24. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ +function hc_characterdataappenddata() { + var success; + if(checkInitialization(builder, "hc_characterdataappenddata") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childValue; + var childLength; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.appendData(", Esquire"); + childValue = child.data; + + childLength = childValue.length; + assertEquals("characterdataAppendDataAssert",24,childLength); + +} + + + + +function runTest() { + hc_characterdataappenddata(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.xhtml new file mode 100644 index 0000000..2a06fe5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddata.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt new file mode 100644 index 0000000..ce0ce99 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddatagetdata +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.js new file mode 100644 index 0000000..4aed0ce --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddatagetdata"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + On successful invocation of the "appendData(arg)" + method the "getData()" method provides access to the + concatentation of data and the specified string. + + Retrieve the character data from the second child + of the first employee. The appendData(arg) method is + called with arg=", Esquire". The method should append + the specified data to the already existing character + data. The new value return by the "getData()" method + should be "Margaret Martin, Esquire". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F +*/ +function hc_characterdataappenddatagetdata() { + var success; + if(checkInitialization(builder, "hc_characterdataappenddatagetdata") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.appendData(", Esquire"); + childData = child.data; + + assertEquals("characterdataAppendDataGetDataAssert","Margaret Martin, Esquire",childData); + +} + + + + +function runTest() { + hc_characterdataappenddatagetdata(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml new file mode 100644 index 0000000..da82860 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataappenddatagetdata.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt new file mode 100644 index 0000000..79505d7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatabegining +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.js new file mode 100644 index 0000000..8fc32ed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatabegining"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "deleteData(offset,count)" method removes a range of +characters from the node. Delete data at the beginning +of the character data. + +Retrieve the character data from the last child of the +first employee. The "deleteData(offset,count)" +method is then called with offset=0 and count=16. +The method should delete the characters from position +0 thru position 16. The new value of the character data +should be "Dallas, Texas 98551". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ +function hc_characterdatadeletedatabegining() { + var success; + if(checkInitialization(builder, "hc_characterdatadeletedatabegining") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.deleteData(0,16); + childData = child.data; + + assertEquals("data","Dallas, Texas 98551",childData); + +} + + + + +function runTest() { + hc_characterdatadeletedatabegining(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml new file mode 100644 index 0000000..a9ccbb1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatabegining.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt new file mode 100644 index 0000000..b2ba444 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataend +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.js new file mode 100644 index 0000000..8d567d0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataend"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "deleteData(offset,count)" method removes a range of + characters from the node. Delete data at the end + of the character data. + + Retrieve the character data from the last child of the + first employee. The "deleteData(offset,count)" + method is then called with offset=30 and count=5. + The method should delete the characters from position + 30 thru position 35. The new value of the character data + should be "1230 North Ave. Dallas, Texas". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ +function hc_characterdatadeletedataend() { + var success; + if(checkInitialization(builder, "hc_characterdatadeletedataend") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.deleteData(30,5); + childData = child.data; + + assertEquals("characterdataDeleteDataEndAssert","1230 North Ave. Dallas, Texas ",childData); + +} + + + + +function runTest() { + hc_characterdatadeletedataend(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.xhtml new file mode 100644 index 0000000..435872a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataend.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt new file mode 100644 index 0000000..6c09af0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataexceedslength +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js new file mode 100644 index 0000000..4dccc5e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.js @@ -0,0 +1,125 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedataexceedslength"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the sum of the offset and count used in the + "deleteData(offset,count) method is greater than the + length of the character data then all the characters + from the offset to the end of the data are deleted. + + Retrieve the character data from the last child of the + first employee. The "deleteData(offset,count)" + method is then called with offset=4 and count=50. + The method should delete the characters from position 4 + to the end of the data since the offset+count(50+4) + is greater than the length of the character data(35). + The new value of the character data should be "1230". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ +function hc_characterdatadeletedataexceedslength() { + var success; + if(checkInitialization(builder, "hc_characterdatadeletedataexceedslength") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.deleteData(4,50); + childData = child.data; + + assertEquals("characterdataDeleteDataExceedsLengthAssert","1230",childData); + +} + + + + +function runTest() { + hc_characterdatadeletedataexceedslength(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml new file mode 100644 index 0000000..9ab7058 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedataexceedslength.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt new file mode 100644 index 0000000..de35a03 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatagetlengthanddata +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js new file mode 100644 index 0000000..b3784f3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatagetlengthanddata"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + On successful invocation of the "deleteData(offset,count)" + method, the "getData()" and "getLength()" methods reflect + the changes. + + Retrieve the character data from the last child of the + first employee. The "deleteData(offset,count)" + method is then called with offset=30 and count=5. + The method should delete the characters from position + 30 thru position 35. The new value of the character data + should be "1230 North Ave. Dallas, Texas" which is + returned by the "getData()" method and "getLength()" + method should return 30". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ +function hc_characterdatadeletedatagetlengthanddata() { + var success; + if(checkInitialization(builder, "hc_characterdatadeletedatagetlengthanddata") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + var childLength; + var result = new Array(); + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.deleteData(30,5); + childData = child.data; + + assertEquals("data","1230 North Ave. Dallas, Texas ",childData); + childLength = child.length; + + assertEquals("length",30,childLength); + +} + + + + +function runTest() { + hc_characterdatadeletedatagetlengthanddata(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml new file mode 100644 index 0000000..61fc858 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatagetlengthanddata.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt new file mode 100644 index 0000000..476e39f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatamiddle +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.js new file mode 100644 index 0000000..9afa810 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatadeletedatamiddle"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "deleteData(offset,count)" method removes a range of + characters from the node. Delete data in the middle + of the character data. + + Retrieve the character data from the last child of the + first employee. The "deleteData(offset,count)" + method is then called with offset=16 and count=8. + The method should delete the characters from position + 16 thru position 24. The new value of the character data + should be "1230 North Ave. Texas 98551". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ +function hc_characterdatadeletedatamiddle() { + var success; + if(checkInitialization(builder, "hc_characterdatadeletedatamiddle") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.deleteData(16,8); + childData = child.data; + + assertEquals("characterdataDeleteDataMiddleAssert","1230 North Ave. Texas 98551",childData); + +} + + + + +function runTest() { + hc_characterdatadeletedatamiddle(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml new file mode 100644 index 0000000..2df90c5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatadeletedatamiddle.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata-expected.txt new file mode 100644 index 0000000..327b218 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetdata +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.js new file mode 100644 index 0000000..ef16bb0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetdata"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + The "getData()" method retrieves the character data + + currently stored in the node. + + Retrieve the character data from the second child + + of the first employee and invoke the "getData()" + + method. The method returns the character data + + string. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ +function hc_characterdatagetdata() { + var success; + if(checkInitialization(builder, "hc_characterdatagetdata") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + childData = child.data; + + assertEquals("characterdataGetDataAssert","Margaret Martin",childData); + +} + + + + +function runTest() { + hc_characterdatagetdata(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.xhtml new file mode 100644 index 0000000..77b86aa --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetdata.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength-expected.txt new file mode 100644 index 0000000..5daf261 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetlength +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.js new file mode 100644 index 0000000..214b14c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.js @@ -0,0 +1,119 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatagetlength"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getLength()" method returns the number of characters + stored in this nodes data. + Retrieve the character data from the second + child of the first employee and examine the + value returned by the getLength() method. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7D61178C +*/ +function hc_characterdatagetlength() { + var success; + if(checkInitialization(builder, "hc_characterdatagetlength") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childValue; + var childLength; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + childValue = child.data; + + childLength = childValue.length; + assertEquals("characterdataGetLengthAssert",15,childLength); + +} + + + + +function runTest() { + hc_characterdatagetlength(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.xhtml new file mode 100644 index 0000000..cd3a3b1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatagetlength.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt new file mode 100644 index 0000000..7003258 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js new file mode 100644 index 0000000..9d03881 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "deleteData(offset,count)" method raises an + INDEX_SIZE_ERR DOMException if the specified count + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its "deleteData(offset,count)" + method with offset=10 and count=-3. It should raise the + desired exception since the count is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ +function hc_characterdataindexsizeerrdeletedatacountnegative() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrdeletedatacountnegative") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childSubstring; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + childSubstring = child.substringData(10,-3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrdeletedatacountnegative(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml new file mode 100644 index 0000000..a78bbc9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt new file mode 100644 index 0000000..1c04b82 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js new file mode 100644 index 0000000..a66a6c1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "deleteData(offset,count)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is greater that the number of characters in the string. + + Retrieve the character data of the last child of the + first employee and invoke its "deleteData(offset,count)" + method with offset=40 and count=3. It should raise the + desired exception since the offset is greater than the + number of characters in the string. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_characterdataindexsizeerrdeletedataoffsetgreater() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrdeletedataoffsetgreater") != null) return; + var doc; + var elementList; + var nameNode; + var child; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + child.deleteData(40,3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throw_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrdeletedataoffsetgreater(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml new file mode 100644 index 0000000..3050ff0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt new file mode 100644 index 0000000..0d83913 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js new file mode 100644 index 0000000..ca26f7d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "deleteData(offset,count)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its "deleteData(offset,count)" + method with offset=-5 and count=3. It should raise the + desired exception since the offset is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +*/ +function hc_characterdataindexsizeerrdeletedataoffsetnegative() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrdeletedataoffsetnegative") != null) return; + var doc; + var elementList; + var nameNode; + var child; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + child.deleteData(-5,3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrdeletedataoffsetnegative(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml new file mode 100644 index 0000000..ba45638 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt new file mode 100644 index 0000000..0891e6e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js new file mode 100644 index 0000000..0abfe7e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertData(offset,arg)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is greater than the number of characters in the string. + + Retrieve the character data of the last child of the + first employee and invoke its insertData"(offset,arg)" + method with offset=40 and arg="ABC". It should raise + the desired exception since the offset is greater than + the number of characters in the string. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_characterdataindexsizeerrinsertdataoffsetgreater() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrinsertdataoffsetgreater") != null) return; + var doc; + var elementList; + var nameNode; + var child; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + child.deleteData(40,3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throw_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrinsertdataoffsetgreater(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml new file mode 100644 index 0000000..f84b6ad --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt new file mode 100644 index 0000000..bfb8f9e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js new file mode 100644 index 0000000..4712b94 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertData(offset,arg)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its insertData"(offset,arg)" + method with offset=-5 and arg="ABC". It should raise + the desired exception since the offset is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ +function hc_characterdataindexsizeerrinsertdataoffsetnegative() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrinsertdataoffsetnegative") != null) return; + var doc; + var elementList; + var nameNode; + var child; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + child.replaceData(-5,3,"ABC"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrinsertdataoffsetnegative(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml new file mode 100644 index 0000000..ba4d491 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt new file mode 100644 index 0000000..f99ebcc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js new file mode 100644 index 0000000..7a2b7d2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceData(offset,count,arg)" method raises an + INDEX_SIZE_ERR DOMException if the specified count + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its + "replaceData(offset,count,arg) method with offset=10 + and count=-3 and arg="ABC". It should raise the + desired exception since the count is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ +function hc_characterdataindexsizeerrreplacedatacountnegative() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrreplacedatacountnegative") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var badString; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + badString = child.substringData(10,-3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrreplacedatacountnegative(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml new file mode 100644 index 0000000..1242a16 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt new file mode 100644 index 0000000..62e4f30 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js new file mode 100644 index 0000000..dc62aa7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceData(offset,count,arg)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is greater than the length of the string. + + Retrieve the character data of the last child of the + first employee and invoke its + "replaceData(offset,count,arg) method with offset=40 + and count=3 and arg="ABC". It should raise the + desired exception since the offset is greater than the + length of the string. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-7C603781 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-7C603781')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=242 +*/ +function hc_characterdataindexsizeerrreplacedataoffsetgreater() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrreplacedataoffsetgreater") != null) return; + var doc; + var elementList; + var nameNode; + var child; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + child.deleteData(40,3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throw_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrreplacedataoffsetgreater(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml new file mode 100644 index 0000000..4d43554 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt new file mode 100644 index 0000000..cfeacf1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js new file mode 100644 index 0000000..af267df --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceData(offset,count,arg)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its + "replaceData(offset,count,arg) method with offset=-5 + and count=3 and arg="ABC". It should raise the + desired exception since the offset is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-E5CBA7FB')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ +function hc_characterdataindexsizeerrreplacedataoffsetnegative() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrreplacedataoffsetnegative") != null) return; + var doc; + var elementList; + var nameNode; + var child; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + child.replaceData(-5,3,"ABC"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrreplacedataoffsetnegative(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml new file mode 100644 index 0000000..9999a62 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt new file mode 100644 index 0000000..a9205ed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringcountnegative +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js new file mode 100644 index 0000000..2e96dbe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringcountnegative"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "substringData(offset,count)" method raises an + INDEX_SIZE_ERR DOMException if the specified count + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its "substringData(offset,count) + method with offset=10 and count=-3. It should raise the + desired exception since the count is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ +function hc_characterdataindexsizeerrsubstringcountnegative() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrsubstringcountnegative") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var badSubstring; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + badSubstring = child.substringData(10,-3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrsubstringcountnegative(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml new file mode 100644 index 0000000..c58afbe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt new file mode 100644 index 0000000..010f034 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js new file mode 100644 index 0000000..bc2fbf1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "substringData(offset,count)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is negative. + + Retrieve the character data of the last child of the + first employee and invoke its "substringData(offset,count) + method with offset=-5 and count=3. It should raise the + desired exception since the offset is negative. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ +function hc_characterdataindexsizeerrsubstringnegativeoffset() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrsubstringnegativeoffset") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var badString; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + badString = child.substringData(-5,3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrsubstringnegativeoffset(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml new file mode 100644 index 0000000..917c13a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt new file mode 100644 index 0000000..37e83e6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js new file mode 100644 index 0000000..65325c7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "substringData(offset,count)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset + is greater than the number of characters in the string. + + Retrieve the character data of the last child of the + first employee and invoke its "substringData(offset,count) + method with offset=40 and count=3. It should raise the + desired exception since the offsets value is greater + than the length. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-6531BCCF')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_characterdataindexsizeerrsubstringoffsetgreater() { + var success; + if(checkInitialization(builder, "hc_characterdataindexsizeerrsubstringoffsetgreater") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var badString; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + + { + success = false; + try { + badString = child.substringData(40,3); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throw_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_characterdataindexsizeerrsubstringoffsetgreater(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml new file mode 100644 index 0000000..ea47268 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt new file mode 100644 index 0000000..bc35698 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatabeginning +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.js new file mode 100644 index 0000000..576e855 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatabeginning"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "insertData(offset,arg)" method will insert a string +at the specified character offset. Insert the data at +the beginning of the character data. + +Retrieve the character data from the second child of +the first employee. The "insertData(offset,arg)" +method is then called with offset=0 and arg="Mss.". +The method should insert the string "Mss." at position 0. +The new value of the character data should be +"Mss. Margaret Martin". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ +function hc_characterdatainsertdatabeginning() { + var success; + if(checkInitialization(builder, "hc_characterdatainsertdatabeginning") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.insertData(0,"Mss. "); + childData = child.data; + + assertEquals("characterdataInsertDataBeginningAssert","Mss. Margaret Martin",childData); + +} + + + + +function runTest() { + hc_characterdatainsertdatabeginning(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml new file mode 100644 index 0000000..e316535 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatabeginning.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt new file mode 100644 index 0000000..6606f51 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdataend +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.js new file mode 100644 index 0000000..424f776 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdataend"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertData(offset,arg)" method will insert a string + at the specified character offset. Insert the data at + the end of the character data. + + Retrieve the character data from the second child of + the first employee. The "insertData(offset,arg)" + method is then called with offset=15 and arg=", Esquire". + The method should insert the string ", Esquire" at + position 15. The new value of the character data should + be "Margaret Martin, Esquire". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ +function hc_characterdatainsertdataend() { + var success; + if(checkInitialization(builder, "hc_characterdatainsertdataend") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.insertData(15,", Esquire"); + childData = child.data; + + assertEquals("characterdataInsertDataEndAssert","Margaret Martin, Esquire",childData); + +} + + + + +function runTest() { + hc_characterdatainsertdataend(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.xhtml new file mode 100644 index 0000000..e941d77 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdataend.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt new file mode 100644 index 0000000..6f26e29 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatamiddle +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.js new file mode 100644 index 0000000..081714c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatainsertdatamiddle"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertData(offset,arg)" method will insert a string + at the specified character offset. Insert the data in + the middle of the character data. + + Retrieve the character data from the second child of + the first employee. The "insertData(offset,arg)" + method is then called with offset=9 and arg="Ann". + The method should insert the string "Ann" at position 9. + The new value of the character data should be + "Margaret Ann Martin". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3EDB695F +*/ +function hc_characterdatainsertdatamiddle() { + var success; + if(checkInitialization(builder, "hc_characterdatainsertdatamiddle") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.insertData(9,"Ann "); + childData = child.data; + + assertEquals("characterdataInsertDataMiddleAssert","Margaret Ann Martin",childData); + +} + + + + +function runTest() { + hc_characterdatainsertdatamiddle(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml new file mode 100644 index 0000000..d7f019b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatainsertdatamiddle.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt new file mode 100644 index 0000000..93c63ac --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatabegining +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.js new file mode 100644 index 0000000..2f5820d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatabegining"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "replaceData(offset,count,arg)" method replaces the +characters starting at the specified offset with the +specified string. Test for replacement in the +middle of the data. + +Retrieve the character data from the last child of the +first employee. The "replaceData(offset,count,arg)" +method is then called with offset=5 and count=5 and +arg="South". The method should replace characters five +thru 9 of the character data with "South". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ +function hc_characterdatareplacedatabegining() { + var success; + if(checkInitialization(builder, "hc_characterdatareplacedatabegining") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.replaceData(0,4,"2500"); + childData = child.data; + + assertEquals("characterdataReplaceDataBeginingAssert","2500 North Ave. Dallas, Texas 98551",childData); + +} + + + + +function runTest() { + hc_characterdatareplacedatabegining(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml new file mode 100644 index 0000000..ba3bbb1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatabegining.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt new file mode 100644 index 0000000..4b306da --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataend +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.js new file mode 100644 index 0000000..8c01d58 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataend"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceData(offset,count,arg)" method replaces the + characters starting at the specified offset with the + specified string. Test for replacement at the + end of the data. + + Retrieve the character data from the last child of the + first employee. The "replaceData(offset,count,arg)" + method is then called with offset=30 and count=5 and + arg="98665". The method should replace characters 30 + thru 34 of the character data with "98665". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ +function hc_characterdatareplacedataend() { + var success; + if(checkInitialization(builder, "hc_characterdatareplacedataend") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.replaceData(30,5,"98665"); + childData = child.data; + + assertEquals("characterdataReplaceDataEndAssert","1230 North Ave. Dallas, Texas 98665",childData); + +} + + + + +function runTest() { + hc_characterdatareplacedataend(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.xhtml new file mode 100644 index 0000000..01a773d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataend.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt new file mode 100644 index 0000000..7233ff5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofarg +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js new file mode 100644 index 0000000..a9cf8e2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofarg"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceData(offset,count,arg)" method replaces the + characters starting at the specified offset with the + specified string. Test the situation where the length + of the arg string is greater than the specified offset. + + Retrieve the character data from the last child of the + first employee. The "replaceData(offset,count,arg)" + method is then called with offset=0 and count=4 and + arg="260030". The method should replace characters one + thru four with "260030". Note that the length of the + specified string is greater that the specified offset. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ +function hc_characterdatareplacedataexceedslengthofarg() { + var success; + if(checkInitialization(builder, "hc_characterdatareplacedataexceedslengthofarg") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.replaceData(0,4,"260030"); + childData = child.data; + + assertEquals("characterdataReplaceDataExceedsLengthOfArgAssert","260030 North Ave. Dallas, Texas 98551",childData); + +} + + + + +function runTest() { + hc_characterdatareplacedataexceedslengthofarg(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml new file mode 100644 index 0000000..a248079 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofarg.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt new file mode 100644 index 0000000..1f39aa6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofdata +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js new file mode 100644 index 0000000..b2b4205 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedataexceedslengthofdata"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the sum of the offset and count exceeds the length then + all the characters to the end of the data are replaced. + + Retrieve the character data from the last child of the + first employee. The "replaceData(offset,count,arg)" + method is then called with offset=0 and count=50 and + arg="2600". The method should replace all the characters + with "2600". This is because the sum of the offset and + count exceeds the length of the character data. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ +function hc_characterdatareplacedataexceedslengthofdata() { + var success; + if(checkInitialization(builder, "hc_characterdatareplacedataexceedslengthofdata") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.replaceData(0,50,"2600"); + childData = child.data; + + assertEquals("characterdataReplaceDataExceedsLengthOfDataAssert","2600",childData); + +} + + + + +function runTest() { + hc_characterdatareplacedataexceedslengthofdata(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml new file mode 100644 index 0000000..05f593d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedataexceedslengthofdata.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt new file mode 100644 index 0000000..26be6c8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatamiddle +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.js new file mode 100644 index 0000000..6558cde --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatareplacedatamiddle"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceData(offset,count,arg)" method replaces the + characters starting at the specified offset with the + specified string. Test for replacement in the + middle of the data. + + Retrieve the character data from the last child of the + first employee. The "replaceData(offset,count,arg)" + method is then called with offset=5 and count=5 and + arg="South". The method should replace characters five + thru 9 of the character data with "South". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-E5CBA7FB +*/ +function hc_characterdatareplacedatamiddle() { + var success; + if(checkInitialization(builder, "hc_characterdatareplacedatamiddle") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.replaceData(5,5,"South"); + childData = child.data; + + assertEquals("characterdataReplaceDataMiddleAssert","1230 South Ave. Dallas, Texas 98551",childData); + +} + + + + +function runTest() { + hc_characterdatareplacedatamiddle(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml new file mode 100644 index 0000000..6a01efa --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatareplacedatamiddle.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt new file mode 100644 index 0000000..cc5f5af --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasetnodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.js new file mode 100644 index 0000000..e56ce72 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasetnodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setNodeValue()" method changes the character data + currently stored in the node. + Retrieve the character data from the second child + of the first employee and invoke the "setNodeValue()" + method, call "getData()" and compare. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359 +*/ +function hc_characterdatasetnodevalue() { + var success; + if(checkInitialization(builder, "hc_characterdatasetnodevalue") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var childData; + var childValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + child.nodeValue = "Marilyn Martin"; + + childData = child.data; + + assertEquals("data","Marilyn Martin",childData); + childValue = child.nodeValue; + + assertEquals("value","Marilyn Martin",childValue); + +} + + + + +function runTest() { + hc_characterdatasetnodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml new file mode 100644 index 0000000..1be9f88 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasetnodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt new file mode 100644 index 0000000..fff6d3c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringexceedsvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js new file mode 100644 index 0000000..043dac2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringexceedsvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the sum of the "offset" and "count" exceeds the + "length" then the "substringData(offset,count)" method + returns all the characters to the end of the data. + + Retrieve the character data from the second child + of the first employee and access part of the data + by using the substringData(offset,count) method + with offset=9 and count=10. The method should return + the substring "Martin" since offset+count > length + (19 > 15). + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +*/ +function hc_characterdatasubstringexceedsvalue() { + var success; + if(checkInitialization(builder, "hc_characterdatasubstringexceedsvalue") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var substring; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + substring = child.substringData(9,10); + assertEquals("characterdataSubStringExceedsValueAssert","Martin",substring); + +} + + + + +function runTest() { + hc_characterdatasubstringexceedsvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml new file mode 100644 index 0000000..f41ab58 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringexceedsvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt new file mode 100644 index 0000000..5c38d25 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.js new file mode 100644 index 0000000..379e3b0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.js @@ -0,0 +1,119 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdatasubstringvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "substringData(offset,count)" method returns the + specified string. + + Retrieve the character data from the second child + of the first employee and access part of the data + by using the substringData(offset,count) method. The + method should return the specified substring starting + at position "offset" and extract "count" characters. + The method should return the string "Margaret". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6531BCCF +*/ +function hc_characterdatasubstringvalue() { + var success; + if(checkInitialization(builder, "hc_characterdatasubstringvalue") != null) return; + var doc; + var elementList; + var nameNode; + var child; + var substring; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(0); + child = nameNode.firstChild; + + substring = child.substringData(0,8); + assertEquals("characterdataSubStringValueAssert","Margaret",substring); + +} + + + + +function runTest() { + hc_characterdatasubstringvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml new file mode 100644 index 0000000..d283565 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_characterdatasubstringvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment-expected.txt new file mode 100644 index 0000000..489c6ff --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_commentgetcomment +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.js b/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.js new file mode 100644 index 0000000..b7c76b4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.js @@ -0,0 +1,144 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_commentgetcomment"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + A comment is all the characters between the starting + '' + Retrieve the nodes of the DOM document. Search for a + comment node and the content is its value. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=509 +*/ +function hc_commentgetcomment() { + var success; + if(checkInitialization(builder, "hc_commentgetcomment") != null) return; + var doc; + var elementList; + var child; + var childName; + var childValue; + var commentCount = 0; + var childType; + var attributes; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.childNodes; + + for(var indexN1005E = 0;indexN1005E < elementList.length; indexN1005E++) { + child = elementList.item(indexN1005E); + childType = child.nodeType; + + + if( + (8 == childType) + ) { + childName = child.nodeName; + + assertEquals("nodeName","#comment",childName); + childValue = child.nodeValue; + + assertEquals("nodeValue"," This is comment number 1.",childValue); + attributes = child.attributes; + + assertNull("attributes",attributes); + commentCount += 1; + + } + + } + assertTrue("atMostOneComment", + + (commentCount < 2) +); + +} + + + + +function runTest() { + hc_commentgetcomment(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.xhtml new file mode 100644 index 0000000..05e3970 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_commentgetcomment.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute-expected.txt new file mode 100644 index 0000000..e87d870 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.js new file mode 100644 index 0000000..31284f3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the entire DOM document and invoke its + "createAttribute(name)" method. It should create a + new Attribute node with the given name. The name, value + and type of the newly created object are retrieved and + output. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_documentcreateattribute() { + var success; + if(checkInitialization(builder, "hc_documentcreateattribute") != null) return; + var doc; + var newAttrNode; + var attrValue; + var attrName; + var attrType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newAttrNode = doc.createAttribute("title"); + attrValue = newAttrNode.nodeValue; + + assertEquals("value","",attrValue); + attrName = newAttrNode.nodeName; + + assertEqualsAutoCase("attribute", "name","title",attrName); + attrType = newAttrNode.nodeType; + + assertEquals("type",2,attrType); + +} + + + + +function runTest() { + hc_documentcreateattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.xhtml new file mode 100644 index 0000000..83103bb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment-expected.txt new file mode 100644 index 0000000..b246b3d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatecomment +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.js b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.js new file mode 100644 index 0000000..fdd69a8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatecomment"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createComment(data)" method creates a new Comment + node given the specified string. + Retrieve the entire DOM document and invoke its + "createComment(data)" method. It should create a new + Comment node whose "data" is the specified string. + The content, name and type are retrieved and output. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1334481328 +*/ +function hc_documentcreatecomment() { + var success; + if(checkInitialization(builder, "hc_documentcreatecomment") != null) return; + var doc; + var newCommentNode; + var newCommentValue; + var newCommentName; + var newCommentType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newCommentNode = doc.createComment("This is a new Comment node"); + newCommentValue = newCommentNode.nodeValue; + + assertEquals("value","This is a new Comment node",newCommentValue); + newCommentName = newCommentNode.nodeName; + + assertEquals("strong","#comment",newCommentName); + newCommentType = newCommentNode.nodeType; + + assertEquals("type",8,newCommentType); + +} + + + + +function runTest() { + hc_documentcreatecomment(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.xhtml new file mode 100644 index 0000000..4327ae3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatecomment.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt new file mode 100644 index 0000000..d642023 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatedocumentfragment +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.js b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.js new file mode 100644 index 0000000..40240c5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatedocumentfragment"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createDocumentFragment()" method creates an empty + DocumentFragment object. + Retrieve the entire DOM document and invoke its + "createDocumentFragment()" method. The content, name, + type and value of the newly created object are output. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-35CB04B5 +*/ +function hc_documentcreatedocumentfragment() { + var success; + if(checkInitialization(builder, "hc_documentcreatedocumentfragment") != null) return; + var doc; + var newDocFragment; + var children; + var length; + var newDocFragmentName; + var newDocFragmentType; + var newDocFragmentValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newDocFragment = doc.createDocumentFragment(); + children = newDocFragment.childNodes; + + length = children.length; + + assertEquals("length",0,length); + newDocFragmentName = newDocFragment.nodeName; + + assertEquals("strong","#document-fragment",newDocFragmentName); + newDocFragmentType = newDocFragment.nodeType; + + assertEquals("type",11,newDocFragmentType); + newDocFragmentValue = newDocFragment.nodeValue; + + assertNull("value",newDocFragmentValue); + +} + + + + +function runTest() { + hc_documentcreatedocumentfragment(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml new file mode 100644 index 0000000..7e05f92 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatedocumentfragment.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement-expected.txt new file mode 100644 index 0000000..909a127 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelement +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.js b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.js new file mode 100644 index 0000000..fbba09a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.js @@ -0,0 +1,121 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelement"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createElement(tagName)" method creates an Element + of the type specified. + Retrieve the entire DOM document and invoke its + "createElement(tagName)" method with tagName="acronym". + The method should create an instance of an Element node + whose tagName is "acronym". The NodeName, NodeType + and NodeValue are returned. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +*/ +function hc_documentcreateelement() { + var success; + if(checkInitialization(builder, "hc_documentcreateelement") != null) return; + var doc; + var newElement; + var newElementName; + var newElementType; + var newElementValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newElement = doc.createElement("acronym"); + newElementName = newElement.nodeName; + + assertEqualsAutoCase("element", "strong","acronym",newElementName); + newElementType = newElement.nodeType; + + assertEquals("type",1,newElementType); + newElementValue = newElement.nodeValue; + + assertNull("valueInitiallyNull",newElementValue); + +} + + + + +function runTest() { + hc_documentcreateelement(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.xhtml new file mode 100644 index 0000000..6b0f416 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelement.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt new file mode 100644 index 0000000..5d4f66a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelementcasesensitive +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.js b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.js new file mode 100644 index 0000000..a22069f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreateelementcasesensitive"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The tagName parameter in the "createElement(tagName)" + method is case-sensitive for XML documents. + Retrieve the entire DOM document and invoke its + "createElement(tagName)" method twice. Once for tagName + equal to "acronym" and once for tagName equal to "ACRONYM" + Each call should create a distinct Element node. The + newly created Elements are then assigned attributes + that are retrieved. + + Modified on 27 June 2003 to avoid setting an invalid style + values and checked the node names to see if they matched expectations. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_documentcreateelementcasesensitive() { + var success; + if(checkInitialization(builder, "hc_documentcreateelementcasesensitive") != null) return; + var doc; + var newElement1; + var newElement2; + var attribute1; + var attribute2; + var nodeName1; + var nodeName2; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newElement1 = doc.createElement("ACRONYM"); + newElement2 = doc.createElement("acronym"); + newElement1.setAttribute("lang","EN"); + newElement2.setAttribute("title","Dallas"); + attribute1 = newElement1.getAttribute("lang"); + attribute2 = newElement2.getAttribute("title"); + assertEquals("attrib1","EN",attribute1); + assertEquals("attrib2","Dallas",attribute2); + nodeName1 = newElement1.nodeName; + + nodeName2 = newElement2.nodeName; + + assertEqualsAutoCase("element", "nodeName1","ACRONYM",nodeName1); + assertEqualsAutoCase("element", "nodeName2","acronym",nodeName2); + +} + + + + +function runTest() { + hc_documentcreateelementcasesensitive(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml new file mode 100644 index 0000000..4d654c6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreateelementcasesensitive.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode-expected.txt new file mode 100644 index 0000000..613be0e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatetextnode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.js b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.js new file mode 100644 index 0000000..8b04106 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentcreatetextnode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createTextNode(data)" method creates a Text node + given the specfied string. + Retrieve the entire DOM document and invoke its + "createTextNode(data)" method. It should create a + new Text node whose "data" is the specified string. + The NodeName and NodeType are also checked. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1975348127 +*/ +function hc_documentcreatetextnode() { + var success; + if(checkInitialization(builder, "hc_documentcreatetextnode") != null) return; + var doc; + var newTextNode; + var newTextName; + var newTextValue; + var newTextType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newTextNode = doc.createTextNode("This is a new Text node"); + newTextValue = newTextNode.nodeValue; + + assertEquals("value","This is a new Text node",newTextValue); + newTextName = newTextNode.nodeName; + + assertEquals("strong","#text",newTextName); + newTextType = newTextNode.nodeType; + + assertEquals("type",3,newTextType); + +} + + + + +function runTest() { + hc_documentcreatetextnode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.xhtml new file mode 100644 index 0000000..8bc6277 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentcreatetextnode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype-expected.txt new file mode 100644 index 0000000..6ec641d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetdoctype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.js b/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.js new file mode 100644 index 0000000..c3aa3c5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.js @@ -0,0 +1,149 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetdoctype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Access Document.doctype for hc_staff, if not text/html should return DocumentType node. +HTML implementations may return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ +function hc_documentgetdoctype() { + var success; + if(checkInitialization(builder, "hc_documentgetdoctype") != null) return; + var doc; + var docType; + var docTypeName; + var nodeValue; + var attributes; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); + + } + + if( + + (docType != null) + + ) { + docTypeName = docType.name; + + + if( + + (builder.contentType == "image/svg+xml") + + ) { + assertEquals("nodeNameSVG","svg",docTypeName); + + } + + else { + assertEquals("nodeName","html",docTypeName); + + } + nodeValue = docType.nodeValue; + + assertNull("nodeValue",nodeValue); + attributes = docType.attributes; + + assertNull("attributes",attributes); + + } + +} + + + + +function runTest() { + hc_documentgetdoctype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.xhtml new file mode 100644 index 0000000..140ef49 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetdoctype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt new file mode 100644 index 0000000..b66360f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamelength +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js new file mode 100644 index 0000000..1eb3e39 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.js @@ -0,0 +1,110 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamelength"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getElementsByTagName(tagName)" method returns a + NodeList of all the Elements with a given tagName. + + Retrieve the entire DOM document and invoke its + "getElementsByTagName(tagName)" method with tagName + equal to "strong". The method should return a NodeList + that contains 5 elements. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ +function hc_documentgetelementsbytagnamelength() { + var success; + if(checkInitialization(builder, "hc_documentgetelementsbytagnamelength") != null) return; + var doc; + var nameList; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + nameList = doc.getElementsByTagName("strong"); + assertSize("documentGetElementsByTagNameLengthAssert",5,nameList); + +} + + + + +function runTest() { + hc_documentgetelementsbytagnamelength(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml new file mode 100644 index 0000000..f9058eb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamelength.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt new file mode 100644 index 0000000..2a1b008 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnametotallength +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js new file mode 100644 index 0000000..00fa119 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.js @@ -0,0 +1,221 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnametotallength"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the entire DOM document and invoke its + "getElementsByTagName(tagName)" method with tagName + equal to "*". The method should return a NodeList + that contains all the elements of the document. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ +function hc_documentgetelementsbytagnametotallength() { + var success; + if(checkInitialization(builder, "hc_documentgetelementsbytagnametotallength") != null) return; + var doc; + var nameList; + expectedNames = new Array(); + expectedNames[0] = "html"; + expectedNames[1] = "head"; + expectedNames[2] = "meta"; + expectedNames[3] = "title"; + expectedNames[4] = "script"; + expectedNames[5] = "script"; + expectedNames[6] = "script"; + expectedNames[7] = "body"; + expectedNames[8] = "p"; + expectedNames[9] = "em"; + expectedNames[10] = "strong"; + expectedNames[11] = "code"; + expectedNames[12] = "sup"; + expectedNames[13] = "var"; + expectedNames[14] = "acronym"; + expectedNames[15] = "p"; + expectedNames[16] = "em"; + expectedNames[17] = "strong"; + expectedNames[18] = "code"; + expectedNames[19] = "sup"; + expectedNames[20] = "var"; + expectedNames[21] = "acronym"; + expectedNames[22] = "p"; + expectedNames[23] = "em"; + expectedNames[24] = "strong"; + expectedNames[25] = "code"; + expectedNames[26] = "sup"; + expectedNames[27] = "var"; + expectedNames[28] = "acronym"; + expectedNames[29] = "p"; + expectedNames[30] = "em"; + expectedNames[31] = "strong"; + expectedNames[32] = "code"; + expectedNames[33] = "sup"; + expectedNames[34] = "var"; + expectedNames[35] = "acronym"; + expectedNames[36] = "p"; + expectedNames[37] = "em"; + expectedNames[38] = "strong"; + expectedNames[39] = "code"; + expectedNames[40] = "sup"; + expectedNames[41] = "var"; + expectedNames[42] = "acronym"; + + svgExpectedNames = new Array(); + svgExpectedNames[0] = "svg"; + svgExpectedNames[1] = "rect"; + svgExpectedNames[2] = "script"; + svgExpectedNames[3] = "head"; + svgExpectedNames[4] = "meta"; + svgExpectedNames[5] = "title"; + svgExpectedNames[6] = "body"; + svgExpectedNames[7] = "p"; + svgExpectedNames[8] = "em"; + svgExpectedNames[9] = "strong"; + svgExpectedNames[10] = "code"; + svgExpectedNames[11] = "sup"; + svgExpectedNames[12] = "var"; + svgExpectedNames[13] = "acronym"; + svgExpectedNames[14] = "p"; + svgExpectedNames[15] = "em"; + svgExpectedNames[16] = "strong"; + svgExpectedNames[17] = "code"; + svgExpectedNames[18] = "sup"; + svgExpectedNames[19] = "var"; + svgExpectedNames[20] = "acronym"; + svgExpectedNames[21] = "p"; + svgExpectedNames[22] = "em"; + svgExpectedNames[23] = "strong"; + svgExpectedNames[24] = "code"; + svgExpectedNames[25] = "sup"; + svgExpectedNames[26] = "var"; + svgExpectedNames[27] = "acronym"; + svgExpectedNames[28] = "p"; + svgExpectedNames[29] = "em"; + svgExpectedNames[30] = "strong"; + svgExpectedNames[31] = "code"; + svgExpectedNames[32] = "sup"; + svgExpectedNames[33] = "var"; + svgExpectedNames[34] = "acronym"; + svgExpectedNames[35] = "p"; + svgExpectedNames[36] = "em"; + svgExpectedNames[37] = "strong"; + svgExpectedNames[38] = "code"; + svgExpectedNames[39] = "sup"; + svgExpectedNames[40] = "var"; + svgExpectedNames[41] = "acronym"; + + var actualNames = new Array(); + + var thisElement; + var thisTag; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + nameList = doc.getElementsByTagName("*"); + for(var indexN10148 = 0;indexN10148 < nameList.length; indexN10148++) { + thisElement = nameList.item(indexN10148); + thisTag = thisElement.tagName; + + actualNames[actualNames.length] = thisTag; + + } + + if( + + (builder.contentType == "image/svg+xml") + + ) { + assertEqualsListAutoCase("element", "svgTagNames",svgExpectedNames,actualNames); + + } + + else { + assertEqualsListAutoCase("element", "tagNames",expectedNames,actualNames); + + } + +} + + + + +function runTest() { + hc_documentgetelementsbytagnametotallength(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml new file mode 100644 index 0000000..b9e69e2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnametotallength.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt new file mode 100644 index 0000000..b710977 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js new file mode 100644 index 0000000..e9d39ed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetelementsbytagnamevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getElementsByTagName(tagName)" method returns a + NodeList of all the Elements with a given tagName + in a pre-order traversal of the tree. + + Retrieve the entire DOM document and invoke its + "getElementsByTagName(tagName)" method with tagName + equal to "strong". The method should return a NodeList + that contains 5 elements. The FOURTH item in the + list is retrieved and output. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-A6C9094 +*/ +function hc_documentgetelementsbytagnamevalue() { + var success; + if(checkInitialization(builder, "hc_documentgetelementsbytagnamevalue") != null) return; + var doc; + var nameList; + var nameNode; + var firstChild; + var childValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + nameList = doc.getElementsByTagName("strong"); + nameNode = nameList.item(3); + firstChild = nameNode.firstChild; + + childValue = firstChild.nodeValue; + + assertEquals("documentGetElementsByTagNameValueAssert","Jeny Oconnor",childValue); + +} + + + + +function runTest() { + hc_documentgetelementsbytagnamevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml new file mode 100644 index 0000000..a6c3884 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetelementsbytagnamevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation-expected.txt new file mode 100644 index 0000000..c15f7e9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetimplementation +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.js b/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.js new file mode 100644 index 0000000..5bb3f3b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetimplementation"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the entire DOM document and invoke its + "getImplementation()" method. If contentType="text/html", + DOMImplementation.hasFeature("HTML","1.0") should be true. + Otherwise, DOMImplementation.hasFeature("XML", "1.0") + should be true. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1B793EBA +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ +function hc_documentgetimplementation() { + var success; + if(checkInitialization(builder, "hc_documentgetimplementation") != null) return; + var doc; + var docImpl; + var xmlstate; + var htmlstate; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docImpl = doc.implementation; +xmlstate = docImpl.hasFeature("XML","1.0"); +htmlstate = docImpl.hasFeature("HTML","1.0"); + + if( + + (builder.contentType == "text/html") + + ) { + assertTrue("supports_HTML_1.0",htmlstate); + + } + + else { + assertTrue("supports_XML_1.0",xmlstate); + + } + +} + + + + +function runTest() { + hc_documentgetimplementation(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.xhtml new file mode 100644 index 0000000..8d99629 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetimplementation.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode-expected.txt new file mode 100644 index 0000000..3fddd5d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetrootnode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.js b/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.js new file mode 100644 index 0000000..e221ff1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentgetrootnode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Load a document and invoke its + "getDocumentElement()" method. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-87CD092 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ +function hc_documentgetrootnode() { + var success; + if(checkInitialization(builder, "hc_documentgetrootnode") != null) return; + var doc; + var root; + var rootName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + root = doc.documentElement; + + rootName = root.nodeName; + + + if( + + (builder.contentType == "image/svg+xml") + + ) { + assertEquals("svgTagName","svg",rootName); + + } + + else { + assertEqualsAutoCase("element", "docElemName","html",rootName); + + } + +} + + + + +function runTest() { + hc_documentgetrootnode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.xhtml new file mode 100644 index 0000000..db71c78 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentgetrootnode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt new file mode 100644 index 0000000..94d5d93 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js new file mode 100644 index 0000000..9038f2e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createAttribute(tagName)" method raises an + INVALID_CHARACTER_ERR DOMException if the specified + tagName contains an invalid character. + + Retrieve the entire DOM document and invoke its + "createAttribute(tagName)" method with the tagName equal + to the string "invalid^Name". Due to the invalid + character the desired EXCEPTION should be raised. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_documentinvalidcharacterexceptioncreateattribute() { + var success; + if(checkInitialization(builder, "hc_documentinvalidcharacterexceptioncreateattribute") != null) return; + var doc; + var createdAttr; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + { + success = false; + try { + createdAttr = doc.createAttribute("invalid^Name"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + +} + + + + +function runTest() { + hc_documentinvalidcharacterexceptioncreateattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml new file mode 100644 index 0000000..65deb6d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt new file mode 100644 index 0000000..5b30956 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js new file mode 100644 index 0000000..4f9933d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Creating an attribute with an empty name should cause an INVALID_CHARACTER_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1084891198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1084891198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ +function hc_documentinvalidcharacterexceptioncreateattribute1() { + var success; + if(checkInitialization(builder, "hc_documentinvalidcharacterexceptioncreateattribute1") != null) return; + var doc; + var createdAttr; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + { + success = false; + try { + createdAttr = doc.createAttribute(""); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + +} + + + + +function runTest() { + hc_documentinvalidcharacterexceptioncreateattribute1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml new file mode 100644 index 0000000..2b54072 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt new file mode 100644 index 0000000..65eee8f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js new file mode 100644 index 0000000..624a46a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "createElement(tagName)" method raises an + INVALID_CHARACTER_ERR DOMException if the specified + tagName contains an invalid character. + + Retrieve the entire DOM document and invoke its + "createElement(tagName)" method with the tagName equal + to the string "invalid^Name". Due to the invalid + character the desired EXCEPTION should be raised. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_documentinvalidcharacterexceptioncreateelement() { + var success; + if(checkInitialization(builder, "hc_documentinvalidcharacterexceptioncreateelement") != null) return; + var doc; + var badElement; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + { + success = false; + try { + badElement = doc.createElement("invalid^Name"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + +} + + + + +function runTest() { + hc_documentinvalidcharacterexceptioncreateelement(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml new file mode 100644 index 0000000..e17ad05 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt new file mode 100644 index 0000000..cf4c0e8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js new file mode 100644 index 0000000..cbf69fe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_documentinvalidcharacterexceptioncreateelement1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Creating an element with an empty name should cause an INVALID_CHARACTER_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-2141741547')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-2141741547 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ +function hc_documentinvalidcharacterexceptioncreateelement1() { + var success; + if(checkInitialization(builder, "hc_documentinvalidcharacterexceptioncreateelement1") != null) return; + var doc; + var badElement; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + { + success = false; + try { + badElement = doc.createElement(""); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + +} + + + + +function runTest() { + hc_documentinvalidcharacterexceptioncreateelement1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml new file mode 100644 index 0000000..9dbd232 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt new file mode 100644 index 0000000..34b0a94 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenoversion +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.js b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.js new file mode 100644 index 0000000..f723ce5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenoversion"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Load a document and invoke its + "getImplementation()" method. This should create a + DOMImplementation object whose "hasFeature(feature, + version)" method is invoked with version equal to "". + If the version is not specified, supporting any version + feature will cause the method to return "true". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/2000/11/DOM-Level-2-errata#core-14 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ +function hc_domimplementationfeaturenoversion() { + var success; + if(checkInitialization(builder, "hc_domimplementationfeaturenoversion") != null) return; + var doc; + var domImpl; + var state; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + domImpl = doc.implementation; + + if( + + (builder.contentType == "text/html") + + ) { + state = domImpl.hasFeature("HTML",""); + + } + + else { + state = domImpl.hasFeature("XML",""); + + } + assertTrue("hasFeatureBlank",state); + +} + + + + +function runTest() { + hc_domimplementationfeaturenoversion(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml new file mode 100644 index 0000000..9259d09 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenoversion.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt new file mode 100644 index 0000000..3a7b1ed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.js b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.js new file mode 100644 index 0000000..bfa69f3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturenull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("hasNullString", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Load a document and invoke its + "getImplementation()" method. This should create a + DOMImplementation object whose "hasFeature(feature, + version)" method is invoked with version equal to null. + If the version is not specified, supporting any version + feature will cause the method to return "true". + +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/2000/11/DOM-Level-2-errata#core-14 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ +function hc_domimplementationfeaturenull() { + var success; + if(checkInitialization(builder, "hc_domimplementationfeaturenull") != null) return; + var doc; + var domImpl; + var state; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + domImpl = doc.implementation; + + if( + + (builder.contentType == "text/html") + + ) { + state = domImpl.hasFeature("HTML",null); +assertTrue("supports_HTML_null",state); + + } + + else { + state = domImpl.hasFeature("XML",null); +assertTrue("supports_XML_null",state); + + } + +} + + + + +function runTest() { + hc_domimplementationfeaturenull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml new file mode 100644 index 0000000..a384d68 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturenull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt new file mode 100644 index 0000000..90191a1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturexml +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.js b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.js new file mode 100644 index 0000000..acd4d37 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.js @@ -0,0 +1,125 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_domimplementationfeaturexml"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the entire DOM document and invoke its + "getImplementation()" method. This should create a + DOMImplementation object whose "hasFeature(feature, + version)" method is invoked with "feature" equal to "html" or "xml". + The method should return a boolean "true". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5CED94D7 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=245 +*/ +function hc_domimplementationfeaturexml() { + var success; + if(checkInitialization(builder, "hc_domimplementationfeaturexml") != null) return; + var doc; + var domImpl; + var state; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + domImpl = doc.implementation; + + if( + + (builder.contentType == "text/html") + + ) { + state = domImpl.hasFeature("html","1.0"); +assertTrue("supports_html_1.0",state); + + } + + else { + state = domImpl.hasFeature("xml","1.0"); +assertTrue("supports_xml_1.0",state); + + } + +} + + + + +function runTest() { + hc_domimplementationfeaturexml(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml new file mode 100644 index 0000000..f088311 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_domimplementationfeaturexml.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute-expected.txt new file mode 100644 index 0000000..ba907ea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementaddnewattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.js new file mode 100644 index 0000000..90d483b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementaddnewattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttribute(name,value)" method adds a new attribute + to the Element + + Retrieve the last child of the last employee, then + add an attribute to it by invoking the + "setAttribute(name,value)" method. It should create + a "strong" attribute with an assigned value equal to + "value". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_elementaddnewattribute() { + var success; + if(checkInitialization(builder, "hc_elementaddnewattribute") != null) return; + var doc; + var elementList; + var testEmployee; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(4); + testEmployee.setAttribute("lang","EN-us"); + attrValue = testEmployee.getAttribute("lang"); + assertEquals("attrValue","EN-us",attrValue); + +} + + + + +function runTest() { + hc_elementaddnewattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.xhtml new file mode 100644 index 0000000..77b7a7d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementaddnewattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute-expected.txt new file mode 100644 index 0000000..80b4a59 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementassociatedattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.js new file mode 100644 index 0000000..c3642a9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.js @@ -0,0 +1,119 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementassociatedattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the first attribute from the last child of + the first employee and invoke the "getSpecified()" + method. This test is only intended to show that + Elements can actually have attributes. This test uses + the "getNamedItem(name)" method from the NamedNodeMap + interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ +function hc_elementassociatedattribute() { + var success; + if(checkInitialization(builder, "hc_elementassociatedattribute") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var domesticAttr; + var specified; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(0); + attributes = testEmployee.attributes; + + domesticAttr = attributes.getNamedItem("title"); + specified = domesticAttr.specified; + + assertTrue("acronymTitleSpecified",specified); + +} + + + + +function runTest() { + hc_elementassociatedattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.xhtml new file mode 100644 index 0000000..313c0a3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementassociatedattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt new file mode 100644 index 0000000..bc0303a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementchangeattributevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.js new file mode 100644 index 0000000..2777f22 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.js @@ -0,0 +1,119 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementchangeattributevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttribute(name,value)" method adds a new attribute + to the Element. If the "strong" is already present, then + its value should be changed to the new one that is in + the "value" parameter. + + Retrieve the last child of the fourth employee, then add + an attribute to it by invoking the + "setAttribute(name,value)" method. Since the name of the + used attribute("class") is already present in this + element, then its value should be changed to the new one + of the "value" parameter. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +*/ +function hc_elementchangeattributevalue() { + var success; + if(checkInitialization(builder, "hc_elementchangeattributevalue") != null) return; + var doc; + var elementList; + var testEmployee; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(3); + testEmployee.setAttribute("class","Neither"); + attrValue = testEmployee.getAttribute("class"); + assertEquals("elementChangeAttributeValueAssert","Neither",attrValue); + +} + + + + +function runTest() { + hc_elementchangeattributevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.xhtml new file mode 100644 index 0000000..6883a72 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementchangeattributevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt new file mode 100644 index 0000000..a7ec3c1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementcreatenewattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.js new file mode 100644 index 0000000..aad9aa1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementcreatenewattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttributeNode(newAttr)" method adds a new + attribute to the Element. + + Retrieve first address element and add + a new attribute node to it by invoking its + "setAttributeNode(newAttr)" method. This test makes use + of the "createAttribute(name)" method from the Document + interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_elementcreatenewattribute() { + var success; + if(checkInitialization(builder, "hc_elementcreatenewattribute") != null) return; + var doc; + var elementList; + var testAddress; + var newAttribute; + var oldAttr; + var districtAttr; + var attrVal; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(0); + newAttribute = doc.createAttribute("lang"); + oldAttr = testAddress.setAttributeNode(newAttribute); + assertNull("old_attr_doesnt_exist",oldAttr); + districtAttr = testAddress.getAttributeNode("lang"); + assertNotNull("new_district_accessible",districtAttr); +attrVal = testAddress.getAttribute("lang"); + assertEquals("attr_value","",attrVal); + +} + + + + +function runTest() { + hc_elementcreatenewattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.xhtml new file mode 100644 index 0000000..c45ee6d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementcreatenewattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode-expected.txt new file mode 100644 index 0000000..f4cc3e7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.js new file mode 100644 index 0000000..17b0106 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the attribute "title" from the last child + of the first "p" element and check its node name. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +*/ +function hc_elementgetattributenode() { + var success; + if(checkInitialization(builder, "hc_elementgetattributenode") != null) return; + var doc; + var elementList; + var testEmployee; + var domesticAttr; + var nodeName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(0); + domesticAttr = testEmployee.getAttributeNode("title"); + nodeName = domesticAttr.nodeName; + + assertEqualsAutoCase("attribute", "nodeName","title",nodeName); + +} + + + + +function runTest() { + hc_elementgetattributenode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.xhtml new file mode 100644 index 0000000..a711030 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt new file mode 100644 index 0000000..6a95f5b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenodenull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.js new file mode 100644 index 0000000..2c9a905 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.js @@ -0,0 +1,115 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetattributenodenull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getAttributeNode(name)" method retrieves an + attribute node by name. It should return null if the + "strong" attribute does not exist. + + Retrieve the last child of the first employee and attempt + to retrieve a non-existing attribute. The method should + return "null". The non-existing attribute to be used + is "invalidAttribute". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-217A91B8 +*/ +function hc_elementgetattributenodenull() { + var success; + if(checkInitialization(builder, "hc_elementgetattributenodenull") != null) return; + var doc; + var elementList; + var testEmployee; + var domesticAttr; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(0); + domesticAttr = testEmployee.getAttributeNode("invalidAttribute"); + assertNull("elementGetAttributeNodeNullAssert",domesticAttr); + +} + + + + +function runTest() { + hc_elementgetattributenodenull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.xhtml new file mode 100644 index 0000000..76c0039 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetattributenodenull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty-expected.txt new file mode 100644 index 0000000..f54e050 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementempty +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.js new file mode 100644 index 0000000..b4ddf55 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementempty"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getAttribute(name)" method returns an empty + string if no value was assigned to an attribute and + no default value was given in the DTD file. + + Retrieve the last child of the last employee, then + invoke "getAttribute(name)" method, where "strong" is an + attribute without a specified or DTD default value. + The "getAttribute(name)" method should return the empty + string. This method makes use of the + "createAttribute(newAttr)" method from the Document + interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_elementgetelementempty() { + var success; + if(checkInitialization(builder, "hc_elementgetelementempty") != null) return; + var doc; + var newAttribute; + var elementList; + var testEmployee; + var domesticAttr; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newAttribute = doc.createAttribute("lang"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(3); + domesticAttr = testEmployee.setAttributeNode(newAttribute); + attrValue = testEmployee.getAttribute("lang"); + assertEquals("elementGetElementEmptyAssert","",attrValue); + +} + + + + +function runTest() { + hc_elementgetelementempty(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.xhtml new file mode 100644 index 0000000..3492728 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementempty.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt new file mode 100644 index 0000000..671496c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagname +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.js new file mode 100644 index 0000000..bed6cfe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.js @@ -0,0 +1,112 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagname"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getElementsByTagName(name)" method returns a list +of all descendant Elements with the given tag name. +Test for an empty list. + +Create a NodeList of all the descendant elements +using the string "noMatch" as the tagName. +The method should return a NodeList whose length is +"0" since there are not any descendant elements +that match the given tag name. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ +function hc_elementgetelementsbytagname() { + var success; + if(checkInitialization(builder, "hc_elementgetelementsbytagname") != null) return; + var doc; + var elementList; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + assertSize("elementGetElementsByTagNameAssert",5,elementList); + +} + + + + +function runTest() { + hc_elementgetelementsbytagname(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml new file mode 100644 index 0000000..0fc1fe9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagname.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt new file mode 100644 index 0000000..0610645 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnameaccessnodelist +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js new file mode 100644 index 0000000..cd53408 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js @@ -0,0 +1,144 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnameaccessnodelist"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getElementsByTagName(name)" method returns a list +of all descendant Elements in the order the children +were encountered in a pre order traversal of the element +tree. + +Create a NodeList of all the descendant elements +using the string "p" as the tagName. +The method should return a NodeList whose length is +"5" in the order the children were encountered. +Access the FOURTH element in the NodeList. The FOURTH +element, the first or second should be an "em" node with +the content "EMP0004". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_elementgetelementsbytagnameaccessnodelist() { + var success; + if(checkInitialization(builder, "hc_elementgetelementsbytagnameaccessnodelist") != null) return; + var doc; + var elementList; + var testEmployee; + var firstC; + var childName; + var nodeType; + var employeeIDNode; + var employeeID; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + testEmployee = elementList.item(3); + firstC = testEmployee.firstChild; + + nodeType = firstC.nodeType; + + + while( + (3 == nodeType) + ) { + firstC = firstC.nextSibling; + + nodeType = firstC.nodeType; + + + } +childName = firstC.nodeName; + + assertEqualsAutoCase("element", "childName","em",childName); + employeeIDNode = firstC.firstChild; + + employeeID = employeeIDNode.nodeValue; + + assertEquals("employeeID","EMP0004",employeeID); + +} + + + + +function runTest() { + hc_elementgetelementsbytagnameaccessnodelist(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml new file mode 100644 index 0000000..9f2fb92 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnameaccessnodelist.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt new file mode 100644 index 0000000..928e31b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamenomatch +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js new file mode 100644 index 0000000..941fd4a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.js @@ -0,0 +1,110 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamenomatch"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getElementsByTagName(name)" method returns a list +of all descendant Elements with the given tag name. + +Create a NodeList of all the descendant elements +using the string "employee" as the tagName. +The method should return a NodeList whose length is +"5". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ +function hc_elementgetelementsbytagnamenomatch() { + var success; + if(checkInitialization(builder, "hc_elementgetelementsbytagnamenomatch") != null) return; + var doc; + var elementList; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("noMatch"); + assertSize("elementGetElementsByTagNameNoMatchNoMatchAssert",0,elementList); + +} + + + + +function runTest() { + hc_elementgetelementsbytagnamenomatch(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml new file mode 100644 index 0000000..228ab35 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamenomatch.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt new file mode 100644 index 0000000..ba62605 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamespecialvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js new file mode 100644 index 0000000..3b8c10d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.js @@ -0,0 +1,134 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgetelementsbytagnamespecialvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getElementsByTagName(name)" method may use the +special value "*" to match all tags in the element +tree. + +Create a NodeList of all the descendant elements +of the last employee by using the special value "*". +The method should return all the descendant children(6) +in the order the children were encountered. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1938918D +*/ +function hc_elementgetelementsbytagnamespecialvalue() { + var success; + if(checkInitialization(builder, "hc_elementgetelementsbytagnamespecialvalue") != null) return; + var doc; + var elementList; + var lastEmployee; + var lastempList; + var child; + var childName; + var result = new Array(); + + expectedResult = new Array(); + expectedResult[0] = "em"; + expectedResult[1] = "strong"; + expectedResult[2] = "code"; + expectedResult[3] = "sup"; + expectedResult[4] = "var"; + expectedResult[5] = "acronym"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + lastEmployee = elementList.item(4); + lastempList = lastEmployee.getElementsByTagName("*"); + for(var indexN10067 = 0;indexN10067 < lastempList.length; indexN10067++) { + child = lastempList.item(indexN10067); + childName = child.nodeName; + + result[result.length] = childName; + + } + assertEqualsListAutoCase("element", "tagNames",expectedResult,result); + +} + + + + +function runTest() { + hc_elementgetelementsbytagnamespecialvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml new file mode 100644 index 0000000..cd2c106 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgetelementsbytagnamespecialvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname-expected.txt new file mode 100644 index 0000000..b5d5045 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgettagname +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.js b/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.js new file mode 100644 index 0000000..567d234 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementgettagname"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Invoke the "getTagName()" method one the + root node. The value returned should be "html" or "svg". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ +function hc_elementgettagname() { + var success; + if(checkInitialization(builder, "hc_elementgettagname") != null) return; + var doc; + var root; + var tagname; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + root = doc.documentElement; + + tagname = root.tagName; + + + if( + + (builder.contentType == "image/svg+xml") + + ) { + assertEquals("svgTagname","svg",tagname); + + } + + else { + assertEqualsAutoCase("element", "tagname","html",tagname); + + } + +} + + + + +function runTest() { + hc_elementgettagname(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.xhtml new file mode 100644 index 0000000..04fd911 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementgettagname.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt new file mode 100644 index 0000000..1c27472 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinuseattributeerr +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.js b/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.js new file mode 100644 index 0000000..fa2fd0a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinuseattributeerr"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttributeNode(newAttr)" method raises an + "INUSE_ATTRIBUTE_ERR DOMException if the "newAttr" + is already an attribute of another element. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=244 +*/ +function hc_elementinuseattributeerr() { + var success; + if(checkInitialization(builder, "hc_elementinuseattributeerr") != null) return; + var doc; + var newAttribute; + var addressElementList; + var testAddress; + var newElement; + var attrAddress; + var appendedChild; + var setAttr1; + var setAttr2; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressElementList = doc.getElementsByTagName("body"); + testAddress = addressElementList.item(0); + newElement = doc.createElement("p"); + appendedChild = testAddress.appendChild(newElement); + newAttribute = doc.createAttribute("title"); + setAttr1 = newElement.setAttributeNode(newAttribute); + + { + success = false; + try { + setAttr2 = testAddress.setAttributeNode(newAttribute); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 10); + } + assertTrue("throw_INUSE_ATTRIBUTE_ERR",success); + } + +} + + + + +function runTest() { + hc_elementinuseattributeerr(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.xhtml new file mode 100644 index 0000000..9656a14 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinuseattributeerr.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt new file mode 100644 index 0000000..64f921c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.js b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.js new file mode 100644 index 0000000..4d581a3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.js @@ -0,0 +1,125 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttribute(name,value)" method raises an + "INVALID_CHARACTER_ERR DOMException if the specified + name contains an invalid character. + + Retrieve the last child of the first employee and + call its "setAttribute(name,value)" method with + "strong" containing an invalid character. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_elementinvalidcharacterexception() { + var success; + if(checkInitialization(builder, "hc_elementinvalidcharacterexception") != null) return; + var doc; + var elementList; + var testAddress; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(0); + + { + success = false; + try { + testAddress.setAttribute("invalid^Name","value"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + +} + + + + +function runTest() { + hc_elementinvalidcharacterexception(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml new file mode 100644 index 0000000..3027072 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt new file mode 100644 index 0000000..1f29e26 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception1 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.js b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.js new file mode 100644 index 0000000..5376968 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.js @@ -0,0 +1,119 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementinvalidcharacterexception1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Calling Element.setAttribute with an empty name will cause an INVALID_CHARACTER_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68F082 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-F68F082')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525 +*/ +function hc_elementinvalidcharacterexception1() { + var success; + if(checkInitialization(builder, "hc_elementinvalidcharacterexception1") != null) return; + var doc; + var elementList; + var testAddress; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(0); + + { + success = false; + try { + testAddress.setAttribute("","value"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 5); + } + assertTrue("throw_INVALID_CHARACTER_ERR",success); + } + +} + + + + +function runTest() { + hc_elementinvalidcharacterexception1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml new file mode 100644 index 0000000..eab9ff7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementinvalidcharacterexception1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize-expected.txt new file mode 100644 index 0000000..8b1dbe9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.js b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.js new file mode 100644 index 0000000..c00a5bc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Append a couple of text nodes to the first sup element, normalize the +document element and check that the element has been normalized. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=546 +*/ +function hc_elementnormalize() { + var success; + if(checkInitialization(builder, "hc_elementnormalize") != null) return; + var doc; + var root; + var elementList; + var testName; + var firstChild; + var childValue; + var textNode; + var retNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("sup"); + testName = elementList.item(0); + textNode = doc.createTextNode(""); + retNode = testName.appendChild(textNode); + textNode = doc.createTextNode(",000"); + retNode = testName.appendChild(textNode); + root = doc.documentElement; + + root.normalize(); + elementList = doc.getElementsByTagName("sup"); + testName = elementList.item(0); + firstChild = testName.firstChild; + + childValue = firstChild.nodeValue; + + assertEquals("elementNormalizeAssert","56,000,000",childValue); + +} + + + + +function runTest() { + hc_elementnormalize(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.xhtml new file mode 100644 index 0000000..615542d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2-expected.txt new file mode 100644 index 0000000..902f99d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize2 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.js b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.js new file mode 100644 index 0000000..b2197ed --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnormalize2"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Add an empty text node to an existing attribute node, normalize the containing element +and check that the attribute node has eliminated the empty text. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-162CF083 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=482 +*/ +function hc_elementnormalize2() { + var success; + if(checkInitialization(builder, "hc_elementnormalize2") != null) return; + var doc; + var root; + var elementList; + var element; + var firstChild; + var secondChild; + var childValue; + var emptyText; + var attrNode; + var retval; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + root = doc.documentElement; + + emptyText = doc.createTextNode(""); + elementList = root.getElementsByTagName("acronym"); + element = elementList.item(0); + attrNode = element.getAttributeNode("title"); + retval = attrNode.appendChild(emptyText); + element.normalize(); + attrNode = element.getAttributeNode("title"); + firstChild = attrNode.firstChild; + + childValue = firstChild.nodeValue; + + assertEquals("firstChild","Yes",childValue); + secondChild = firstChild.nextSibling; + + assertNull("secondChildNull",secondChild); + +} + + + + +function runTest() { + hc_elementnormalize2(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.xhtml new file mode 100644 index 0000000..2c2dd56 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr-expected.txt new file mode 100644 index 0000000..23acc9b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnotfounderr +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.js b/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.js new file mode 100644 index 0000000..ad15587 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementnotfounderr"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeAttributeNode(oldAttr)" method raises a + NOT_FOUND_ERR DOMException if the "oldAttr" attribute + is not an attribute of the element. + + Retrieve the last employee and attempt to remove + a non existing attribute node. This should cause the + intended exception to be raised. This test makes use + of the "createAttribute(name)" method from the Document + interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D589198')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_elementnotfounderr() { + var success; + if(checkInitialization(builder, "hc_elementnotfounderr") != null) return; + var doc; + var oldAttribute; + var addressElementList; + var testAddress; + var attrAddress; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressElementList = doc.getElementsByTagName("acronym"); + testAddress = addressElementList.item(4); + oldAttribute = doc.createAttribute("title"); + + { + success = false; + try { + attrAddress = testAddress.removeAttributeNode(oldAttribute); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 8); + } + assertTrue("throw_NOT_FOUND_ERR",success); + } + +} + + + + +function runTest() { + hc_elementnotfounderr(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.xhtml new file mode 100644 index 0000000..f8387ab --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementnotfounderr.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute-expected.txt new file mode 100644 index 0000000..1c1977c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute +Status failure +Message attrValue: assertEquals failed, actual null, expected . diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.js new file mode 100644 index 0000000..81224e7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.js @@ -0,0 +1,113 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeAttribute(name)" removes an attribute by name. + If the attribute has a default value, it is immediately + replaced. However, there is no default values in the HTML + compatible tests, so its value is "". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D6AC0F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ +function hc_elementremoveattribute() { + var success; + if(checkInitialization(builder, "hc_elementremoveattribute") != null) return; + var doc; + var elementList; + var testEmployee; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(3); + testEmployee.removeAttribute("class"); + attrValue = testEmployee.getAttribute("class"); + assertEquals("attrValue","",attrValue); + +} + + + + +function runTest() { + hc_elementremoveattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.xhtml new file mode 100644 index 0000000..4cf316a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt new file mode 100644 index 0000000..fb4d802 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributeaftercreate +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.js b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.js new file mode 100644 index 0000000..724a3e8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributeaftercreate"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeAttributeNode(oldAttr)" method removes the + specified attribute. + + Retrieve the last child of the third employee, add a + new "lang" attribute to it and then try to remove it. + To verify that the node was removed use the + "getNamedItem(name)" method from the NamedNodeMap + interface. It also uses the "getAttributes()" method + from the Node interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_elementremoveattributeaftercreate() { + var success; + if(checkInitialization(builder, "hc_elementremoveattributeaftercreate") != null) return; + var doc; + var elementList; + var testEmployee; + var newAttribute; + var attributes; + var districtAttr; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + newAttribute = doc.createAttribute("lang"); + districtAttr = testEmployee.setAttributeNode(newAttribute); + districtAttr = testEmployee.removeAttributeNode(newAttribute); + attributes = testEmployee.attributes; + + districtAttr = attributes.getNamedItem("lang"); + assertNull("removed_item_null",districtAttr); + +} + + + + +function runTest() { + hc_elementremoveattributeaftercreate(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml new file mode 100644 index 0000000..3b1cbb1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributeaftercreate.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode-expected.txt new file mode 100644 index 0000000..e9ddd18 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributenode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.js b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.js new file mode 100644 index 0000000..58bf730 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.js @@ -0,0 +1,119 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattributenode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeAttributeNode(oldAttr)" method returns the + node that was removed. + + Retrieve the last child of the third employee and + remove its "class" Attr node. The method should + return the old attribute node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D589198 +*/ +function hc_elementremoveattributenode() { + var success; + if(checkInitialization(builder, "hc_elementremoveattributenode") != null) return; + var doc; + var elementList; + var testEmployee; + var streetAttr; + var removedAttr; + var removedValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + streetAttr = testEmployee.getAttributeNode("class"); + removedAttr = testEmployee.removeAttributeNode(streetAttr); + assertNotNull("removedAttrNotNull",removedAttr); +removedValue = removedAttr.value; + + assertEquals("elementRemoveAttributeNodeAssert","No",removedValue); + +} + + + + +function runTest() { + hc_elementremoveattributenode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.xhtml new file mode 100644 index 0000000..a485256 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementremoveattributenode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt new file mode 100644 index 0000000..b68390e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceattributewithself +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.js b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.js new file mode 100644 index 0000000..14b1f7d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceattributewithself"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +This test calls setAttributeNode to replace an attribute with itself. +Since the node is not an attribute of another Element, it would +be inappropriate to throw an INUSE_ATTRIBUTE_ERR. + +This test was derived from elementinuserattributeerr which +inadvertanly made this test. + +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ +function hc_elementreplaceattributewithself() { + var success; + if(checkInitialization(builder, "hc_elementreplaceattributewithself") != null) return; + var doc; + var elementList; + var testEmployee; + var streetAttr; + var replacedAttr; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + streetAttr = testEmployee.getAttributeNode("class"); + replacedAttr = testEmployee.setAttributeNode(streetAttr); + assertSame("replacedAttr",streetAttr,replacedAttr); + +} + + + + +function runTest() { + hc_elementreplaceattributewithself(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml new file mode 100644 index 0000000..4c0ed6d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceattributewithself.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt new file mode 100644 index 0000000..58399b6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.js new file mode 100644 index 0000000..949ac3b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttributeNode(newAttr)" method adds a new + attribute to the Element. If the "newAttr" Attr node is + already present in this element, it should replace the + existing one. + + Retrieve the last child of the third employee and add a + new attribute node by invoking the "setAttributeNode(new + Attr)" method. The new attribute node to be added is + "class", which is already present in this element. The + method should replace the existing Attr node with the + new one. This test uses the "createAttribute(name)" + method from the Document interface. + +* @author Curt Arnold +*/ +function hc_elementreplaceexistingattribute() { + var success; + if(checkInitialization(builder, "hc_elementreplaceexistingattribute") != null) return; + var doc; + var elementList; + var testEmployee; + var newAttribute; + var strong; + var setAttr; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + newAttribute = doc.createAttribute("class"); + setAttr = testEmployee.setAttributeNode(newAttribute); + strong = testEmployee.getAttribute("class"); + assertEquals("replacedValue","",strong); + +} + + + + +function runTest() { + hc_elementreplaceexistingattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml new file mode 100644 index 0000000..650013e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt new file mode 100644 index 0000000..1be56d0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattributegevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js new file mode 100644 index 0000000..0318918 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementreplaceexistingattributegevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +If the "setAttributeNode(newAttr)" method replaces an +existing Attr node with the same name, then it should +return the previously existing Attr node. + +Retrieve the last child of the third employee and add a +new attribute node. The new attribute node is "class", +which is already present in this Element. The method +should return the existing Attr node(old "class" Attr). +This test uses the "createAttribute(name)" method +from the Document interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +*/ +function hc_elementreplaceexistingattributegevalue() { + var success; + if(checkInitialization(builder, "hc_elementreplaceexistingattributegevalue") != null) return; + var doc; + var elementList; + var testEmployee; + var newAttribute; + var streetAttr; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + newAttribute = doc.createAttribute("class"); + streetAttr = testEmployee.setAttributeNode(newAttribute); + assertNotNull("previousAttrNotNull",streetAttr); +value = streetAttr.value; + + assertEquals("previousAttrValue","No",value); + +} + + + + +function runTest() { + hc_elementreplaceexistingattributegevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml new file mode 100644 index 0000000..84cb2d0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementreplaceexistingattributegevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt new file mode 100644 index 0000000..e0cd55f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveallattributes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.js b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.js new file mode 100644 index 0000000..56c79ba --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.js @@ -0,0 +1,144 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveallattributes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Create a list of all the attributes of the last child + of the first "p" element by using the "getAttributes()" + method. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ +function hc_elementretrieveallattributes() { + var success; + if(checkInitialization(builder, "hc_elementretrieveallattributes") != null) return; + var doc; + var addressList; + var testAddress; + var attributes; + var attribute; + var attributeName; + var actual = new Array(); + + htmlExpected = new Array(); + htmlExpected[0] = "title"; + + expected = new Array(); + expected[0] = "title"; + expected[1] = "dir"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + addressList = doc.getElementsByTagName("acronym"); + testAddress = addressList.item(0); + attributes = testAddress.attributes; + + for(var indexN1006B = 0;indexN1006B < attributes.length; indexN1006B++) { + attribute = attributes.item(indexN1006B); + attributeName = attribute.nodeName; + + actual[actual.length] = attributeName; + + } + + if( + + (builder.contentType == "text/html") + + ) { + assertEqualsCollection("htmlAttributeNames",toLowerArray(htmlExpected),toLowerArray(actual)); + + } + + else { + assertEqualsCollection("attributeNames",toLowerArray(expected),toLowerArray(actual)); + + } + +} + + + + +function runTest() { + hc_elementretrieveallattributes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.xhtml new file mode 100644 index 0000000..ac5f2cc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveallattributes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt new file mode 100644 index 0000000..006a4d6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveattrvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.js new file mode 100644 index 0000000..288afcd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.js @@ -0,0 +1,113 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrieveattrvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getAttribute(name)" method returns an attribute + value by name. + + Retrieve the second address element, then + invoke the 'getAttribute("class")' method. This should + return the value of the attribute("No"). + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-666EE0F9 +*/ +function hc_elementretrieveattrvalue() { + var success; + if(checkInitialization(builder, "hc_elementretrieveattrvalue") != null) return; + var doc; + var elementList; + var testAddress; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(2); + attrValue = testAddress.getAttribute("class"); + assertEquals("attrValue","No",attrValue); + +} + + + + +function runTest() { + hc_elementretrieveattrvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml new file mode 100644 index 0000000..68cac37 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrieveattrvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname-expected.txt new file mode 100644 index 0000000..af443a0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrievetagname +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.js b/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.js new file mode 100644 index 0000000..9208b54 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementretrievetagname"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getElementsByTagName()" method returns a NodeList + of all descendant elements with a given tagName. + + Invoke the "getElementsByTagName()" method and create + a NodeList of "code" elements. Retrieve the second + "code" element in the list and return the NodeName. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-104682815 +*/ +function hc_elementretrievetagname() { + var success; + if(checkInitialization(builder, "hc_elementretrievetagname") != null) return; + var doc; + var elementList; + var testEmployee; + var strong; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("code"); + testEmployee = elementList.item(1); + strong = testEmployee.nodeName; + + assertEqualsAutoCase("element", "nodename","code",strong); + strong = testEmployee.tagName; + + assertEqualsAutoCase("element", "tagname","code",strong); + +} + + + + +function runTest() { + hc_elementretrievetagname(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.xhtml new file mode 100644 index 0000000..7909786 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementretrievetagname.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt new file mode 100644 index 0000000..e2d6a0d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementsetattributenodenull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.js b/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.js new file mode 100644 index 0000000..65db9d7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementsetattributenodenull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttributeNode(newAttr)" method returns the + null value if no previously existing Attr node with the + same name was replaced. + + Retrieve the last child of the third employee and add a + new attribute to it. The new attribute node added is + "lang", which is not part of this Element. The + method should return the null value. + This test uses the "createAttribute(name)" + method from the Document interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_elementsetattributenodenull() { + var success; + if(checkInitialization(builder, "hc_elementsetattributenodenull") != null) return; + var doc; + var elementList; + var testEmployee; + var newAttribute; + var districtAttr; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + newAttribute = doc.createAttribute("lang"); + districtAttr = testEmployee.setAttributeNode(newAttribute); + assertNull("elementSetAttributeNodeNullAssert",districtAttr); + +} + + + + +function runTest() { + hc_elementsetattributenodenull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.xhtml new file mode 100644 index 0000000..2cddc74 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementsetattributenodenull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt new file mode 100644 index 0000000..86c1d64 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.js b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.js new file mode 100644 index 0000000..e17340c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.js @@ -0,0 +1,147 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementwrongdocumenterr"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + docsLoaded += preload(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + docsLoaded += preload(doc2Ref, "doc2", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setAttributeNode(newAttr)" method raises an + "WRONG_DOCUMENT_ERR DOMException if the "newAttr" + was created from a different document than the one that + created this document. + + Retrieve the last employee and attempt to set a new + attribute node for its "employee" element. The new + attribute was created from a document other than the + one that created this element, therefore a + WRONG_DOCUMENT_ERR DOMException should be raised. + + This test uses the "createAttribute(newAttr)" method + from the Document interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-887236154 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-887236154')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_elementwrongdocumenterr() { + var success; + if(checkInitialization(builder, "hc_elementwrongdocumenterr") != null) return; + var doc1; + var doc2; + var newAttribute; + var addressElementList; + var testAddress; + var attrAddress; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + doc1 = load(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + doc2 = load(doc2Ref, "doc2", "hc_staff"); + newAttribute = doc2.createAttribute("newAttribute"); + addressElementList = doc1.getElementsByTagName("acronym"); + testAddress = addressElementList.item(4); + + { + success = false; + try { + attrAddress = testAddress.setAttributeNode(newAttribute); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_elementwrongdocumenterr(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml new file mode 100644 index 0000000..2888bbb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_elementwrongdocumenterr.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1-expected.txt new file mode 100644 index 0000000..468cfe6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiesremovenameditem1 +Status failure +Message entitiesNotNull: assertNotNull failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.js b/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.js new file mode 100644 index 0000000..54ca9ff --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiesremovenameditem1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An attempt to add remove an entity should result in a NO_MODIFICATION_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +*/ +function hc_entitiesremovenameditem1() { + var success; + if(checkInitialization(builder, "hc_entitiesremovenameditem1") != null) return; + var doc; + var entities; + var docType; + var retval; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); +entities = docType.entities; + + assertNotNull("entitiesNotNull",entities); + + { + success = false; + try { + retval = entities.removeNamedItem("alpha"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 7); + } + assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success); + } + + } + +} + + + + +function runTest() { + hc_entitiesremovenameditem1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.xhtml new file mode 100644 index 0000000..5ab47ea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_entitiesremovenameditem1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1-expected.txt new file mode 100644 index 0000000..03f52ab --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiessetnameditem1 +Status failure +Message entitiesNotNull: assertNotNull failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.js b/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.js new file mode 100644 index 0000000..17876c0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.js @@ -0,0 +1,144 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiessetnameditem1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An attempt to add an element to the named node map returned by entities should +result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1788794630 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +*/ +function hc_entitiessetnameditem1() { + var success; + if(checkInitialization(builder, "hc_entitiessetnameditem1") != null) return; + var doc; + var entities; + var docType; + var retval; + var elem; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); +entities = docType.entities; + + assertNotNull("entitiesNotNull",entities); +elem = doc.createElement("br"); + + try { + retval = entities.setNamedItem(elem); + fail("throw_HIER_OR_NO_MOD_ERR"); + + } catch (ex) { + if (typeof(ex.code) != 'undefined') { + switch(ex.code) { + case /* HIERARCHY_REQUEST_ERR */ 3 : + break; + case /* NO_MODIFICATION_ALLOWED_ERR */ 7 : + break; + default: + throw ex; + } + } else { + throw ex; + } + } + + } + +} + + + + +function runTest() { + hc_entitiessetnameditem1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.xhtml new file mode 100644 index 0000000..c065474 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_entitiessetnameditem1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt new file mode 100644 index 0000000..03effee --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapchildnoderange +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.js new file mode 100644 index 0000000..d70da8d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.js @@ -0,0 +1,141 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapchildnoderange"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Create a NamedNodeMap object from the attributes of the + last child of the third "p" element and traverse the + list from index 0 thru length -1. All indices should + be valid. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=250 +*/ +function hc_namednodemapchildnoderange() { + var success; + if(checkInitialization(builder, "hc_namednodemapchildnoderange") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var child; + var strong; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + attributes = testEmployee.attributes; + + length = attributes.length; + + + if( + + (builder.contentType == "text/html") + + ) { + assertEquals("htmlLength",2,length); + + } + + else { + assertEquals("length",3,length); + child = attributes.item(2); + assertNotNull("attr2",child); + + } + child = attributes.item(0); + assertNotNull("attr0",child); +child = attributes.item(1); + assertNotNull("attr1",child); +child = attributes.item(3); + assertNull("attr3",child); + +} + + + + +function runTest() { + hc_namednodemapchildnoderange(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml new file mode 100644 index 0000000..cef1420 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapchildnoderange.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt new file mode 100644 index 0000000..a48aa6b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapgetnameditem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.js new file mode 100644 index 0000000..3fa01c4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.js @@ -0,0 +1,121 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapgetnameditem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the second "p" element and create a NamedNodeMap + listing of the attributes of the last child. Once the + list is created an invocation of the "getNamedItem(name)" + method is done with name="title". This should result + in the title Attr node being returned. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +*/ +function hc_namednodemapgetnameditem() { + var success; + if(checkInitialization(builder, "hc_namednodemapgetnameditem") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var domesticAttr; + var attrName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(1); + attributes = testEmployee.attributes; + + domesticAttr = attributes.getNamedItem("title"); + attrName = domesticAttr.nodeName; + + assertEqualsAutoCase("attribute", "nodeName","title",attrName); + +} + + + + +function runTest() { + hc_namednodemapgetnameditem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml new file mode 100644 index 0000000..8e275d2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapgetnameditem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt new file mode 100644 index 0000000..4f1f0aa --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapinuseattributeerr +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.js new file mode 100644 index 0000000..fdf0c15 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.js @@ -0,0 +1,139 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapinuseattributeerr"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "setNamedItem(arg)" method raises a +INUSE_ATTRIBUTE_ERR DOMException if "arg" is an +Attr that is already in an attribute of another Element. + +Create a NamedNodeMap object from the attributes of the +last child of the third employee and attempt to add +an attribute that is already being used by the first +employee. This should raise the desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_namednodemapinuseattributeerr() { + var success; + if(checkInitialization(builder, "hc_namednodemapinuseattributeerr") != null) return; + var doc; + var elementList; + var firstNode; + var testNode; + var attributes; + var domesticAttr; + var setAttr; + var setNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + firstNode = elementList.item(0); + domesticAttr = doc.createAttribute("title"); + domesticAttr.value = "Yα"; + + setAttr = firstNode.setAttributeNode(domesticAttr); + elementList = doc.getElementsByTagName("acronym"); + testNode = elementList.item(2); + attributes = testNode.attributes; + + + { + success = false; + try { + setNode = attributes.setNamedItem(domesticAttr); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 10); + } + assertTrue("throw_INUSE_ATTRIBUTE_ERR",success); + } + +} + + + + +function runTest() { + hc_namednodemapinuseattributeerr(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml new file mode 100644 index 0000000..19599b0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapinuseattributeerr.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt new file mode 100644 index 0000000..257ccbf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnotfounderr +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.js new file mode 100644 index 0000000..67467c3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnotfounderr"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeNamedItem(name)" method raises a + NOT_FOUND_ERR DOMException if there is not a node + named "strong" in the map. + + Create a NamedNodeMap object from the attributes of the + last child of the third employee and attempt to remove + the "lang" attribute. There is not a node named + "lang" in the list and therefore the desired + exception should be raised. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-D58B193')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_namednodemapnotfounderr() { + var success; + if(checkInitialization(builder, "hc_namednodemapnotfounderr") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var removedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + attributes = testEmployee.attributes; + + + { + success = false; + try { + removedNode = attributes.removeNamedItem("lang"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 8); + } + assertTrue("throw_NOT_FOUND_ERR",success); + } + +} + + + + +function runTest() { + hc_namednodemapnotfounderr(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml new file mode 100644 index 0000000..2d5dd1f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnotfounderr.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt new file mode 100644 index 0000000..788b0fd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnumberofnodes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.js new file mode 100644 index 0000000..b703b21 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapnumberofnodes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the second "p" element and evaluate Node.attributes.length. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6D0FB19E +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=250 +*/ +function hc_namednodemapnumberofnodes() { + var success; + if(checkInitialization(builder, "hc_namednodemapnumberofnodes") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(2); + attributes = testEmployee.attributes; + + length = attributes.length; + + + if( + + (builder.contentType == "text/html") + + ) { + assertEquals("htmlLength",2,length); + + } + + else { + assertEquals("length",3,length); + + } + +} + + + + +function runTest() { + hc_namednodemapnumberofnodes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml new file mode 100644 index 0000000..cdde20f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapnumberofnodes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt new file mode 100644 index 0000000..27050e0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapremovenameditem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.js new file mode 100644 index 0000000..1370fa9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapremovenameditem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeNamedItem(name)" method removes a node + specified by name. + + Retrieve the third employee and create a NamedNodeMap + object of the attributes of the last child. Once the + list is created invoke the "removeNamedItem(name)" + method with name="class". This should result + in the removal of the specified attribute. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2002Mar/0002.html +*/ +function hc_namednodemapremovenameditem() { + var success; + if(checkInitialization(builder, "hc_namednodemapremovenameditem") != null) return; + var doc; + var elementList; + var newAttribute; + var testAddress; + var attributes; + var streetAttr; + var specified; + var removedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(2); + attributes = testAddress.attributes; + + removedNode = attributes.removeNamedItem("class"); + streetAttr = attributes.getNamedItem("class"); + assertNull("isnull",streetAttr); + +} + + + + +function runTest() { + hc_namednodemapremovenameditem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml new file mode 100644 index 0000000..3ce5639 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapremovenameditem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt new file mode 100644 index 0000000..b516117 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnattrnode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.js new file mode 100644 index 0000000..bfb396b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnattrnode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the second p element and create a NamedNodeMap + listing of the attributes of the last child. Once the + list is created an invocation of the "getNamedItem(name)" + method is done with name="class". This should result + in the method returning an Attr node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1112119403 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +*/ +function hc_namednodemapreturnattrnode() { + var success; + if(checkInitialization(builder, "hc_namednodemapreturnattrnode") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var streetAttr; + var attrName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(1); + attributes = testEmployee.attributes; + + streetAttr = attributes.getNamedItem("class"); + assertInstanceOf("typeAssert","Attr",streetAttr); +attrName = streetAttr.nodeName; + + assertEqualsAutoCase("attribute", "nodeName","class",attrName); + attrName = streetAttr.name; + + assertEqualsAutoCase("attribute", "name","class",attrName); + +} + + + + +function runTest() { + hc_namednodemapreturnattrnode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml new file mode 100644 index 0000000..c51b8c1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnattrnode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt new file mode 100644 index 0000000..3ef65d1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnfirstitem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.js new file mode 100644 index 0000000..9b17c3f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.js @@ -0,0 +1,150 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnfirstitem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "item(index)" method returns the indexth item in + the map(test for first item). + + Retrieve the second "acronym" get the NamedNodeMap of the attributes. Since the + DOM does not specify an order of these nodes the contents + of the FIRST node can contain either "title", "class" or "dir". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ +function hc_namednodemapreturnfirstitem() { + var success; + if(checkInitialization(builder, "hc_namednodemapreturnfirstitem") != null) return; + var doc; + var elementList; + var testAddress; + var attributes; + var child; + var nodeName; + htmlExpected = new Array(); + htmlExpected[0] = "title"; + htmlExpected[1] = "class"; + + expected = new Array(); + expected[0] = "title"; + expected[1] = "class"; + expected[2] = "dir"; + + var actual = new Array(); + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(1); + attributes = testAddress.attributes; + + for(var indexN10070 = 0;indexN10070 < attributes.length; indexN10070++) { + child = attributes.item(indexN10070); + nodeName = child.nodeName; + + actual[actual.length] = nodeName; + + } + + if( + + (builder.contentType == "text/html") + + ) { + assertEqualsCollection("attrName_html",toLowerArray(htmlExpected),toLowerArray(actual)); + + } + + else { + assertEqualsCollection("attrName",expected,actual); + + } + +} + + + + +function runTest() { + hc_namednodemapreturnfirstitem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml new file mode 100644 index 0000000..afeef2f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnfirstitem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt new file mode 100644 index 0000000..f4fa312 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnlastitem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.js new file mode 100644 index 0000000..90422c8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.js @@ -0,0 +1,152 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnlastitem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "item(index)" method returns the indexth item in + the map(test for last item). + + Retrieve the second "acronym" and get the attribute name. Since the + DOM does not specify an order of these nodes the contents + of the LAST node can contain either "title" or "class". + The test should return "true" if the LAST node is either + of these values. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ +function hc_namednodemapreturnlastitem() { + var success; + if(checkInitialization(builder, "hc_namednodemapreturnlastitem") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var child; + var nodeName; + htmlExpected = new Array(); + htmlExpected[0] = "title"; + htmlExpected[1] = "class"; + + expected = new Array(); + expected[0] = "title"; + expected[1] = "class"; + expected[2] = "dir"; + + var actual = new Array(); + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(1); + attributes = testEmployee.attributes; + + for(var indexN10070 = 0;indexN10070 < attributes.length; indexN10070++) { + child = attributes.item(indexN10070); + nodeName = child.nodeName; + + actual[actual.length] = nodeName; + + } + + if( + + (builder.contentType == "text/html") + + ) { + assertEqualsCollection("attrName_html",toLowerArray(htmlExpected),toLowerArray(actual)); + + } + + else { + assertEqualsCollection("attrName",expected,actual); + + } + +} + + + + +function runTest() { + hc_namednodemapreturnlastitem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml new file mode 100644 index 0000000..6e64643 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnlastitem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt new file mode 100644 index 0000000..e2bcc66 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.js new file mode 100644 index 0000000..04cb17e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.js @@ -0,0 +1,121 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapreturnnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getNamedItem(name)" method returns null of the + specified name did not identify any node in the map. + + Retrieve the second employee and create a NamedNodeMap + listing of the attributes of the last child. Once the + list is created an invocation of the "getNamedItem(name)" + method is done with name="lang". This name does not + match any names in the list therefore the method should + return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1074577549 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_namednodemapreturnnull() { + var success; + if(checkInitialization(builder, "hc_namednodemapreturnnull") != null) return; + var doc; + var elementList; + var testEmployee; + var attributes; + var districtNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testEmployee = elementList.item(1); + attributes = testEmployee.attributes; + + districtNode = attributes.getNamedItem("lang"); + assertNull("langAttrNull",districtNode); + +} + + + + +function runTest() { + hc_namednodemapreturnnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.xhtml new file mode 100644 index 0000000..a666f51 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapreturnnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt new file mode 100644 index 0000000..402640e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.js new file mode 100644 index 0000000..ffba08a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the second "p" element and create a NamedNodeMap + object from the attributes of the last child by + invoking the "getAttributes()" method. Once the + list is created an invocation of the "setNamedItem(arg)" + method is done with arg=newAttr, where newAttr is a + new Attr Node previously created. The "setNamedItem(arg)" + method should add then new node to the NamedNodeItem + object by using its "nodeName" attribute("lang'). + This node is then retrieved using the "getNamedItem(name)" + method. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_namednodemapsetnameditem() { + var success; + if(checkInitialization(builder, "hc_namednodemapsetnameditem") != null) return; + var doc; + var elementList; + var newAttribute; + var testAddress; + var attributes; + var districtNode; + var attrName; + var setNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(1); + newAttribute = doc.createAttribute("lang"); + attributes = testAddress.attributes; + + setNode = attributes.setNamedItem(newAttribute); + districtNode = attributes.getNamedItem("lang"); + attrName = districtNode.nodeName; + + assertEqualsAutoCase("attribute", "nodeName","lang",attrName); + +} + + + + +function runTest() { + hc_namednodemapsetnameditem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml new file mode 100644 index 0000000..7982539 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt new file mode 100644 index 0000000..619494c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemreturnvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js new file mode 100644 index 0000000..0d82c40 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemreturnvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "setNamedItem(arg)" method replaces an already + existing node with the same name then the already + existing node is returned. + + Retrieve the third employee and create a NamedNodeMap + object from the attributes of the last child by + invoking the "getAttributes()" method. Once the + list is created an invocation of the "setNamedItem(arg)" + method is done with arg=newAttr, where newAttr is a + new Attr Node previously created and whose node name + already exists in the map. The "setNamedItem(arg)" + method should replace the already existing node with + the new one and return the existing node. + This test uses the "createAttribute(name)" method from + the document interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ +function hc_namednodemapsetnameditemreturnvalue() { + var success; + if(checkInitialization(builder, "hc_namednodemapsetnameditemreturnvalue") != null) return; + var doc; + var elementList; + var newAttribute; + var testAddress; + var attributes; + var newNode; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(2); + newAttribute = doc.createAttribute("class"); + attributes = testAddress.attributes; + + newNode = attributes.setNamedItem(newAttribute); + assertNotNull("previousAttrNotNull",newNode); +attrValue = newNode.nodeValue; + + assertEquals("previousAttrValue","No",attrValue); + +} + + + + +function runTest() { + hc_namednodemapsetnameditemreturnvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml new file mode 100644 index 0000000..3d23635 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemreturnvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt new file mode 100644 index 0000000..26c6244 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemthatexists +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js new file mode 100644 index 0000000..7ba88c4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.js @@ -0,0 +1,134 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemthatexists"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the node to be added by the "setNamedItem(arg)" method + already exists in the NamedNodeMap, it is replaced by + the new one. + + Retrieve the second employee and create a NamedNodeMap + object from the attributes of the last child by + invoking the "getAttributes()" method. Once the + list is created an invocation of the "setNamedItem(arg)" + method is done with arg=newAttr, where newAttr is a + new Attr Node previously created and whose node name + already exists in the map. The "setNamedItem(arg)" + method should replace the already existing node with + the new one. + This node is then retrieved using the "getNamedItem(name)" + method. This test uses the "createAttribute(name)" + method from the document interface + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +*/ +function hc_namednodemapsetnameditemthatexists() { + var success; + if(checkInitialization(builder, "hc_namednodemapsetnameditemthatexists") != null) return; + var doc; + var elementList; + var newAttribute; + var testAddress; + var attributes; + var districtNode; + var attrValue; + var setNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(1); + newAttribute = doc.createAttribute("class"); + attributes = testAddress.attributes; + + setNode = attributes.setNamedItem(newAttribute); + districtNode = attributes.getNamedItem("class"); + attrValue = districtNode.nodeValue; + + assertEquals("namednodemapSetNamedItemThatExistsAssert","",attrValue); + +} + + + + +function runTest() { + hc_namednodemapsetnameditemthatexists(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml new file mode 100644 index 0000000..8443fba --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemthatexists.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt new file mode 100644 index 0000000..a36311d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemwithnewvalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js new file mode 100644 index 0000000..0ecee32 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapsetnameditemwithnewvalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "setNamedItem(arg)" method does not replace an + existing node with the same name then it returns null. + + Retrieve the third employee and create a NamedNodeMap + object from the attributes of the last child. + Once the list is created the "setNamedItem(arg)" method + is invoked with arg=newAttr, where newAttr is a + newly created Attr Node and whose node name + already exists in the map. The "setNamedItem(arg)" + method should add the new node and return null. + This test uses the "createAttribute(name)" method from + the document interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-349467F9 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=243 +*/ +function hc_namednodemapsetnameditemwithnewvalue() { + var success; + if(checkInitialization(builder, "hc_namednodemapsetnameditemwithnewvalue") != null) return; + var doc; + var elementList; + var newAttribute; + var testAddress; + var attributes; + var newNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddress = elementList.item(2); + newAttribute = doc.createAttribute("lang"); + attributes = testAddress.attributes; + + newNode = attributes.setNamedItem(newAttribute); + assertNull("prevValueNull",newNode); + +} + + + + +function runTest() { + hc_namednodemapsetnameditemwithnewvalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml new file mode 100644 index 0000000..3246afd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapsetnameditemwithnewvalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt new file mode 100644 index 0000000..ab021e2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js new file mode 100644 index 0000000..bde21e4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.js @@ -0,0 +1,149 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_namednodemapwrongdocumenterr"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + docsLoaded += preload(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + docsLoaded += preload(doc2Ref, "doc2", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "setNamedItem(arg)" method raises a + WRONG_DOCUMENT_ERR DOMException if "arg" was created + from a different document than the one that created + the NamedNodeMap. + + Create a NamedNodeMap object from the attributes of the + last child of the third employee and attempt to add + another Attr node to it that was created from a + different DOM document. This should raise the desired + exception. This method uses the "createAttribute(name)" + method from the Document interface. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1025163788')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_namednodemapwrongdocumenterr() { + var success; + if(checkInitialization(builder, "hc_namednodemapwrongdocumenterr") != null) return; + var doc1; + var doc2; + var elementList; + var testAddress; + var attributes; + var newAttribute; + var strong; + var setNode; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + doc1 = load(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + doc2 = load(doc2Ref, "doc2", "hc_staff"); + elementList = doc1.getElementsByTagName("acronym"); + testAddress = elementList.item(2); + newAttribute = doc2.createAttribute("newAttribute"); + attributes = testAddress.attributes; + + + { + success = false; + try { + setNode = attributes.setNamedItem(newAttribute); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_namednodemapwrongdocumenterr(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml new file mode 100644 index 0000000..cd43d20 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_namednodemapwrongdocumenterr.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild-expected.txt new file mode 100644 index 0000000..dec90c1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.js new file mode 100644 index 0000000..0da5325 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the second "p" and append a "br" Element + node to the list of children. The last node in the list + is then retrieved and its NodeName examined. The + "getNodeName()" method should return "br". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeappendchild() { + var success; + if(checkInitialization(builder, "hc_nodeappendchild") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var createdNode; + var lchild; + var childName; + var appendedChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + createdNode = doc.createElement("br"); + appendedChild = employeeNode.appendChild(createdNode); + lchild = employeeNode.lastChild; + + childName = lchild.nodeName; + + assertEqualsAutoCase("element", "nodeName","br",childName); + +} + + + + +function runTest() { + hc_nodeappendchild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.xhtml new file mode 100644 index 0000000..0c4c919 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt new file mode 100644 index 0000000..7411c1d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildchildexists +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.js new file mode 100644 index 0000000..2c95d9f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.js @@ -0,0 +1,160 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildchildexists"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "newChild" is already in the tree, it is first + removed before the new one is appended. + + Retrieve the "em" second employee and + append the first child to the end of the list. After + the "appendChild(newChild)" method is invoked the first + child should be the one that was second and the last + child should be the one that was first. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodeappendchildchildexists() { + var success; + if(checkInitialization(builder, "hc_nodeappendchildchildexists") != null) return; + var doc; + var elementList; + var childList; + var childNode; + var newChild; + var memberNode; + var memberName; + var refreshedActual = new Array(); + + var actual = new Array(); + + var nodeType; + expected = new Array(); + expected[0] = "strong"; + expected[1] = "code"; + expected[2] = "sup"; + expected[3] = "var"; + expected[4] = "acronym"; + expected[5] = "em"; + + var appendedChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + childNode = elementList.item(1); + childList = childNode.getElementsByTagName("*"); + newChild = childList.item(0); + appendedChild = childNode.appendChild(newChild); + for(var indexN10085 = 0;indexN10085 < childList.length; indexN10085++) { + memberNode = childList.item(indexN10085); + memberName = memberNode.nodeName; + + actual[actual.length] = memberName; + + } + assertEqualsListAutoCase("element", "liveByTagName",expected,actual); + childList = childNode.childNodes; + + for(var indexN1009C = 0;indexN1009C < childList.length; indexN1009C++) { + memberNode = childList.item(indexN1009C); + nodeType = memberNode.nodeType; + + + if( + (1 == nodeType) + ) { + memberName = memberNode.nodeName; + + refreshedActual[refreshedActual.length] = memberName; + + } + + } + assertEqualsListAutoCase("element", "refreshedChildNodes",expected,refreshedActual); + +} + + + + +function runTest() { + hc_nodeappendchildchildexists(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml new file mode 100644 index 0000000..4253b70 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildchildexists.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt new file mode 100644 index 0000000..b41bd6f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchilddocfragment +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.js new file mode 100644 index 0000000..f1b95ea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.js @@ -0,0 +1,158 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchilddocfragment"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "newChild" is a DocumentFragment object then + all its content is added to the child list of this node. + + Create and populate a new DocumentFragment object and + append it to the second employee. After the + "appendChild(newChild)" method is invoked retrieve the + new nodes at the end of the list, they should be the + two Element nodes from the DocumentFragment. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeappendchilddocfragment() { + var success; + if(checkInitialization(builder, "hc_nodeappendchilddocfragment") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var newdocFragment; + var newChild1; + var newChild2; + var child; + var childName; + var result = new Array(); + + var appendedChild; + var nodeType; + expected = new Array(); + expected[0] = "em"; + expected[1] = "strong"; + expected[2] = "code"; + expected[3] = "sup"; + expected[4] = "var"; + expected[5] = "acronym"; + expected[6] = "br"; + expected[7] = "b"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + newdocFragment = doc.createDocumentFragment(); + newChild1 = doc.createElement("br"); + newChild2 = doc.createElement("b"); + appendedChild = newdocFragment.appendChild(newChild1); + appendedChild = newdocFragment.appendChild(newChild2); + appendedChild = employeeNode.appendChild(newdocFragment); + for(var indexN100A2 = 0;indexN100A2 < childList.length; indexN100A2++) { + child = childList.item(indexN100A2); + nodeType = child.nodeType; + + + if( + (1 == nodeType) + ) { + childName = child.nodeName; + + result[result.length] = childName; + + } + + } + assertEqualsListAutoCase("element", "nodeNames",expected,result); + +} + + + + +function runTest() { + hc_nodeappendchilddocfragment(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml new file mode 100644 index 0000000..82deee7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchilddocfragment.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt new file mode 100644 index 0000000..33df1ea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildgetnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.js new file mode 100644 index 0000000..f7499c5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildgetnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "appendChild(newChild)" method returns the node + added. + + Append a newly created node to the child list of the + second employee and check the NodeName returned. The + "getNodeName()" method should return "br". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeappendchildgetnodename() { + var success; + if(checkInitialization(builder, "hc_nodeappendchildgetnodename") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var newChild; + var appendNode; + var childName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + newChild = doc.createElement("br"); + appendNode = employeeNode.appendChild(newChild); + childName = appendNode.nodeName; + + assertEqualsAutoCase("element", "nodeName","br",childName); + +} + + + + +function runTest() { + hc_nodeappendchildgetnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml new file mode 100644 index 0000000..64d1dee --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildgetnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt new file mode 100644 index 0000000..59594bd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildinvalidnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js new file mode 100644 index 0000000..854d1c3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildinvalidnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "appendChild(newChild)" method raises a + HIERARCHY_REQUEST_ERR DOMException if this node is of + a type that does not allow children of the type "newChild" + to be inserted. + + Retrieve the root node and attempt to append a newly + created Attr node. An Element node cannot have children + of the "Attr" type, therefore the desired exception + should be raised. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_nodeappendchildinvalidnodetype() { + var success; + if(checkInitialization(builder, "hc_nodeappendchildinvalidnodetype") != null) return; + var doc; + var rootNode; + var newChild; + var appendedChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + rootNode = doc.documentElement; + + newChild = doc.createAttribute("newAttribute"); + + { + success = false; + try { + appendedChild = rootNode.appendChild(newChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeappendchildinvalidnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml new file mode 100644 index 0000000..25a92e9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildinvalidnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt new file mode 100644 index 0000000..16ef8f1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument +Status failure +Message throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js new file mode 100644 index 0000000..1be650b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.js @@ -0,0 +1,144 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnewchilddiffdocument"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + docsLoaded += preload(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + docsLoaded += preload(doc2Ref, "doc2", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "appendChild(newChild)" method raises a + WRONG_DOCUMENT_ERR DOMException if the "newChild" was + created from a different document than the one that + created this node. + + Retrieve the second employee and attempt to append + a node created from a different document. An attempt + to make such a replacement should raise the desired + exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeappendchildnewchilddiffdocument() { + var success; + if(checkInitialization(builder, "hc_nodeappendchildnewchilddiffdocument") != null) return; + var doc1; + var doc2; + var newChild; + var elementList; + var elementNode; + var appendedChild; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + doc1 = load(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + doc2 = load(doc2Ref, "doc2", "hc_staff"); + newChild = doc1.createElement("br"); + elementList = doc2.getElementsByTagName("p"); + elementNode = elementList.item(1); + + { + success = false; + try { + appendedChild = elementNode.appendChild(newChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeappendchildnewchilddiffdocument(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml new file mode 100644 index 0000000..e4910f3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnewchilddiffdocument.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt new file mode 100644 index 0000000..8ec3a9c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnodeancestor +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.js new file mode 100644 index 0000000..a8ba817 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeappendchildnodeancestor"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "appendChild(newChild)" method raises a + HIERARCHY_REQUEST_ERR DOMException if the node to + append is one of this node's ancestors. + + Retrieve the second employee and attempt to append + an ancestor node(root node) to it. + An attempt to make such an addition should raise the + desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-184E7107')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +*/ +function hc_nodeappendchildnodeancestor() { + var success; + if(checkInitialization(builder, "hc_nodeappendchildnodeancestor") != null) return; + var doc; + var newChild; + var elementList; + var employeeNode; + var childList; + var oldChild; + var appendedChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.documentElement; + + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + + { + success = false; + try { + appendedChild = employeeNode.appendChild(newChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeappendchildnodeancestor(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml new file mode 100644 index 0000000..0f0432a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeappendchildnodeancestor.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt new file mode 100644 index 0000000..2f42466 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodeattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.js new file mode 100644 index 0000000..e8443db --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodeattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getAttributes()" method invoked on an Attribute +Node returns null. + +Retrieve the first attribute from the last child of the +first employee and invoke the "getAttributes()" method +on the Attribute Node. It should return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024 +*/ +function hc_nodeattributenodeattribute() { + var success; + if(checkInitialization(builder, "hc_nodeattributenodeattribute") != null) return; + var doc; + var elementList; + var testAddr; + var addrAttr; + var attrNode; + var attrList; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + addrAttr = testAddr.attributes; + + attrNode = addrAttr.item(0); + attrList = attrNode.attributes; + + assertNull("nodeAttributeNodeAttributeAssert1",attrList); + +} + + + + +function runTest() { + hc_nodeattributenodeattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml new file mode 100644 index 0000000..da5425b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodeattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename-expected.txt new file mode 100644 index 0000000..3cf1d6f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.js new file mode 100644 index 0000000..20b8e71 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.js @@ -0,0 +1,115 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the Attribute named "title" from the last + child of the first p element and check the string returned + by the "getNodeName()" method. It should be equal to + "title". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +*/ +function hc_nodeattributenodename() { + var success; + if(checkInitialization(builder, "hc_nodeattributenodename") != null) return; + var doc; + var elementList; + var testAddr; + var addrAttr; + var attrName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + addrAttr = testAddr.getAttributeNode("title"); + attrName = addrAttr.nodeName; + + assertEqualsAutoCase("attribute", "nodeName","title",attrName); + +} + + + + +function runTest() { + hc_nodeattributenodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.xhtml new file mode 100644 index 0000000..51b4ae1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype-expected.txt new file mode 100644 index 0000000..2777338 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.js new file mode 100644 index 0000000..41d7f10 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + The "getNodeType()" method for an Attribute Node + + returns the constant value 2. + + + + Retrieve the first attribute from the last child of + + the first employee and invoke the "getNodeType()" + + method. The method should return 2. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ +function hc_nodeattributenodetype() { + var success; + if(checkInitialization(builder, "hc_nodeattributenodetype") != null) return; + var doc; + var elementList; + var testAddr; + var addrAttr; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + addrAttr = testAddr.getAttributeNode("title"); + nodeType = addrAttr.nodeType; + + assertEquals("nodeAttrNodeTypeAssert1",2,nodeType); + +} + + + + +function runTest() { + hc_nodeattributenodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.xhtml new file mode 100644 index 0000000..a34dc4a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt new file mode 100644 index 0000000..0eecffe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.js new file mode 100644 index 0000000..679a9dd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeattributenodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + The string returned by the "getNodeValue()" method for an + Attribute Node is the value of the Attribute. + + Retrieve the Attribute named "title" from the last + child of the first "p" and check the string returned + by the "getNodeValue()" method. It should be equal to + "Yes". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ +function hc_nodeattributenodevalue() { + var success; + if(checkInitialization(builder, "hc_nodeattributenodevalue") != null) return; + var doc; + var elementList; + var testAddr; + var addrAttr; + var attrValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + addrAttr = testAddr.getAttributeNode("title"); + attrValue = addrAttr.nodeValue; + + assertEquals("nodeValue","Yes",attrValue); + +} + + + + +function runTest() { + hc_nodeattributenodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.xhtml new file mode 100644 index 0000000..ccfab5a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeattributenodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes-expected.txt new file mode 100644 index 0000000..e28eec6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.js b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.js new file mode 100644 index 0000000..855ec35 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.js @@ -0,0 +1,149 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + The "getChildNodes()" method returns a NodeList + that contains all children of this node. + + Retrieve the second employee and check the NodeList + returned by the "getChildNodes()" method. The + length of the list should be 13. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodechildnodes() { + var success; + if(checkInitialization(builder, "hc_nodechildnodes") != null) return; + var doc; + var elementList; + var employeeNode; + var childNode; + var childNodes; + var nodeType; + var childName; + var actual = new Array(); + + expected = new Array(); + expected[0] = "em"; + expected[1] = "strong"; + expected[2] = "code"; + expected[3] = "sup"; + expected[4] = "var"; + expected[5] = "acronym"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childNodes = employeeNode.childNodes; + + for(var indexN1006C = 0;indexN1006C < childNodes.length; indexN1006C++) { + childNode = childNodes.item(indexN1006C); + nodeType = childNode.nodeType; + + childName = childNode.nodeName; + + + if( + (1 == nodeType) + ) { + actual[actual.length] = childName; + + } + + else { + assertEquals("textNodeType",3,nodeType); + + } + + } + assertEqualsListAutoCase("element", "elementNames",expected,actual); + +} + + + + +function runTest() { + hc_nodechildnodes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.xhtml new file mode 100644 index 0000000..e79d252 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt new file mode 100644 index 0000000..f8e7c60 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesappendchild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.js b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.js new file mode 100644 index 0000000..a262e24 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.js @@ -0,0 +1,159 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesappendchild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The NodeList returned by the "getChildNodes()" method + is live. Changes on the node's children are immediately + reflected on the nodes returned in the NodeList. + + Create a NodeList of the children of the second employee + and then add a newly created element that was created + by the "createElement()" method(Document Interface) to + the second employee by using the "appendChild()" method. + The length of the NodeList should reflect this new + addition to the child list. It should return the value 14. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-184E7107 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodechildnodesappendchild() { + var success; + if(checkInitialization(builder, "hc_nodechildnodesappendchild") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var createdNode; + var childNode; + var childName; + var childType; + var textNode; + var actual = new Array(); + + expected = new Array(); + expected[0] = "em"; + expected[1] = "strong"; + expected[2] = "code"; + expected[3] = "sup"; + expected[4] = "var"; + expected[5] = "acronym"; + expected[6] = "br"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + createdNode = doc.createElement("br"); + employeeNode = employeeNode.appendChild(createdNode); + for(var indexN10087 = 0;indexN10087 < childList.length; indexN10087++) { + childNode = childList.item(indexN10087); + childName = childNode.nodeName; + + childType = childNode.nodeType; + + + if( + (1 == childType) + ) { + actual[actual.length] = childName; + + } + + else { + assertEquals("textNodeType",3,childType); + + } + + } + assertEqualsListAutoCase("element", "childElements",expected,actual); + +} + + + + +function runTest() { + hc_nodechildnodesappendchild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml new file mode 100644 index 0000000..c38c0cc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesappendchild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty-expected.txt new file mode 100644 index 0000000..c8fcedb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesempty +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.js b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.js new file mode 100644 index 0000000..612307c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodechildnodesempty"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getChildNodes()" method returns a NodeList + that contains all children of this node. If there + are not any children, this is a NodeList that does not + contain any nodes. + + Retrieve the character data of the second "em" node and + invoke the "getChildNodes()" method. The + NodeList returned should not have any nodes. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodechildnodesempty() { + var success; + if(checkInitialization(builder, "hc_nodechildnodesempty") != null) return; + var doc; + var elementList; + var childList; + var employeeNode; + var textNode; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("em"); + employeeNode = elementList.item(1); + textNode = employeeNode.firstChild; + + childList = textNode.childNodes; + + length = childList.length; + + assertEquals("length_zero",0,length); + +} + + + + +function runTest() { + hc_nodechildnodesempty(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.xhtml new file mode 100644 index 0000000..93f87b4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodechildnodesempty.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt new file mode 100644 index 0000000..045ab4f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecloneattributescopied +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.js b/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.js new file mode 100644 index 0000000..d753c4b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.js @@ -0,0 +1,149 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecloneattributescopied"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the second acronym element and invoke + the cloneNode method. The + duplicate node returned by the method should copy the + attributes associated with this node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ +function hc_nodecloneattributescopied() { + var success; + if(checkInitialization(builder, "hc_nodecloneattributescopied") != null) return; + var doc; + var elementList; + var addressNode; + var clonedNode; + var attributes; + var attributeNode; + var attributeName; + var result = new Array(); + + htmlExpected = new Array(); + htmlExpected[0] = "class"; + htmlExpected[1] = "title"; + + expected = new Array(); + expected[0] = "class"; + expected[1] = "title"; + expected[2] = "dir"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + addressNode = elementList.item(1); + clonedNode = addressNode.cloneNode(false); + attributes = clonedNode.attributes; + + for(var indexN10076 = 0;indexN10076 < attributes.length; indexN10076++) { + attributeNode = attributes.item(indexN10076); + attributeName = attributeNode.nodeName; + + result[result.length] = attributeName; + + } + + if( + + (builder.contentType == "text/html") + + ) { + assertEqualsCollection("nodeNames_html",toLowerArray(htmlExpected),toLowerArray(result)); + + } + + else { + assertEqualsCollection("nodeNames",expected,result); + + } + +} + + + + +function runTest() { + hc_nodecloneattributescopied(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.xhtml new file mode 100644 index 0000000..939d701 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecloneattributescopied.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt new file mode 100644 index 0000000..2128b64 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonefalsenocopytext +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.js new file mode 100644 index 0000000..8d41464 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonefalsenocopytext"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "cloneNode(deep)" method does not copy text unless it + is deep cloned.(Test for deep=false) + + Retrieve the fourth child of the second employee and + the "cloneNode(deep)" method with deep=false. The + duplicate node returned by the method should not copy + any text data contained in this node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ +function hc_nodeclonefalsenocopytext() { + var success; + if(checkInitialization(builder, "hc_nodeclonefalsenocopytext") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var childNode; + var clonedNode; + var lastChildNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + childNode = childList.item(3); + clonedNode = childNode.cloneNode(false); + lastChildNode = clonedNode.lastChild; + + assertNull("nodeCloneFalseNoCopyTextAssert1",lastChildNode); + +} + + + + +function runTest() { + hc_nodeclonefalsenocopytext(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml new file mode 100644 index 0000000..ccad4ef --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonefalsenocopytext.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt new file mode 100644 index 0000000..04322dc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonegetparentnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.js new file mode 100644 index 0000000..ab52c8a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonegetparentnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The duplicate node returned by the "cloneNode(deep)" + method does not have a ParentNode. + + Retrieve the second employee and invoke the + "cloneNode(deep)" method with deep=false. The + duplicate node returned should return null when the + "getParentNode()" is invoked. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ +function hc_nodeclonegetparentnull() { + var success; + if(checkInitialization(builder, "hc_nodeclonegetparentnull") != null) return; + var doc; + var elementList; + var employeeNode; + var clonedNode; + var parentNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + clonedNode = employeeNode.cloneNode(false); + parentNode = clonedNode.parentNode; + + assertNull("nodeCloneGetParentNullAssert1",parentNode); + +} + + + + +function runTest() { + hc_nodeclonegetparentnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml new file mode 100644 index 0000000..f34fefb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonegetparentnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt new file mode 100644 index 0000000..9977017 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodefalse +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.js new file mode 100644 index 0000000..7d48edf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodefalse"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "cloneNode(deep)" method returns a copy of the node + only if deep=false. + + Retrieve the second employee and invoke the + "cloneNode(deep)" method with deep=false. The + method should only clone this node. The NodeName and + length of the NodeList are checked. The "getNodeName()" + method should return "employee" and the "getLength()" + method should return 0. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +*/ +function hc_nodeclonenodefalse() { + var success; + if(checkInitialization(builder, "hc_nodeclonenodefalse") != null) return; + var doc; + var elementList; + var employeeNode; + var clonedNode; + var cloneName; + var cloneChildren; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + clonedNode = employeeNode.cloneNode(false); + cloneName = clonedNode.nodeName; + + assertEqualsAutoCase("element", "strong","p",cloneName); + cloneChildren = clonedNode.childNodes; + + length = cloneChildren.length; + + assertEquals("length",0,length); + +} + + + + +function runTest() { + hc_nodeclonenodefalse(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.xhtml new file mode 100644 index 0000000..9a0f82a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodefalse.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt new file mode 100644 index 0000000..6f0c0cd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodetrue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.js new file mode 100644 index 0000000..5eba8cd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.js @@ -0,0 +1,145 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonenodetrue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "cloneNode(deep)" method returns a copy of the node + and the subtree under it if deep=true. + + Retrieve the second employee and invoke the + "cloneNode(deep)" method with deep=true. The + method should clone this node and the subtree under it. + The NodeName of each child in the returned node is + checked to insure the entire subtree under the second + employee was cloned. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodeclonenodetrue() { + var success; + if(checkInitialization(builder, "hc_nodeclonenodetrue") != null) return; + var doc; + var elementList; + var employeeNode; + var clonedNode; + var clonedList; + var clonedChild; + var clonedChildName; + var origList; + var origChild; + var origChildName; + var result = new Array(); + + var expected = new Array(); + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + origList = employeeNode.childNodes; + + for(var indexN10065 = 0;indexN10065 < origList.length; indexN10065++) { + origChild = origList.item(indexN10065); + origChildName = origChild.nodeName; + + expected[expected.length] = origChildName; + + } + clonedNode = employeeNode.cloneNode(true); + clonedList = clonedNode.childNodes; + + for(var indexN1007B = 0;indexN1007B < clonedList.length; indexN1007B++) { + clonedChild = clonedList.item(indexN1007B); + clonedChildName = clonedChild.nodeName; + + result[result.length] = clonedChildName; + + } + assertEqualsList("clone",expected,result); + +} + + + + +function runTest() { + hc_nodeclonenodetrue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.xhtml new file mode 100644 index 0000000..55c7e2b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonenodetrue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt new file mode 100644 index 0000000..1f0b18f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonetruecopytext +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.js new file mode 100644 index 0000000..c12370b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.js @@ -0,0 +1,121 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeclonetruecopytext"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "cloneNode(deep)" method does not copy text unless it + is deep cloned.(Test for deep=true) + + Retrieve the eighth child of the second employee and + the "cloneNode(deep)" method with deep=true. The + duplicate node returned by the method should copy + any text data contained in this node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-3A0ED0A4 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodeclonetruecopytext() { + var success; + if(checkInitialization(builder, "hc_nodeclonetruecopytext") != null) return; + var doc; + var elementList; + var childNode; + var clonedNode; + var lastChildNode; + var childValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("sup"); + childNode = elementList.item(1); + clonedNode = childNode.cloneNode(true); + lastChildNode = clonedNode.lastChild; + + childValue = lastChildNode.nodeValue; + + assertEquals("cloneContainsText","35,000",childValue); + +} + + + + +function runTest() { + hc_nodeclonetruecopytext(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml new file mode 100644 index 0000000..28e1f26 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeclonetruecopytext.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt new file mode 100644 index 0000000..1ff1980 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodeattributes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.js b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.js new file mode 100644 index 0000000..7e3e2e9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.js @@ -0,0 +1,135 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodeattributes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getAttributes()" method invoked on a Comment + Node returns null. + + Find any comment that is an immediate child of the root + and assert that Node.attributes is null. Then create + a new comment node (in case they had been omitted) and + make the assertion. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=263 +*/ +function hc_nodecommentnodeattributes() { + var success; + if(checkInitialization(builder, "hc_nodecommentnodeattributes") != null) return; + var doc; + var commentNode; + var nodeList; + var attrList; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + nodeList = doc.childNodes; + + for(var indexN10043 = 0;indexN10043 < nodeList.length; indexN10043++) { + commentNode = nodeList.item(indexN10043); + nodeType = commentNode.nodeType; + + + if( + (8 == nodeType) + ) { + attrList = commentNode.attributes; + + assertNull("existingCommentAttributesNull",attrList); + + } + + } + commentNode = doc.createComment("This is a comment"); + attrList = commentNode.attributes; + + assertNull("createdCommentAttributesNull",attrList); + +} + + + + +function runTest() { + hc_nodecommentnodeattributes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml new file mode 100644 index 0000000..fb2d471 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodeattributes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename-expected.txt new file mode 100644 index 0000000..d5e4f71 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.js new file mode 100644 index 0000000..de7013a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.js @@ -0,0 +1,134 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeName()" method for a + Comment Node is "#comment". + + Retrieve the Comment node in the XML file + and check the string returned by the "getNodeName()" + method. It should be equal to "#comment". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ +function hc_nodecommentnodename() { + var success; + if(checkInitialization(builder, "hc_nodecommentnodename") != null) return; + var doc; + var elementList; + var commentNode; + var nodeType; + var commentName; + var commentNodeName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.childNodes; + + for(var indexN10044 = 0;indexN10044 < elementList.length; indexN10044++) { + commentNode = elementList.item(indexN10044); + nodeType = commentNode.nodeType; + + + if( + (8 == nodeType) + ) { + commentNodeName = commentNode.nodeName; + + assertEquals("existingNodeName","#comment",commentNodeName); + + } + + } + commentNode = doc.createComment("This is a comment"); + commentNodeName = commentNode.nodeName; + + assertEquals("createdNodeName","#comment",commentNodeName); + +} + + + + +function runTest() { + hc_nodecommentnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.xhtml new file mode 100644 index 0000000..616d5cd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype-expected.txt new file mode 100644 index 0000000..a1b0949 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.js new file mode 100644 index 0000000..168b918 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getNodeType()" method for a Comment Node + returns the constant value 8. + + Retrieve the nodes from the document and check for + a comment node and invoke the "getNodeType()" method. This should + return 8. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ +function hc_nodecommentnodetype() { + var success; + if(checkInitialization(builder, "hc_nodecommentnodetype") != null) return; + var doc; + var testList; + var commentNode; + var commentNodeName; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + testList = doc.childNodes; + + for(var indexN10040 = 0;indexN10040 < testList.length; indexN10040++) { + commentNode = testList.item(indexN10040); + commentNodeName = commentNode.nodeName; + + + if( + ("#comment" == commentNodeName) + ) { + nodeType = commentNode.nodeType; + + assertEquals("existingCommentNodeType",8,nodeType); + + } + + } + commentNode = doc.createComment("This is a comment"); + nodeType = commentNode.nodeType; + + assertEquals("createdCommentNodeType",8,nodeType); + +} + + + + +function runTest() { + hc_nodecommentnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.xhtml new file mode 100644 index 0000000..8e99dd0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt new file mode 100644 index 0000000..67ec89a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.js new file mode 100644 index 0000000..64e35b2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodecommentnodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeValue()" method for a + Comment Node is the content of the comment. + + Retrieve the comment in the XML file and + check the string returned by the "getNodeValue()" method. + It should be equal to "This is comment number 1". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=248 +*/ +function hc_nodecommentnodevalue() { + var success; + if(checkInitialization(builder, "hc_nodecommentnodevalue") != null) return; + var doc; + var elementList; + var commentNode; + var commentName; + var commentValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.childNodes; + + for(var indexN10040 = 0;indexN10040 < elementList.length; indexN10040++) { + commentNode = elementList.item(indexN10040); + commentName = commentNode.nodeName; + + + if( + ("#comment" == commentName) + ) { + commentValue = commentNode.nodeValue; + + assertEquals("value"," This is comment number 1.",commentValue); + + } + + } + commentNode = doc.createComment(" This is a comment"); + commentValue = commentNode.nodeValue; + + assertEquals("createdCommentNodeValue"," This is a comment",commentValue); + +} + + + + +function runTest() { + hc_nodecommentnodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.xhtml new file mode 100644 index 0000000..945c89a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodecommentnodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt new file mode 100644 index 0000000..ca32a37 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.js new file mode 100644 index 0000000..4c3b8f2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeName()" method for a + DocumentFragment Node is "#document-frament". + + Retrieve the DOM document and invoke the + "createDocumentFragment()" method and check the string + returned by the "getNodeName()" method. It should be + equal to "#document-fragment". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ +function hc_nodedocumentfragmentnodename() { + var success; + if(checkInitialization(builder, "hc_nodedocumentfragmentnodename") != null) return; + var doc; + var docFragment; + var documentFragmentName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docFragment = doc.createDocumentFragment(); + documentFragmentName = docFragment.nodeName; + + assertEquals("nodeDocumentFragmentNodeNameAssert1","#document-fragment",documentFragmentName); + +} + + + + +function runTest() { + hc_nodedocumentfragmentnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml new file mode 100644 index 0000000..7e474fb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt new file mode 100644 index 0000000..fc6cdc0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js new file mode 100644 index 0000000..404dcd4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getNodeType()" method for a DocumentFragment Node + returns the constant value 11. + + Invoke the "createDocumentFragment()" method and + examine the NodeType of the document fragment + returned by the "getNodeType()" method. The method + should return 11. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ +function hc_nodedocumentfragmentnodetype() { + var success; + if(checkInitialization(builder, "hc_nodedocumentfragmentnodetype") != null) return; + var doc; + var documentFragmentNode; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + documentFragmentNode = doc.createDocumentFragment(); + nodeType = documentFragmentNode.nodeType; + + assertEquals("nodeDocumentFragmentNodeTypeAssert1",11,nodeType); + +} + + + + +function runTest() { + hc_nodedocumentfragmentnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml new file mode 100644 index 0000000..fb84f01 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt new file mode 100644 index 0000000..5552a7e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js new file mode 100644 index 0000000..3817faf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.js @@ -0,0 +1,120 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentfragmentnodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeValue()" method for a + DocumentFragment Node is null. + + Retrieve the DOM document and invoke the + "createDocumentFragment()" method and check the string + returned by the "getNodeValue()" method. It should be + equal to null. + +* @author Curt Arnold +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +*/ +function hc_nodedocumentfragmentnodevalue() { + var success; + if(checkInitialization(builder, "hc_nodedocumentfragmentnodevalue") != null) return; + var doc; + var docFragment; + var attrList; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docFragment = doc.createDocumentFragment(); + attrList = docFragment.attributes; + + assertNull("attributesNull",attrList); + value = docFragment.nodeValue; + + assertNull("initiallyNull",value); + +} + + + + +function runTest() { + hc_nodedocumentfragmentnodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml new file mode 100644 index 0000000..705ba5f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentfragmentnodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt new file mode 100644 index 0000000..ba88dca --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodeattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.js new file mode 100644 index 0000000..0509317 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.js @@ -0,0 +1,111 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodeattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getAttributes()" method invoked on a Document +Node returns null. + +Retrieve the DOM Document and invoke the +"getAttributes()" method on the Document Node. +It should return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ +function hc_nodedocumentnodeattribute() { + var success; + if(checkInitialization(builder, "hc_nodedocumentnodeattribute") != null) return; + var doc; + var attrList; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + attrList = doc.attributes; + + assertNull("doc_attributes_is_null",attrList); + +} + + + + +function runTest() { + hc_nodedocumentnodeattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml new file mode 100644 index 0000000..9d2e2cc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodeattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename-expected.txt new file mode 100644 index 0000000..d8c73d1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.js new file mode 100644 index 0000000..7cdef03 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.js @@ -0,0 +1,111 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeName()" method for a + Document Node is "#document". + + Retrieve the DOM document and check the string returned + by the "getNodeName()" method. It should be equal to + "#document". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ +function hc_nodedocumentnodename() { + var success; + if(checkInitialization(builder, "hc_nodedocumentnodename") != null) return; + var doc; + var documentName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + documentName = doc.nodeName; + + assertEquals("documentNodeName","#document",documentName); + +} + + + + +function runTest() { + hc_nodedocumentnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.xhtml new file mode 100644 index 0000000..e11e3ae --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt new file mode 100644 index 0000000..308592e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.js new file mode 100644 index 0000000..12ac065 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.js @@ -0,0 +1,110 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getNodeType()" method for a Document Node +returns the constant value 9. + +Retrieve the document and invoke the "getNodeType()" +method. The method should return 9. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ +function hc_nodedocumentnodetype() { + var success; + if(checkInitialization(builder, "hc_nodedocumentnodetype") != null) return; + var doc; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + nodeType = doc.nodeType; + + assertEquals("nodeDocumentNodeTypeAssert1",9,nodeType); + +} + + + + +function runTest() { + hc_nodedocumentnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.xhtml new file mode 100644 index 0000000..4ec4725 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt new file mode 100644 index 0000000..8343b7e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.js new file mode 100644 index 0000000..6cd8934 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.js @@ -0,0 +1,112 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodedocumentnodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeValue()" method for a + Document Node is null. + + Retrieve the DOM Document and check the string returned + by the "getNodeValue()" method. It should be equal to + null. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ +function hc_nodedocumentnodevalue() { + var success; + if(checkInitialization(builder, "hc_nodedocumentnodevalue") != null) return; + var doc; + var documentValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + documentValue = doc.nodeValue; + + assertNull("documentNodeValue",documentValue); + +} + + + + +function runTest() { + hc_nodedocumentnodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml new file mode 100644 index 0000000..8443ed4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodedocumentnodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt new file mode 100644 index 0000000..5eba613 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodeattributes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.js new file mode 100644 index 0000000..7046cdd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.js @@ -0,0 +1,145 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodeattributes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the third "acronym" element and evaluate Node.attributes. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=236 +* @see http://lists.w3.org/Archives/Public/www-dom-ts/2003Jun/0011.html +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=184 +*/ +function hc_nodeelementnodeattributes() { + var success; + if(checkInitialization(builder, "hc_nodeelementnodeattributes") != null) return; + var doc; + var elementList; + var testAddr; + var addrAttr; + var attrNode; + var attrName; + var attrList = new Array(); + + htmlExpected = new Array(); + htmlExpected[0] = "title"; + htmlExpected[1] = "class"; + + expected = new Array(); + expected[0] = "title"; + expected[1] = "class"; + expected[2] = "dir"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(2); + addrAttr = testAddr.attributes; + + for(var indexN10070 = 0;indexN10070 < addrAttr.length; indexN10070++) { + attrNode = addrAttr.item(indexN10070); + attrName = attrNode.nodeName; + + attrList[attrList.length] = attrName; + + } + + if( + + (builder.contentType == "text/html") + + ) { + assertEqualsCollection("attrNames_html",toLowerArray(htmlExpected),toLowerArray(attrList)); + + } + + else { + assertEqualsCollection("attrNames",expected,attrList); + + } + +} + + + + +function runTest() { + hc_nodeelementnodeattributes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml new file mode 100644 index 0000000..cbcc998 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodeattributes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename-expected.txt new file mode 100644 index 0000000..24e9425 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.js new file mode 100644 index 0000000..693d23e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.js @@ -0,0 +1,125 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the first Element Node(Root Node) of the + DOM object and check the string returned by the + "getNodeName()" method. It should be equal to its + tagName. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ +function hc_nodeelementnodename() { + var success; + if(checkInitialization(builder, "hc_nodeelementnodename") != null) return; + var doc; + var elementNode; + var elementName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementNode = doc.documentElement; + + elementName = elementNode.nodeName; + + + if( + + (builder.contentType == "image/svg+xml") + + ) { + assertEquals("svgNodeName","svg",elementName); + + } + + else { + assertEqualsAutoCase("element", "nodeName","html",elementName); + + } + +} + + + + +function runTest() { + hc_nodeelementnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.xhtml new file mode 100644 index 0000000..be7a348 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype-expected.txt new file mode 100644 index 0000000..09602b2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.js new file mode 100644 index 0000000..56dd936 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.js @@ -0,0 +1,112 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getNodeType()" method for an Element Node + returns the constant value 1. + + Retrieve the root node and invoke the "getNodeType()" + method. The method should return 1. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ +function hc_nodeelementnodetype() { + var success; + if(checkInitialization(builder, "hc_nodeelementnodetype") != null) return; + var doc; + var rootNode; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + rootNode = doc.documentElement; + + nodeType = rootNode.nodeType; + + assertEquals("nodeElementNodeTypeAssert1",1,nodeType); + +} + + + + +function runTest() { + hc_nodeelementnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.xhtml new file mode 100644 index 0000000..45fe5c5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt new file mode 100644 index 0000000..bf16e70 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.js new file mode 100644 index 0000000..29124cf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.js @@ -0,0 +1,109 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeelementnodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeValue()" method for an + Element Node is null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ +function hc_nodeelementnodevalue() { + var success; + if(checkInitialization(builder, "hc_nodeelementnodevalue") != null) return; + var doc; + var elementNode; + var elementValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementNode = doc.documentElement; + + elementValue = elementNode.nodeValue; + + assertNull("elementNodeValue",elementValue); + +} + + + + +function runTest() { + hc_nodeelementnodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.xhtml new file mode 100644 index 0000000..4f0d279 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeelementnodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild-expected.txt new file mode 100644 index 0000000..db1de71 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.js new file mode 100644 index 0000000..a4681f0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getFirstChild()" method returns the first child + of this node. + + Retrieve the second employee and invoke the + "getFirstChild()" method. The NodeName returned + should be "#text" or "EM". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodegetfirstchild() { + var success; + if(checkInitialization(builder, "hc_nodegetfirstchild") != null) return; + var doc; + var elementList; + var employeeNode; + var fchildNode; + var childName; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + fchildNode = employeeNode.firstChild; + + childName = fchildNode.nodeName; + + + if( + ("#text" == childName) + ) { + assertEquals("firstChild_w_whitespace","#text",childName); + + } + + else { + assertEqualsAutoCase("element", "firstChild_wo_whitespace","em",childName); + + } + +} + + + + +function runTest() { + hc_nodegetfirstchild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.xhtml new file mode 100644 index 0000000..4de3fff --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt new file mode 100644 index 0000000..d4716b9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchildnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.js new file mode 100644 index 0000000..dec151f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetfirstchildnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If there is not a first child then the "getFirstChild()" + method returns null. + + Retrieve the text of the first "em" element and invoke the "getFirstChild()" method. It + should return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-169727388 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodegetfirstchildnull() { + var success; + if(checkInitialization(builder, "hc_nodegetfirstchildnull") != null) return; + var doc; + var emList; + var emNode; + var emText; + var nullChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + emList = doc.getElementsByTagName("em"); + emNode = emList.item(0); + emText = emNode.firstChild; + + nullChild = emText.firstChild; + + assertNull("nullChild",nullChild); + +} + + + + +function runTest() { + hc_nodegetfirstchildnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml new file mode 100644 index 0000000..3ee51e8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetfirstchildnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild-expected.txt new file mode 100644 index 0000000..9735829 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.js new file mode 100644 index 0000000..712c5ef --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getLastChild()" method returns the last child + of this node. + + Retrieve the second employee and invoke the + "getLastChild()" method. The NodeName returned + should be "#text". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +*/ +function hc_nodegetlastchild() { + var success; + if(checkInitialization(builder, "hc_nodegetlastchild") != null) return; + var doc; + var elementList; + var employeeNode; + var lchildNode; + var childName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + lchildNode = employeeNode.lastChild; + + childName = lchildNode.nodeName; + + assertEquals("whitespace","#text",childName); + +} + + + + +function runTest() { + hc_nodegetlastchild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.xhtml new file mode 100644 index 0000000..6cf6a38 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt new file mode 100644 index 0000000..20b7918 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchildnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.js new file mode 100644 index 0000000..9e5a6ad --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetlastchildnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + If there is not a last child then the "getLastChild()" + method returns null. + + Retrieve the text of the first "em" element and invoke the "getFirstChild()" method. It + should return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-61AD09FB +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodegetlastchildnull() { + var success; + if(checkInitialization(builder, "hc_nodegetlastchildnull") != null) return; + var doc; + var emList; + var emNode; + var emText; + var nullChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + emList = doc.getElementsByTagName("em"); + emNode = emList.item(0); + emText = emNode.firstChild; + + nullChild = emText.lastChild; + + assertNull("nullChild",nullChild); + +} + + + + +function runTest() { + hc_nodegetlastchildnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.xhtml new file mode 100644 index 0000000..ad24b18 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetlastchildnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling-expected.txt new file mode 100644 index 0000000..6bbec51 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsibling +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.js new file mode 100644 index 0000000..3daca44 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsibling"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getNextSibling()" method returns the node immediately + following this node. + + Retrieve the first child of the second employee and + invoke the "getNextSibling()" method. It should return + a node with the NodeName of "#text". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +*/ +function hc_nodegetnextsibling() { + var success; + if(checkInitialization(builder, "hc_nodegetnextsibling") != null) return; + var doc; + var elementList; + var emNode; + var nsNode; + var nsName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("em"); + emNode = elementList.item(1); + nsNode = emNode.nextSibling; + + nsName = nsNode.nodeName; + + assertEquals("whitespace","#text",nsName); + +} + + + + +function runTest() { + hc_nodegetnextsibling(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.xhtml new file mode 100644 index 0000000..9e10051 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsibling.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt new file mode 100644 index 0000000..25a10d7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsiblingnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.js new file mode 100644 index 0000000..0f9cb7b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetnextsiblingnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + If there is not a node immediately following this node the + + "getNextSibling()" method returns null. + + + + Retrieve the first child of the second employee and + + invoke the "getNextSibling()" method. It should + + be set to null. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-6AC54C2F +*/ +function hc_nodegetnextsiblingnull() { + var success; + if(checkInitialization(builder, "hc_nodegetnextsiblingnull") != null) return; + var doc; + var elementList; + var employeeNode; + var lcNode; + var nsNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + lcNode = employeeNode.lastChild; + + nsNode = lcNode.nextSibling; + + assertNull("nodeGetNextSiblingNullAssert1",nsNode); + +} + + + + +function runTest() { + hc_nodegetnextsiblingnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml new file mode 100644 index 0000000..fc134ef --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetnextsiblingnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument-expected.txt new file mode 100644 index 0000000..b9cf9f2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocument +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.js new file mode 100644 index 0000000..85853b8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocument"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +Evaluate Node.ownerDocument on the second "p" element. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=251 +*/ +function hc_nodegetownerdocument() { + var success; + if(checkInitialization(builder, "hc_nodegetownerdocument") != null) return; + var doc; + var elementList; + var docNode; + var ownerDocument; + var docElement; + var elementName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + docNode = elementList.item(1); + ownerDocument = docNode.ownerDocument; + + docElement = ownerDocument.documentElement; + + elementName = docElement.nodeName; + + + if( + + (builder.contentType == "image/svg+xml") + + ) { + assertEquals("svgNodeName","svg",elementName); + + } + + else { + assertEqualsAutoCase("element", "ownerDocElemTagName","html",elementName); + + } + +} + + + + +function runTest() { + hc_nodegetownerdocument(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.xhtml new file mode 100644 index 0000000..5bb8020 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocument.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt new file mode 100644 index 0000000..d4c2da3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocumentnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.js new file mode 100644 index 0000000..67bfd87 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.js @@ -0,0 +1,115 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetownerdocumentnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + The "getOwnerDocument()" method returns null if the target + + node itself is a document. + + + + Invoke the "getOwnerDocument()" method on the master + + document. The Document returned should be null. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#node-ownerDoc +*/ +function hc_nodegetownerdocumentnull() { + var success; + if(checkInitialization(builder, "hc_nodegetownerdocumentnull") != null) return; + var doc; + var ownerDocument; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + ownerDocument = doc.ownerDocument; + + assertNull("nodeGetOwnerDocumentNullAssert1",ownerDocument); + +} + + + + +function runTest() { + hc_nodegetownerdocumentnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml new file mode 100644 index 0000000..dbe0061 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetownerdocumentnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt new file mode 100644 index 0000000..d33e378 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussibling +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.js new file mode 100644 index 0000000..5434f05 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussibling"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getPreviousSibling()" method returns the node + immediately preceding this node. + + Retrieve the second child of the second employee and + invoke the "getPreviousSibling()" method. It should + return a node with a NodeName of "#text". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +*/ +function hc_nodegetprevioussibling() { + var success; + if(checkInitialization(builder, "hc_nodegetprevioussibling") != null) return; + var doc; + var elementList; + var nameNode; + var psNode; + var psName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(1); + psNode = nameNode.previousSibling; + + psName = psNode.nodeName; + + assertEquals("whitespace","#text",psName); + +} + + + + +function runTest() { + hc_nodegetprevioussibling(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.xhtml new file mode 100644 index 0000000..a093fee --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussibling.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt new file mode 100644 index 0000000..2ff9a1b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussiblingnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.js new file mode 100644 index 0000000..b1dc787 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodegetprevioussiblingnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + If there is not a node immediately preceding this node the + + "getPreviousSibling()" method returns null. + + + + Retrieve the first child of the second employee and + + invoke the "getPreviousSibling()" method. It should + + be set to null. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-640FB3C8 +*/ +function hc_nodegetprevioussiblingnull() { + var success; + if(checkInitialization(builder, "hc_nodegetprevioussiblingnull") != null) return; + var doc; + var elementList; + var employeeNode; + var fcNode; + var psNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + fcNode = employeeNode.firstChild; + + psNode = fcNode.previousSibling; + + assertNull("nodeGetPreviousSiblingNullAssert1",psNode); + +} + + + + +function runTest() { + hc_nodegetprevioussiblingnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml new file mode 100644 index 0000000..4e6cfc0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodegetprevioussiblingnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes-expected.txt new file mode 100644 index 0000000..59ae103 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodes +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.js b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.js new file mode 100644 index 0000000..1ff38a9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.js @@ -0,0 +1,113 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodes"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "hasChildNodes()" method returns true if the node + has children. + + Retrieve the root node("staff") and invoke the + "hasChildNodes()" method. It should return the boolean + value "true". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +*/ +function hc_nodehaschildnodes() { + var success; + if(checkInitialization(builder, "hc_nodehaschildnodes") != null) return; + var doc; + var elementList; + var employeeNode; + var state; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + state = employeeNode.hasChildNodes(); + assertTrue("nodeHasChildAssert1",state); + +} + + + + +function runTest() { + hc_nodehaschildnodes(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.xhtml new file mode 100644 index 0000000..d8de482 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodes.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt new file mode 100644 index 0000000..93be6aa --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodesfalse +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.js b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.js new file mode 100644 index 0000000..f966eba --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodehaschildnodesfalse"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "hasChildNodes()" method returns false if the node + does not have any children. + + Retrieve the text of the first "em" element and invoke the "hasChildNodes()" method. It + should return false. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-810594187 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodehaschildnodesfalse() { + var success; + if(checkInitialization(builder, "hc_nodehaschildnodesfalse") != null) return; + var doc; + var emList; + var emNode; + var emText; + var hasChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + emList = doc.getElementsByTagName("em"); + emNode = emList.item(0); + emText = emNode.firstChild; + + hasChild = emText.hasChildNodes(); + assertFalse("hasChild",hasChild); + +} + + + + +function runTest() { + hc_nodehaschildnodesfalse(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml new file mode 100644 index 0000000..0ea44a2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodehaschildnodesfalse.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore-expected.txt new file mode 100644 index 0000000..2df0b5b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbefore +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.js new file mode 100644 index 0000000..f73bd6d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.js @@ -0,0 +1,153 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbefore"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertBefore(newChild,refChild)" method inserts the + node "newChild" before the node "refChild". + + Insert a newly created Element node before the second + sup element in the document and check the "newChild" + and "refChild" after insertion for correct placement. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=261 +*/ +function hc_nodeinsertbefore() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbefore") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var refChild; + var newChild; + var child; + var childName; + var insertedNode; + var actual = new Array(); + + expected = new Array(); + expected[0] = "em"; + expected[1] = "strong"; + expected[2] = "code"; + expected[3] = "br"; + expected[4] = "sup"; + expected[5] = "var"; + expected[6] = "acronym"; + + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("sup"); + refChild = elementList.item(2); + employeeNode = refChild.parentNode; + + childList = employeeNode.childNodes; + + newChild = doc.createElement("br"); + insertedNode = employeeNode.insertBefore(newChild,refChild); + for(var indexN10091 = 0;indexN10091 < childList.length; indexN10091++) { + child = childList.item(indexN10091); + nodeType = child.nodeType; + + + if( + (1 == nodeType) + ) { + childName = child.nodeName; + + actual[actual.length] = childName; + + } + + } + assertEqualsListAutoCase("element", "nodeNames",expected,actual); + +} + + + + +function runTest() { + hc_nodeinsertbefore(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.xhtml new file mode 100644 index 0000000..9093844 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbefore.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt new file mode 100644 index 0000000..1eaa27b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforedocfragment +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js new file mode 100644 index 0000000..1e132c9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.js @@ -0,0 +1,141 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforedocfragment"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "newChild" is a DocumentFragment object then all + its children are inserted in the same order before the + the "refChild". + + Create a DocumentFragment object and populate it with + two Element nodes. Retrieve the second employee and + insert the newly created DocumentFragment before its + fourth child. The second employee should now have two + extra children("newChild1" and "newChild2") at + positions fourth and fifth respectively. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeinsertbeforedocfragment() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforedocfragment") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var refChild; + var newdocFragment; + var newChild1; + var newChild2; + var child; + var childName; + var appendedChild; + var insertedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + refChild = childList.item(3); + newdocFragment = doc.createDocumentFragment(); + newChild1 = doc.createElement("br"); + newChild2 = doc.createElement("b"); + appendedChild = newdocFragment.appendChild(newChild1); + appendedChild = newdocFragment.appendChild(newChild2); + insertedNode = employeeNode.insertBefore(newdocFragment,refChild); + child = childList.item(3); + childName = child.nodeName; + + assertEqualsAutoCase("element", "childName3","br",childName); + child = childList.item(4); + childName = child.nodeName; + + assertEqualsAutoCase("element", "childName4","b",childName); + +} + + + + +function runTest() { + hc_nodeinsertbeforedocfragment(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml new file mode 100644 index 0000000..a76c650 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforedocfragment.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt new file mode 100644 index 0000000..cd2ebc0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforeinvalidnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js new file mode 100644 index 0000000..e467f33 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.js @@ -0,0 +1,136 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforeinvalidnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertBefore(newChild,refChild)" method raises a + HIERARCHY_REQUEST_ERR DOMException if this node is of + a type that does not allow children of the type "newChild" + to be inserted. + + Retrieve the root node and attempt to insert a newly + created Attr node. An Element node cannot have children + of the "Attr" type, therefore the desired exception + should be raised. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=406 +*/ +function hc_nodeinsertbeforeinvalidnodetype() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforeinvalidnodetype") != null) return; + var doc; + var rootNode; + var newChild; + var elementList; + var refChild; + var insertedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.createAttribute("title"); + elementList = doc.getElementsByTagName("p"); + refChild = elementList.item(1); + rootNode = refChild.parentNode; + + + { + success = false; + try { + insertedNode = rootNode.insertBefore(newChild,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeinsertbeforeinvalidnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml new file mode 100644 index 0000000..22834b4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforeinvalidnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt new file mode 100644 index 0000000..8a0549a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument +Status failure +Message throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js new file mode 100644 index 0000000..915104f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js @@ -0,0 +1,147 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchilddiffdocument"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + docsLoaded += preload(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + docsLoaded += preload(doc2Ref, "doc2", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertBefore(newChild,refChild)" method raises a + WRONG_DOCUMENT_ERR DOMException if the "newChild" was + created from a different document than the one that + created this node. + + Retrieve the second employee and attempt to insert a new + child that was created from a different document than the + one that created the second employee. An attempt to + insert such a child should raise the desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='WRONG_DOCUMENT_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeinsertbeforenewchilddiffdocument() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforenewchilddiffdocument") != null) return; + var doc1; + var doc2; + var refChild; + var newChild; + var elementList; + var elementNode; + var insertedNode; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + doc1 = load(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + doc2 = load(doc2Ref, "doc2", "hc_staff"); + newChild = doc1.createElement("br"); + elementList = doc2.getElementsByTagName("p"); + elementNode = elementList.item(1); + refChild = elementNode.firstChild; + + + { + success = false; + try { + insertedNode = elementNode.insertBefore(newChild,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeinsertbeforenewchilddiffdocument(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml new file mode 100644 index 0000000..9821966 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchilddiffdocument.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt new file mode 100644 index 0000000..4957e4a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchildexists +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js new file mode 100644 index 0000000..f7adaff --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.js @@ -0,0 +1,151 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenewchildexists"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "newChild" is already in the tree, the + "insertBefore(newChild,refChild)" method must first + remove it before the insertion takes place. + + Insert a node Element ("em") that is already + present in the tree. The existing node should be + removed first and the new one inserted. The node is + inserted at a different position in the tree to assure + that it was indeed inserted. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodeinsertbeforenewchildexists() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforenewchildexists") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var refChild; + var newChild; + var child; + var childName; + var insertedNode; + expected = new Array(); + expected[0] = "strong"; + expected[1] = "code"; + expected[2] = "sup"; + expected[3] = "var"; + expected[4] = "em"; + expected[5] = "acronym"; + + var result = new Array(); + + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.getElementsByTagName("*"); + refChild = childList.item(5); + newChild = childList.item(0); + insertedNode = employeeNode.insertBefore(newChild,refChild); + for(var indexN1008C = 0;indexN1008C < childList.length; indexN1008C++) { + child = childList.item(indexN1008C); + nodeType = child.nodeType; + + + if( + (1 == nodeType) + ) { + childName = child.nodeName; + + result[result.length] = childName; + + } + + } + assertEqualsListAutoCase("element", "childNames",expected,result); + +} + + + + +function runTest() { + hc_nodeinsertbeforenewchildexists(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml new file mode 100644 index 0000000..05db0e0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenewchildexists.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt new file mode 100644 index 0000000..b45fc67 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodeancestor +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js new file mode 100644 index 0000000..cd7c956 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.js @@ -0,0 +1,135 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodeancestor"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertBefore(newChild,refChild)" method raises a + HIERARCHY_REQUEST_ERR DOMException if the node to be + inserted is one of this nodes ancestors. + + Retrieve the second employee and attempt to insert a + node that is one of its ancestors(root node). An + attempt to insert such a node should raise the + desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +*/ +function hc_nodeinsertbeforenodeancestor() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforenodeancestor") != null) return; + var doc; + var newChild; + var elementList; + var employeeNode; + var childList; + var refChild; + var insertedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.documentElement; + + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + refChild = childList.item(0); + + { + success = false; + try { + insertedNode = employeeNode.insertBefore(newChild,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeinsertbeforenodeancestor(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml new file mode 100644 index 0000000..2541847 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodeancestor.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt new file mode 100644 index 0000000..388fc85 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.js new file mode 100644 index 0000000..eeb61c8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforenodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertBefore(newChild,refchild)" method returns + the node being inserted. + + Insert an Element node before the fourth + child of the second employee and check the node + returned from the "insertBefore(newChild,refChild)" + method. The node returned should be "newChild". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeinsertbeforenodename() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforenodename") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var refChild; + var newChild; + var insertedNode; + var childName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + refChild = childList.item(3); + newChild = doc.createElement("br"); + insertedNode = employeeNode.insertBefore(newChild,refChild); + childName = insertedNode.nodeName; + + assertEqualsAutoCase("element", "nodeName","br",childName); + +} + + + + +function runTest() { + hc_nodeinsertbeforenodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml new file mode 100644 index 0000000..430f818 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforenodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt new file mode 100644 index 0000000..93f63cf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnonexistent +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js new file mode 100644 index 0000000..d4c8f3e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnonexistent"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "insertBefore(newChild,refChild)" method raises a + NOT_FOUND_ERR DOMException if the reference child is + not a child of this node. + + Retrieve the second employee and attempt to insert a + new node before a reference node that is not a child + of this node. An attempt to insert before a non child + node should raise the desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-952280727')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_nodeinsertbeforerefchildnonexistent() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforerefchildnonexistent") != null) return; + var doc; + var refChild; + var newChild; + var elementList; + var elementNode; + var insertedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.createElement("br"); + refChild = doc.createElement("b"); + elementList = doc.getElementsByTagName("p"); + elementNode = elementList.item(1); + + { + success = false; + try { + insertedNode = elementNode.insertBefore(newChild,refChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 8); + } + assertTrue("throw_NOT_FOUND_ERR",success); + } + +} + + + + +function runTest() { + hc_nodeinsertbeforerefchildnonexistent(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml new file mode 100644 index 0000000..bbdcf3b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnonexistent.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt new file mode 100644 index 0000000..568ea26 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js new file mode 100644 index 0000000..a0bf5e4 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeinsertbeforerefchildnull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "refChild" is null then the + "insertBefore(newChild,refChild)" method inserts the + node "newChild" at the end of the list of children. + + Retrieve the second employee and invoke the + "insertBefore(newChild,refChild)" method with + refChild=null. Since "refChild" is null the "newChild" + should be added to the end of the list. The last item + in the list is checked after insertion. The last Element + node of the list should be "newChild". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-952280727 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeinsertbeforerefchildnull() { + var success; + if(checkInitialization(builder, "hc_nodeinsertbeforerefchildnull") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var refChild = null; + + var newChild; + var child; + var childName; + var insertedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + newChild = doc.createElement("br"); + insertedNode = employeeNode.insertBefore(newChild,refChild); + child = employeeNode.lastChild; + + childName = child.nodeName; + + assertEqualsAutoCase("element", "nodeName","br",childName); + +} + + + + +function runTest() { + hc_nodeinsertbeforerefchildnull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml new file mode 100644 index 0000000..2e3164b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeinsertbeforerefchildnull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt new file mode 100644 index 0000000..f332eea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexequalzero +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.js new file mode 100644 index 0000000..eff64d9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.js @@ -0,0 +1,135 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexequalzero"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Create a list of all the children elements of the third + employee and access its first child by using an index + of 0. This should result in the whitspace before "em" being + selected (em when ignoring whitespace). + Further we evaluate its content(by using + the "getNodeName()" method) to ensure the proper + element was accessed. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelistindexequalzero() { + var success; + if(checkInitialization(builder, "hc_nodelistindexequalzero") != null) return; + var doc; + var elementList; + var employeeNode; + var employeeList; + var child; + var childName; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + employeeList = employeeNode.childNodes; + + length = employeeList.length; + + child = employeeList.item(0); + childName = child.nodeName; + + + if( + (13 == length) + ) { + assertEquals("childName_w_whitespace","#text",childName); + + } + + else { + assertEqualsAutoCase("element", "childName_wo_whitespace","em",childName); + + } + +} + + + + +function runTest() { + hc_nodelistindexequalzero(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.xhtml new file mode 100644 index 0000000..c9a79ea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexequalzero.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt new file mode 100644 index 0000000..0f1a979 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlength +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.js new file mode 100644 index 0000000..d169a62 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlength"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getLength()" method returns the number of nodes + in the list. + + Create a list of all the children elements of the third + employee and invoke the "getLength()" method. + It should contain the value 13. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelistindexgetlength() { + var success; + if(checkInitialization(builder, "hc_nodelistindexgetlength") != null) return; + var doc; + var elementList; + var employeeNode; + var employeeList; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + employeeList = employeeNode.childNodes; + + length = employeeList.length; + + + if( + (6 == length) + ) { + assertEquals("length_wo_space",6,length); + + } + + else { + assertEquals("length_w_space",13,length); + + } + +} + + + + +function runTest() { + hc_nodelistindexgetlength(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.xhtml new file mode 100644 index 0000000..e1924a6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlength.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt new file mode 100644 index 0000000..6207f0e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlengthofemptylist +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js new file mode 100644 index 0000000..9ae4969 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexgetlengthofemptylist"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getLength()" method returns the number of nodes + in the list.(Test for EMPTY list) + + Create a list of all the children of the Text node + inside the first child of the third employee and + invoke the "getLength()" method. It should contain + the value 0. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelistindexgetlengthofemptylist() { + var success; + if(checkInitialization(builder, "hc_nodelistindexgetlengthofemptylist") != null) return; + var doc; + var emList; + var emNode; + var textNode; + var textList; + var length; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + emList = doc.getElementsByTagName("em"); + emNode = emList.item(2); + textNode = emNode.firstChild; + + textList = textNode.childNodes; + + length = textList.length; + + assertEquals("length",0,length); + +} + + + + +function runTest() { + hc_nodelistindexgetlengthofemptylist(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml new file mode 100644 index 0000000..ab029ba --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexgetlengthofemptylist.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt new file mode 100644 index 0000000..1574b46 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexnotzero +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.js new file mode 100644 index 0000000..8976e02 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistindexnotzero"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The items in the list are accessible via an integral + index starting from zero. + (Index not equal 0) + + Create a list of all the children elements of the third + employee and access its fourth child by using an index + of 3 and calling getNodeName() which should return + "strong" (no whitespace) or "#text" (with whitespace). + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelistindexnotzero() { + var success; + if(checkInitialization(builder, "hc_nodelistindexnotzero") != null) return; + var doc; + var elementList; + var employeeNode; + var employeeList; + var child; + var childName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + employeeList = employeeNode.childNodes; + + child = employeeList.item(3); + childName = child.nodeName; + + + if( + ("#text" == childName) + ) { + assertEquals("childName_space","#text",childName); + + } + + else { + assertEqualsAutoCase("element", "childName_strong","strong",childName); + + } + +} + + + + +function runTest() { + hc_nodelistindexnotzero(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.xhtml new file mode 100644 index 0000000..6bdb780 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistindexnotzero.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt new file mode 100644 index 0000000..219e4b5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnfirstitem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.js new file mode 100644 index 0000000..117be61 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnfirstitem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Create a list of all the children elements of the third + employee and access its first child by invoking the + "item(index)" method with an index=0. This should + result in node with a nodeName of "#text" or "em". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelistreturnfirstitem() { + var success; + if(checkInitialization(builder, "hc_nodelistreturnfirstitem") != null) return; + var doc; + var elementList; + var employeeNode; + var employeeList; + var child; + var childName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + employeeList = employeeNode.childNodes; + + child = employeeList.item(0); + childName = child.nodeName; + + + if( + ("#text" == childName) + ) { + assertEquals("nodeName_w_space","#text",childName); + + } + + else { + assertEqualsAutoCase("element", "nodeName_wo_space","em",childName); + + } + +} + + + + +function runTest() { + hc_nodelistreturnfirstitem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml new file mode 100644 index 0000000..bd78273 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnfirstitem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt new file mode 100644 index 0000000..135ee72 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnlastitem +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.js new file mode 100644 index 0000000..b6652fe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelistreturnlastitem"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Create a list of all the children elements of the third + employee and access its last child by invoking the + "item(index)" method with an index=length-1. This should + result in node with nodeName="#text" or acronym. +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelistreturnlastitem() { + var success; + if(checkInitialization(builder, "hc_nodelistreturnlastitem") != null) return; + var doc; + var elementList; + var employeeNode; + var employeeList; + var child; + var childName; + var index; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + employeeList = employeeNode.childNodes; + + index = employeeList.length; + + index -= 1; +child = employeeList.item(index); + childName = child.nodeName; + + + if( + (12 == index) + ) { + assertEquals("lastNodeName_w_whitespace","#text",childName); + + } + + else { + assertEqualsAutoCase("element", "lastNodeName","acronym",childName); + assertEquals("index",5,index); + + } + +} + + + + +function runTest() { + hc_nodelistreturnlastitem(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml new file mode 100644 index 0000000..d6f6d4d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelistreturnlastitem.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist-expected.txt new file mode 100644 index 0000000..491f8e9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelisttraverselist +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.js b/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.js new file mode 100644 index 0000000..dc6862b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.js @@ -0,0 +1,149 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodelisttraverselist"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The range of valid child node indices is 0 thru length -1 + + Create a list of all the children elements of the third + employee and traverse the list from index=0 thru + length -1. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-203510337 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-844377136 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodelisttraverselist() { + var success; + if(checkInitialization(builder, "hc_nodelisttraverselist") != null) return; + var doc; + var elementList; + var employeeNode; + var employeeList; + var child; + var childName; + var nodeType; + var result = new Array(); + + expected = new Array(); + expected[0] = "em"; + expected[1] = "strong"; + expected[2] = "code"; + expected[3] = "sup"; + expected[4] = "var"; + expected[5] = "acronym"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(2); + employeeList = employeeNode.childNodes; + + for(var indexN10073 = 0;indexN10073 < employeeList.length; indexN10073++) { + child = employeeList.item(indexN10073); + nodeType = child.nodeType; + + childName = child.nodeName; + + + if( + (1 == nodeType) + ) { + result[result.length] = childName; + + } + + else { + assertEquals("textNodeType",3,nodeType); + assertEquals("textNodeName","#text",childName); + + } + + } + assertEqualsListAutoCase("element", "nodeNames",expected,result); + +} + + + + +function runTest() { + hc_nodelisttraverselist(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.xhtml new file mode 100644 index 0000000..6744275 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodelisttraverselist.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode-expected.txt new file mode 100644 index 0000000..98d175f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.js new file mode 100644 index 0000000..e3408f6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.js @@ -0,0 +1,117 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getParentNode()" method returns the parent + of this node. + + Retrieve the second employee and invoke the + "getParentNode()" method on this node. It should + be set to "body". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +*/ +function hc_nodeparentnode() { + var success; + if(checkInitialization(builder, "hc_nodeparentnode") != null) return; + var doc; + var elementList; + var employeeNode; + var parentNode; + var parentName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + parentNode = employeeNode.parentNode; + + parentName = parentNode.nodeName; + + assertEqualsAutoCase("element", "parentNodeName","body",parentName); + +} + + + + +function runTest() { + hc_nodeparentnode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.xhtml new file mode 100644 index 0000000..e80e740 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull-expected.txt new file mode 100644 index 0000000..32434d8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnodenull +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.js b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.js new file mode 100644 index 0000000..9c80de3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodeparentnodenull"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "getParentNode()" method invoked on a node that has + just been created and not yet added to the tree is null. + + Create a new "employee" Element node using the + "createElement(name)" method from the Document interface. + Since this new node has not yet been added to the tree, + the "getParentNode()" method will return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodeparentnodenull() { + var success; + if(checkInitialization(builder, "hc_nodeparentnodenull") != null) return; + var doc; + var createdNode; + var parentNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + createdNode = doc.createElement("br"); + parentNode = createdNode.parentNode; + + assertNull("parentNode",parentNode); + +} + + + + +function runTest() { + hc_nodeparentnodenull(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.xhtml new file mode 100644 index 0000000..3c7363b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodeparentnodenull.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild-expected.txt new file mode 100644 index 0000000..398bffe --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.js b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.js new file mode 100644 index 0000000..6db1b6a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeChild(oldChild)" method removes the child node + indicated by "oldChild" from the list of children and + returns it. + + Remove the first employee by invoking the + "removeChild(oldChild)" method an checking the + node returned by the "getParentNode()" method. It + should be set to null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_noderemovechild() { + var success; + if(checkInitialization(builder, "hc_noderemovechild") != null) return; + var doc; + var rootNode; + var childList; + var childToRemove; + var removedChild; + var parentNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + rootNode = doc.documentElement; + + childList = rootNode.childNodes; + +// +// WebKit modification: 9-October-2005 +// +// Added the next two lines of code to remove first employee as +// documented rather than removing the body element. +// Workaround while waiting for . +// + rootNode = childList.item(1); + childList = rootNode.childNodes; + + childToRemove = childList.item(1); + removedChild = rootNode.removeChild(childToRemove); + parentNode = removedChild.parentNode; + + assertNull("parentNodeNull",parentNode); + +} + + + + +function runTest() { + hc_noderemovechild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.xhtml new file mode 100644 index 0000000..df8bf08 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt new file mode 100644 index 0000000..a386341 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildgetnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.js new file mode 100644 index 0000000..d81a2a9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.js @@ -0,0 +1,128 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildgetnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeChild(oldChild)" method returns + the node being removed. + + Remove the first child of the second employee + and check the NodeName returned by the + "removeChild(oldChild)" method. The returned node + should have a NodeName equal to "#text". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_noderemovechildgetnodename() { + var success; + if(checkInitialization(builder, "hc_noderemovechildgetnodename") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var oldChild; + var removedChild; + var childName; + var oldName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + oldChild = childList.item(0); + oldName = oldChild.nodeName; + + removedChild = employeeNode.removeChild(oldChild); + assertNotNull("notnull",removedChild); +childName = removedChild.nodeName; + + assertEquals("nodeName",oldName,childName); + +} + + + + +function runTest() { + hc_noderemovechildgetnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml new file mode 100644 index 0000000..f6d68ad --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildgetnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode-expected.txt new file mode 100644 index 0000000..c2845b1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildnode +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.js b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.js new file mode 100644 index 0000000..b6cef22 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.js @@ -0,0 +1,160 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildnode"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeChild(oldChild)" method removes the node + indicated by "oldChild". + + Retrieve the second p element and remove its first child. + After the removal, the second p element should have 5 element + children and the first child should now be the child + that used to be at the second position in the list. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_noderemovechildnode() { + var success; + if(checkInitialization(builder, "hc_noderemovechildnode") != null) return; + var doc; + var elementList; + var emList; + var employeeNode; + var childList; + var oldChild; + var child; + var childName; + var length; + var removedChild; + var removedName; + var nodeType; + expected = new Array(); + expected[0] = "strong"; + expected[1] = "code"; + expected[2] = "sup"; + expected[3] = "var"; + expected[4] = "acronym"; + + var actual = new Array(); + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + emList = employeeNode.getElementsByTagName("em"); + oldChild = emList.item(0); + removedChild = employeeNode.removeChild(oldChild); + removedName = removedChild.nodeName; + + assertEqualsAutoCase("element", "removedName","em",removedName); + for(var indexN10098 = 0;indexN10098 < childList.length; indexN10098++) { + child = childList.item(indexN10098); + nodeType = child.nodeType; + + childName = child.nodeName; + + + if( + (1 == nodeType) + ) { + actual[actual.length] = childName; + + } + + else { + assertEquals("textNodeType",3,nodeType); + assertEquals("textNodeName","#text",childName); + + } + + } + assertEqualsListAutoCase("element", "childNames",expected,actual); + +} + + + + +function runTest() { + hc_noderemovechildnode(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.xhtml new file mode 100644 index 0000000..c49cba2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildnode.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt new file mode 100644 index 0000000..4b510aa --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildoldchildnonexistent +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js new file mode 100644 index 0000000..7f68dbd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.js @@ -0,0 +1,129 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_noderemovechildoldchildnonexistent"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "removeChild(oldChild)" method raises a + NOT_FOUND_ERR DOMException if the old child is + not a child of this node. + + Retrieve the second employee and attempt to remove a + node that is not one of its children. An attempt to + remove such a node should raise the desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-1734834066')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1734834066 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_noderemovechildoldchildnonexistent() { + var success; + if(checkInitialization(builder, "hc_noderemovechildoldchildnonexistent") != null) return; + var doc; + var oldChild; + var elementList; + var elementNode; + var removedChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + oldChild = doc.createElement("br"); + elementList = doc.getElementsByTagName("p"); + elementNode = elementList.item(1); + + { + success = false; + try { + removedChild = elementNode.removeChild(oldChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 8); + } + assertTrue("throw_NOT_FOUND_ERR",success); + } + +} + + + + +function runTest() { + hc_noderemovechildoldchildnonexistent(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml new file mode 100644 index 0000000..6ca8842 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_noderemovechildoldchildnonexistent.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild-expected.txt new file mode 100644 index 0000000..a18217f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechild +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.js new file mode 100644 index 0000000..db4ba3b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.js @@ -0,0 +1,127 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechild"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceChild(newChild,oldChild)" method replaces + the node "oldChild" with the node "newChild". + + Replace the first element of the second employee with + a newly created Element node. Check the first position + after the replacement operation is completed. The new + Element should be "newChild". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodereplacechild() { + var success; + if(checkInitialization(builder, "hc_nodereplacechild") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var oldChild; + var newChild; + var child; + var childName; + var replacedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + oldChild = childList.item(0); + newChild = doc.createElement("br"); + replacedNode = employeeNode.replaceChild(newChild,oldChild); + child = childList.item(0); + childName = child.nodeName; + + assertEqualsAutoCase("element", "nodeName","br",childName); + +} + + + + +function runTest() { + hc_nodereplacechild(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.xhtml new file mode 100644 index 0000000..1964cee --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechild.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt new file mode 100644 index 0000000..fa3cb86 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildinvalidnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js new file mode 100644 index 0000000..789f5cf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.js @@ -0,0 +1,136 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildinvalidnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceChild(newChild,oldChild)" method raises a + HIERARCHY_REQUEST_ERR DOMException if this node is of + a type that does not allow children of the type "newChild" + to be inserted. + + Retrieve the root node and attempt to replace + one of its children with a newly created Attr node. + An Element node cannot have children of the "Attr" + type, therefore the desired exception should be raised. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=406 +*/ +function hc_nodereplacechildinvalidnodetype() { + var success; + if(checkInitialization(builder, "hc_nodereplacechildinvalidnodetype") != null) return; + var doc; + var rootNode; + var newChild; + var elementList; + var oldChild; + var replacedChild; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.createAttribute("lang"); + elementList = doc.getElementsByTagName("p"); + oldChild = elementList.item(1); + rootNode = oldChild.parentNode; + + + { + success = false; + try { + replacedChild = rootNode.replaceChild(newChild,oldChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_nodereplacechildinvalidnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml new file mode 100644 index 0000000..09b1d94 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildinvalidnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt new file mode 100644 index 0000000..477e073 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument +Status failure +Message throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js new file mode 100644 index 0000000..23af319 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.js @@ -0,0 +1,147 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchilddiffdocument"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + docsLoaded += preload(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + docsLoaded += preload(doc2Ref, "doc2", "hc_staff"); + + if (docsLoaded == 2) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 2) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceChild(newChild,oldChild)" method raises a + WRONG_DOCUMENT_ERR DOMException if the "newChild" was + created from a different document than the one that + created this node. + + Retrieve the second employee and attempt to replace one + of its children with a node created from a different + document. An attempt to make such a replacement + should raise the desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodereplacechildnewchilddiffdocument() { + var success; + if(checkInitialization(builder, "hc_nodereplacechildnewchilddiffdocument") != null) return; + var doc1; + var doc2; + var oldChild; + var newChild; + var elementList; + var elementNode; + var replacedChild; + + var doc1Ref = null; + if (typeof(this.doc1) != 'undefined') { + doc1Ref = this.doc1; + } + doc1 = load(doc1Ref, "doc1", "hc_staff"); + + var doc2Ref = null; + if (typeof(this.doc2) != 'undefined') { + doc2Ref = this.doc2; + } + doc2 = load(doc2Ref, "doc2", "hc_staff"); + newChild = doc1.createElement("br"); + elementList = doc2.getElementsByTagName("p"); + elementNode = elementList.item(1); + oldChild = elementNode.firstChild; + + + { + success = false; + try { + replacedChild = elementNode.replaceChild(newChild,oldChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 4); + } + assertTrue("throw_WRONG_DOCUMENT_ERR",success); + } + +} + + + + +function runTest() { + hc_nodereplacechildnewchilddiffdocument(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml new file mode 100644 index 0000000..a5f4363 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchilddiffdocument.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt new file mode 100644 index 0000000..c54d6a3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchildexists +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.js new file mode 100644 index 0000000..06be50b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.js @@ -0,0 +1,155 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnewchildexists"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If the "newChild" is already in the tree, it is first + removed before the new one is added. + + Retrieve the second "p" and replace "acronym" with its "em". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=246 +*/ +function hc_nodereplacechildnewchildexists() { + var success; + if(checkInitialization(builder, "hc_nodereplacechildnewchildexists") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var oldChild = null; + + var newChild = null; + + var child; + var childName; + var childNode; + var actual = new Array(); + + expected = new Array(); + expected[0] = "strong"; + expected[1] = "code"; + expected[2] = "sup"; + expected[3] = "var"; + expected[4] = "em"; + + var replacedChild; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.getElementsByTagName("*"); + newChild = childList.item(0); + oldChild = childList.item(5); + replacedChild = employeeNode.replaceChild(newChild,oldChild); + assertSame("return_value_same",oldChild,replacedChild); +for(var indexN10094 = 0;indexN10094 < childList.length; indexN10094++) { + childNode = childList.item(indexN10094); + childName = childNode.nodeName; + + nodeType = childNode.nodeType; + + + if( + (1 == nodeType) + ) { + actual[actual.length] = childName; + + } + + else { + assertEquals("textNodeType",3,nodeType); + assertEquals("textNodeName","#text",childName); + + } + + } + assertEqualsListAutoCase("element", "childNames",expected,actual); + +} + + + + +function runTest() { + hc_nodereplacechildnewchildexists(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml new file mode 100644 index 0000000..624010b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnewchildexists.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt new file mode 100644 index 0000000..246dd3b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodeancestor +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.js new file mode 100644 index 0000000..5e7b044 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.js @@ -0,0 +1,135 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodeancestor"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceChild(newChild,oldChild)" method raises a + HIERARCHY_REQUEST_ERR DOMException if the node to put + in is one of this node's ancestors. + + Retrieve the second employee and attempt to replace + one of its children with an ancestor node(root node). + An attempt to make such a replacement should raise the + desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='HIERARCHY_REQUEST_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +*/ +function hc_nodereplacechildnodeancestor() { + var success; + if(checkInitialization(builder, "hc_nodereplacechildnodeancestor") != null) return; + var doc; + var newChild; + var elementList; + var employeeNode; + var childList; + var oldChild; + var replacedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.documentElement; + + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.childNodes; + + oldChild = childList.item(0); + + { + success = false; + try { + replacedNode = employeeNode.replaceChild(newChild,oldChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 3); + } + assertTrue("throw_HIERARCHY_REQUEST_ERR",success); + } + +} + + + + +function runTest() { + hc_nodereplacechildnodeancestor(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml new file mode 100644 index 0000000..1fa1790 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodeancestor.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt new file mode 100644 index 0000000..f623638 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.js new file mode 100644 index 0000000..baeab8a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceChild(newChild,oldChild)" method returns + the node being replaced. + + Replace the second Element of the second employee with + a newly created node Element and check the NodeName + returned by the "replaceChild(newChild,oldChild)" + method. The returned node should have a NodeName equal + to "em". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodereplacechildnodename() { + var success; + if(checkInitialization(builder, "hc_nodereplacechildnodename") != null) return; + var doc; + var elementList; + var employeeNode; + var childList; + var oldChild; + var newChild; + var replacedNode; + var childName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("p"); + employeeNode = elementList.item(1); + childList = employeeNode.getElementsByTagName("em"); + oldChild = childList.item(0); + newChild = doc.createElement("br"); + replacedNode = employeeNode.replaceChild(newChild,oldChild); + childName = replacedNode.nodeName; + + assertEqualsAutoCase("element", "replacedNodeName","em",childName); + +} + + + + +function runTest() { + hc_nodereplacechildnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.xhtml new file mode 100644 index 0000000..3c2b805 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt new file mode 100644 index 0000000..0a63f1a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildoldchildnonexistent +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js new file mode 100644 index 0000000..74ef15c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodereplacechildoldchildnonexistent"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "replaceChild(newChild,oldChild)" method raises a + NOT_FOUND_ERR DOMException if the old child is + not a child of this node. + + Retrieve the second employee and attempt to replace a + node that is not one of its children. An attempt to + replace such a node should raise the desired exception. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-785887307')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NOT_FOUND_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-785887307 +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=247 +*/ +function hc_nodereplacechildoldchildnonexistent() { + var success; + if(checkInitialization(builder, "hc_nodereplacechildoldchildnonexistent") != null) return; + var doc; + var oldChild; + var newChild; + var elementList; + var elementNode; + var replacedNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newChild = doc.createElement("br"); + oldChild = doc.createElement("b"); + elementList = doc.getElementsByTagName("p"); + elementNode = elementList.item(1); + + { + success = false; + try { + replacedNode = elementNode.replaceChild(newChild,oldChild); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 8); + } + assertTrue("throw_NOT_FOUND_ERR",success); + } + +} + + + + +function runTest() { + hc_nodereplacechildoldchildnonexistent(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml new file mode 100644 index 0000000..1d327d3 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodereplacechildoldchildnonexistent.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt new file mode 100644 index 0000000..a49d493 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodeattribute +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.js b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.js new file mode 100644 index 0000000..fd1f751 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodeattribute"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +The "getAttributes()" method invoked on a Text +Node returns null. + +Retrieve the Text node from the last child of the +first employee and invoke the "getAttributes()" method +on the Text Node. It should return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-84CF096 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772 +*/ +function hc_nodetextnodeattribute() { + var success; + if(checkInitialization(builder, "hc_nodetextnodeattribute") != null) return; + var doc; + var elementList; + var testAddr; + var textNode; + var attrList; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + textNode = testAddr.firstChild; + + attrList = textNode.attributes; + + assertNull("text_attributes_is_null",attrList); + +} + + + + +function runTest() { + hc_nodetextnodeattribute(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.xhtml new file mode 100644 index 0000000..cb7a8db --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodeattribute.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename-expected.txt new file mode 100644 index 0000000..aa387f1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodename +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.js b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.js new file mode 100644 index 0000000..bad6607 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.js @@ -0,0 +1,113 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodename"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeName()" method for a + Text Node is "#text". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D095 +*/ +function hc_nodetextnodename() { + var success; + if(checkInitialization(builder, "hc_nodetextnodename") != null) return; + var doc; + var elementList; + var testAddr; + var textNode; + var textName; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + textNode = testAddr.firstChild; + + textName = textNode.nodeName; + + assertEquals("textNodeName","#text",textName); + +} + + + + +function runTest() { + hc_nodetextnodename(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.xhtml new file mode 100644 index 0000000..e281a7b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodename.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype-expected.txt new file mode 100644 index 0000000..ade4ce6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodetype +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.js b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.js new file mode 100644 index 0000000..43c358d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodetype"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + + The "getNodeType()" method for a Text Node + + returns the constant value 3. + + + + Retrieve the Text node from the last child of + + the first employee and invoke the "getNodeType()" + + method. The method should return 3. + + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-111237558 +*/ +function hc_nodetextnodetype() { + var success; + if(checkInitialization(builder, "hc_nodetextnodetype") != null) return; + var doc; + var elementList; + var testAddr; + var textNode; + var nodeType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + textNode = testAddr.firstChild; + + nodeType = textNode.nodeType; + + assertEquals("nodeTextNodeTypeAssert1",3,nodeType); + +} + + + + +function runTest() { + hc_nodetextnodetype(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.xhtml new file mode 100644 index 0000000..927c8f2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodetype.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue-expected.txt new file mode 100644 index 0000000..ae6d76e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodevalue +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.js b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.js new file mode 100644 index 0000000..1a1ec4b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.js @@ -0,0 +1,118 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodetextnodevalue"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The string returned by the "getNodeValue()" method for a + Text Node is the content of the Text node. + + Retrieve the Text node from the last child of the first + employee and check the string returned by the + "getNodeValue()" method. It should be equal to + "1230 North Ave. Dallas, Texas 98551". + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ +function hc_nodetextnodevalue() { + var success; + if(checkInitialization(builder, "hc_nodetextnodevalue") != null) return; + var doc; + var elementList; + var testAddr; + var textNode; + var textValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + testAddr = elementList.item(0); + textNode = testAddr.firstChild; + + textValue = textNode.nodeValue; + + assertEquals("textNodeValue","1230 North Ave. Dallas, Texas 98551",textValue); + +} + + + + +function runTest() { + hc_nodetextnodevalue(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.xhtml new file mode 100644 index 0000000..46b5b29 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodetextnodevalue.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01-expected.txt new file mode 100644 index 0000000..b8b40b8 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue01 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.js new file mode 100644 index 0000000..c632b22 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue01"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An element is created, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ +function hc_nodevalue01() { + var success; + if(checkInitialization(builder, "hc_nodevalue01") != null) return; + var doc; + var newNode; + var newValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newNode = doc.createElement("acronym"); + newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + +} + + + + +function runTest() { + hc_nodevalue01(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.xhtml new file mode 100644 index 0000000..cea27d2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue01.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02-expected.txt new file mode 100644 index 0000000..cb2535a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue02 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.js new file mode 100644 index 0000000..80682b9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue02"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An comment is created, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1728279322 +*/ +function hc_nodevalue02() { + var success; + if(checkInitialization(builder, "hc_nodevalue02") != null) return; + var doc; + var newNode; + var newValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newNode = doc.createComment("This is a new Comment node"); + newValue = newNode.nodeValue; + + assertEquals("initial","This is a new Comment node",newValue); + newNode.nodeValue = "This should have an effect"; + + newValue = newNode.nodeValue; + + assertEquals("afterChange","This should have an effect",newValue); + +} + + + + +function runTest() { + hc_nodevalue02(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.xhtml new file mode 100644 index 0000000..d479f49 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue02.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03-expected.txt new file mode 100644 index 0000000..63033db --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue03 +Status error +Message Error: NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7 diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.js new file mode 100644 index 0000000..e61671a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.js @@ -0,0 +1,138 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue03"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An entity reference is created, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490 +*/ +function hc_nodevalue03() { + var success; + if(checkInitialization(builder, "hc_nodevalue03") != null) return; + var doc; + var newNode; + var newValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + + if( + + (builder.contentType == "text/html") + + ) { + + { + success = false; + try { + newNode = doc.createEntityReference("ent1"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 9); + } + assertTrue("throw_NOT_SUPPORTED_ERR",success); + } + + } + + else { + newNode = doc.createEntityReference("ent1"); + assertNotNull("createdEntRefNotNull",newNode); +newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + + } + +} + + + + +function runTest() { + hc_nodevalue03(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.xhtml new file mode 100644 index 0000000..127651e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue03.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04-expected.txt new file mode 100644 index 0000000..f831754 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue04 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.js new file mode 100644 index 0000000..40ceb64 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.js @@ -0,0 +1,132 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue04"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An document type accessed, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31 +*/ +function hc_nodevalue04() { + var success; + if(checkInitialization(builder, "hc_nodevalue04") != null) return; + var doc; + var newNode; + var newValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newNode = doc.doctype; + + assertTrue("docTypeNotNullOrDocIsHTML", + + ( + (newNode != null) + || + (builder.contentType == "text/html") +) +); + + if( + + (newNode != null) + + ) { + assertNotNull("docTypeNotNull",newNode); +newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + + } + +} + + + + +function runTest() { + hc_nodevalue04(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.xhtml new file mode 100644 index 0000000..0b60296 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue04.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05-expected.txt new file mode 100644 index 0000000..5dfff02 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue05 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.js new file mode 100644 index 0000000..34e2e33 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.js @@ -0,0 +1,114 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue05"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +A document fragment is created, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A3 +*/ +function hc_nodevalue05() { + var success; + if(checkInitialization(builder, "hc_nodevalue05") != null) return; + var doc; + var newNode; + var newValue; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + newNode = doc.createDocumentFragment(); + newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + +} + + + + +function runTest() { + hc_nodevalue05(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.xhtml new file mode 100644 index 0000000..b04cbb7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue05.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06-expected.txt new file mode 100644 index 0000000..b7cb6bb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue06 +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.js new file mode 100644 index 0000000..6cb9ac7 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.js @@ -0,0 +1,112 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue06"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var newNodeRef = null; + if (typeof(this.newNode) != 'undefined') { + newNodeRef = this.newNode; + } + docsLoaded += preload(newNodeRef, "newNode", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An document is accessed, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#i-Document +*/ +function hc_nodevalue06() { + var success; + if(checkInitialization(builder, "hc_nodevalue06") != null) return; + var newNode; + var newValue; + + var newNodeRef = null; + if (typeof(this.newNode) != 'undefined') { + newNodeRef = this.newNode; + } + newNode = load(newNodeRef, "newNode", "hc_staff"); + newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + +} + + + + +function runTest() { + hc_nodevalue06(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.xhtml new file mode 100644 index 0000000..5b7076c --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue06.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07-expected.txt new file mode 100644 index 0000000..e372408 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue07 +Status failure +Message entitiesNotNull: assertNotNull failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.js new file mode 100644 index 0000000..867a682 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.js @@ -0,0 +1,134 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue07"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An Entity is accessed, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-527DCFF2 +*/ +function hc_nodevalue07() { + var success; + if(checkInitialization(builder, "hc_nodevalue07") != null) return; + var doc; + var newNode; + var newValue; + var nodeMap; + var docType; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); +nodeMap = docType.entities; + + assertNotNull("entitiesNotNull",nodeMap); +newNode = nodeMap.getNamedItem("alpha"); + assertNotNull("entityNotNull",newNode); +newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + + } + +} + + + + +function runTest() { + hc_nodevalue07(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.xhtml new file mode 100644 index 0000000..9585159 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue07.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08-expected.txt new file mode 100644 index 0000000..491bb8f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue08 +Status failure +Message notationsNotNull: assertNotNull failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.js b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.js new file mode 100644 index 0000000..6bbab84 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.js @@ -0,0 +1,134 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue08"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An notation is accessed, setNodeValue is called with a non-null argument, but getNodeValue +should still return null. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-5431D1B9 +*/ +function hc_nodevalue08() { + var success; + if(checkInitialization(builder, "hc_nodevalue08") != null) return; + var doc; + var docType; + var newNode; + var newValue; + var nodeMap; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); +nodeMap = docType.notations; + + assertNotNull("notationsNotNull",nodeMap); +newNode = nodeMap.getNamedItem("notation1"); + assertNotNull("notationNotNull",newNode); +newValue = newNode.nodeValue; + + assertNull("initiallyNull",newValue); + newNode.nodeValue = "This should have no effect"; + + newValue = newNode.nodeValue; + + assertNull("nullAfterAttemptedChange",newValue); + + } + +} + + + + +function runTest() { + hc_nodevalue08(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.xhtml new file mode 100644 index 0000000..bc319ea --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_nodevalue08.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1-expected.txt new file mode 100644 index 0000000..8f3226d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationsremovenameditem1 +Status failure +Message notationsNotNull: assertNotNull failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.js b/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.js new file mode 100644 index 0000000..28d3cc6 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.js @@ -0,0 +1,133 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationsremovenameditem1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An attempt to add remove an notation should result in a NO_MODIFICATION_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193 +*/ +function hc_notationsremovenameditem1() { + var success; + if(checkInitialization(builder, "hc_notationsremovenameditem1") != null) return; + var doc; + var notations; + var docType; + var retval; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); +notations = docType.notations; + + assertNotNull("notationsNotNull",notations); + + { + success = false; + try { + retval = notations.removeNamedItem("notation1"); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 7); + } + assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success); + } + + } + +} + + + + +function runTest() { + hc_notationsremovenameditem1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.xhtml new file mode 100644 index 0000000..f8f6b71 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_notationsremovenameditem1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1-expected.txt new file mode 100644 index 0000000..bbf8686 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1-expected.txt @@ -0,0 +1,3 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationssetnameditem1 +Status failure +Message notationsNotNull: assertNotNull failed diff --git a/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.js b/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.js new file mode 100644 index 0000000..0ae1333 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.js @@ -0,0 +1,144 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationssetnameditem1"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + checkFeature("XML", null); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* +An attempt to add an element to the named node map returned by notations should +result in a NO_MODIFICATION_ERR or HIERARCHY_REQUEST_ERR. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D46829EF +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1025163788 +*/ +function hc_notationssetnameditem1() { + var success; + if(checkInitialization(builder, "hc_notationssetnameditem1") != null) return; + var doc; + var notations; + var docType; + var retval; + var elem; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + docType = doc.doctype; + + + if( + + !( + (builder.contentType == "text/html") +) + + ) { + assertNotNull("docTypeNotNull",docType); +notations = docType.notations; + + assertNotNull("notationsNotNull",notations); +elem = doc.createElement("br"); + + try { + retval = notations.setNamedItem(elem); + fail("throw_HIER_OR_NO_MOD_ERR"); + + } catch (ex) { + if (typeof(ex.code) != 'undefined') { + switch(ex.code) { + case /* HIERARCHY_REQUEST_ERR */ 3 : + break; + case /* NO_MODIFICATION_ALLOWED_ERR */ 7 : + break; + default: + throw ex; + } + } else { + throw ex; + } + } + + } + +} + + + + +function runTest() { + hc_notationssetnameditem1(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.xhtml new file mode 100644 index 0000000..19021dd --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_notationssetnameditem1.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt new file mode 100644 index 0000000..a11b8ca --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerrnegativeoffset +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js new file mode 100644 index 0000000..965648b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.js @@ -0,0 +1,130 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerrnegativeoffset"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + setImplementationAttribute("signed", true); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "splitText(offset)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset is + negative. + + Retrieve the textual data from the second child of the + third employee and invoke the "splitText(offset)" method. + The desired exception should be raised since the offset + is a negative number. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +*/ +function hc_textindexsizeerrnegativeoffset() { + var success; + if(checkInitialization(builder, "hc_textindexsizeerrnegativeoffset") != null) return; + var doc; + var elementList; + var nameNode; + var textNode; + var splitNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(2); + textNode = nameNode.firstChild; + + + { + success = false; + try { + splitNode = textNode.splitText(-69); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throws_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_textindexsizeerrnegativeoffset(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml new file mode 100644 index 0000000..7d6c078 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerrnegativeoffset.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt new file mode 100644 index 0000000..a6050fb --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerroffsetoutofbounds +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js new file mode 100644 index 0000000..170d435 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.js @@ -0,0 +1,131 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textindexsizeerroffsetoutofbounds"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "splitText(offset)" method raises an + INDEX_SIZE_ERR DOMException if the specified offset is + greater than the number of characters in the Text node. + + Retrieve the textual data from the second child of the + third employee and invoke the "splitText(offset)" method. + The desired exception should be raised since the offset + is a greater than the number of characters in the Text + node. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INDEX_SIZE_ERR']) +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-38853C1D')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INDEX_SIZE_ERR']) +* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249 +*/ +function hc_textindexsizeerroffsetoutofbounds() { + var success; + if(checkInitialization(builder, "hc_textindexsizeerroffsetoutofbounds") != null) return; + var doc; + var elementList; + var nameNode; + var textNode; + var splitNode; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(2); + textNode = nameNode.firstChild; + + + { + success = false; + try { + splitNode = textNode.splitText(300); + } + catch(ex) { + success = (typeof(ex.code) != 'undefined' && ex.code == 1); + } + assertTrue("throw_INDEX_SIZE_ERR",success); + } + +} + + + + +function runTest() { + hc_textindexsizeerroffsetoutofbounds(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml new file mode 100644 index 0000000..3710d87 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textindexsizeerroffsetoutofbounds.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements-expected.txt new file mode 100644 index 0000000..fd2c1c0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textparseintolistofelements +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.js b/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.js new file mode 100644 index 0000000..71d362f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.js @@ -0,0 +1,169 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textparseintolistofelements"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + Retrieve the textual data from the last child of the + second employee. That node is composed of two + EntityReference nodes and two Text nodes. After + the content node is parsed, the "acronym" Element + should contain four children with each one of the + EntityReferences containing one child. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1451460987 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-11C98490 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-745549614 +*/ +function hc_textparseintolistofelements() { + var success; + if(checkInitialization(builder, "hc_textparseintolistofelements") != null) return; + var doc; + var elementList; + var addressNode; + var childList; + var child; + var value; + var grandChild; + var length; + var result = new Array(); + + expectedNormal = new Array(); + expectedNormal[0] = "β"; + expectedNormal[1] = " Dallas, "; + expectedNormal[2] = "γ"; + expectedNormal[3] = "\n 98554"; + + expectedExpanded = new Array(); + expectedExpanded[0] = "β Dallas, γ\n 98554"; + + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + addressNode = elementList.item(1); + childList = addressNode.childNodes; + + length = childList.length; + + for(var indexN1007C = 0;indexN1007C < childList.length; indexN1007C++) { + child = childList.item(indexN1007C); + value = child.nodeValue; + + + if( + + (value == null) + + ) { + grandChild = child.firstChild; + + assertNotNull("grandChildNotNull",grandChild); +value = grandChild.nodeValue; + + result[result.length] = value; + + } + + else { + result[result.length] = value; + + } + + } + + if( + (1 == length) + ) { + assertEqualsList("assertEqCoalescing",expectedExpanded,result); + + } + + else { + assertEqualsList("assertEqNormal",expectedNormal,result); + + } + +} + + + + +function runTest() { + hc_textparseintolistofelements(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.xhtml new file mode 100644 index 0000000..e5ac1dc --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textparseintolistofelements.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour-expected.txt new file mode 100644 index 0000000..c65b89b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextfour +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.js b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.js new file mode 100644 index 0000000..ece64c2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextfour"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "splitText(offset)" method returns the new Text node. + + Retrieve the textual data from the last child of the + first employee and invoke the "splitText(offset)" method. + The method should return the new Text node. The offset + value used for this test is 30. The "getNodeValue()" + method is called to check that the new node now contains + the characters at and after position 30. + (Starting count at 0) + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ +function hc_textsplittextfour() { + var success; + if(checkInitialization(builder, "hc_textsplittextfour") != null) return; + var doc; + var elementList; + var addressNode; + var textNode; + var splitNode; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("acronym"); + addressNode = elementList.item(0); + textNode = addressNode.firstChild; + + splitNode = textNode.splitText(30); + value = splitNode.nodeValue; + + assertEquals("textSplitTextFourAssert","98551",value); + +} + + + + +function runTest() { + hc_textsplittextfour(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.xhtml new file mode 100644 index 0000000..6fe750b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextfour.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone-expected.txt new file mode 100644 index 0000000..53b1e25 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextone +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.js b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.js new file mode 100644 index 0000000..2e089c5 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.js @@ -0,0 +1,126 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextone"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + The "splitText(offset)" method breaks the Text node into + two Text nodes at the specified offset keeping each node + as siblings in the tree. + + Retrieve the textual data from the second child of the + third employee and invoke the "splitText(offset)" method. + The method splits the Text node into two new sibling + Text nodes keeping both of them in the tree. This test + checks the "nextSibling()" method of the original node + to ensure that the two nodes are indeed siblings. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ +function hc_textsplittextone() { + var success; + if(checkInitialization(builder, "hc_textsplittextone") != null) return; + var doc; + var elementList; + var nameNode; + var textNode; + var splitNode; + var secondPart; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(2); + textNode = nameNode.firstChild; + + splitNode = textNode.splitText(7); + secondPart = textNode.nextSibling; + + value = secondPart.nodeValue; + + assertEquals("textSplitTextOneAssert","Jones",value); + +} + + + + +function runTest() { + hc_textsplittextone(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.xhtml new file mode 100644 index 0000000..034ba6b --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextone.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree-expected.txt new file mode 100644 index 0000000..3904f86 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextthree +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.js b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.js new file mode 100644 index 0000000..6992628 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.js @@ -0,0 +1,124 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittextthree"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + After the "splitText(offset)" method breaks the Text node + into two Text nodes, the new Text node contains all the + content at and after the offset point. + + Retrieve the textual data from the second child of the + third employee and invoke the "splitText(offset)" method. + The new Text node should contain all the content + at and after the offset point. The "getNodeValue()" + method is called to check that the new node now contains + the characters at and after position seven. + (Starting count at 0) + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ +function hc_textsplittextthree() { + var success; + if(checkInitialization(builder, "hc_textsplittextthree") != null) return; + var doc; + var elementList; + var nameNode; + var textNode; + var splitNode; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(2); + textNode = nameNode.firstChild; + + splitNode = textNode.splitText(6); + value = splitNode.nodeValue; + + assertEquals("textSplitTextThreeAssert"," Jones",value); + +} + + + + +function runTest() { + hc_textsplittextthree(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.xhtml new file mode 100644 index 0000000..5619b66 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittextthree.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo-expected.txt new file mode 100644 index 0000000..ae70088 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittexttwo +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.js b/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.js new file mode 100644 index 0000000..8778694 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.js @@ -0,0 +1,123 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textsplittexttwo"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + After the "splitText(offset)" method breaks the Text node + into two Text nodes, the original node contains all the + content up to the offset point. + + Retrieve the textual data from the second child of the + third employee and invoke the "splitText(offset)" method. + The original Text node should contain all the content + up to the offset point. The "getNodeValue()" method + is called to check that the original node now contains + the first five characters. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-38853C1D +*/ +function hc_textsplittexttwo() { + var success; + if(checkInitialization(builder, "hc_textsplittexttwo") != null) return; + var doc; + var elementList; + var nameNode; + var textNode; + var splitNode; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(2); + textNode = nameNode.firstChild; + + splitNode = textNode.splitText(5); + value = textNode.nodeValue; + + assertEquals("textSplitTextTwoAssert","Roger",value); + +} + + + + +function runTest() { + hc_textsplittexttwo(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.xhtml new file mode 100644 index 0000000..955a589 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textsplittexttwo.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup-expected.txt b/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup-expected.txt new file mode 100644 index 0000000..d70bda1 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup-expected.txt @@ -0,0 +1,2 @@ +Test http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textwithnomarkup +Status Success diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.js b/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.js new file mode 100644 index 0000000..2b3bae9 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.js @@ -0,0 +1,122 @@ + +/* +Copyright © 2001-2004 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C® Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_textwithnomarkup"; + } + +var docsLoaded = -1000000; +var builder = null; + +// +// This function is called by the testing framework before +// running the test suite. +// +// If there are no configuration exceptions, asynchronous +// document loading is started. Otherwise, the status +// is set to complete and the exception is immediately +// raised when entering the body of the test. +// +function setUpPage() { + setUpPageStatus = 'running'; + try { + // + // creates test document builder, may throw exception + // + builder = createConfiguredBuilder(); + + docsLoaded = 0; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + docsLoaded += preload(docRef, "doc", "hc_staff"); + + if (docsLoaded == 1) { + setUpPageStatus = 'complete'; + } + } catch(ex) { + catchInitializationError(builder, ex); + setUpPageStatus = 'complete'; + } +} + + + +// +// This method is called on the completion of +// each asychronous load started in setUpTests. +// +// When every synchronous loaded document has completed, +// the page status is changed which allows the +// body of the test to be executed. +function loadComplete() { + if (++docsLoaded == 1) { + setUpPageStatus = 'complete'; + } +} + + +/** +* + If there is not any markup inside an Element or Attr node + content, then the text is contained in a single object + implementing the Text interface that is the only child + of the element. + + Retrieve the textual data from the second child of the + third employee. That Text node contains a block of + multiple text lines without markup, so they should be + treated as a single Text node. The "getNodeValue()" + method should contain the combination of the two lines. + +* @author Curt Arnold +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1312295772 +* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-F68D080 +*/ +function hc_textwithnomarkup() { + var success; + if(checkInitialization(builder, "hc_textwithnomarkup") != null) return; + var doc; + var elementList; + var nameNode; + var nodeV; + var value; + + var docRef = null; + if (typeof(this.doc) != 'undefined') { + docRef = this.doc; + } + doc = load(docRef, "doc", "hc_staff"); + elementList = doc.getElementsByTagName("strong"); + nameNode = elementList.item(2); + nodeV = nameNode.firstChild; + + value = nodeV.nodeValue; + + assertEquals("textWithNoMarkupAssert","Roger\n Jones",value); + +} + + + + +function runTest() { + hc_textwithnomarkup(); +} diff --git a/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.xhtml b/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.xhtml new file mode 100644 index 0000000..acb0f4f --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/hc_textwithnomarkup.xhtml @@ -0,0 +1,60 @@ + + + + + + + + + + +]> + +hc_staff +

+ EMP0001 + Margaret Martin + Accountant + 56,000 + Female + 1230 North Ave. Dallas, Texas 98551 +

+

+ EMP0002 + Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab; + Secretary + 35,000 + Female + β Dallas, γ + 98554 +

+

+ EMP0003 + Roger + Jones + Department Manager + 100,000 + δ + PO Box 27 Irving, texas 98553 +

+

+ EMP0004 + Jeny Oconnor + Personnel Director + 95,000 + Female + 27 South Road. Dallas, Texas 98556 +

+

+ EMP0005 + Robert Myers + Computer Specialist + 90,000 + male + 1821 Nordic. Road, Irving Texas 98558 +

+ diff --git a/LayoutTests/dom/xhtml/level1/core/resources/COPYRIGHT.xhtml b/LayoutTests/dom/xhtml/level1/core/resources/COPYRIGHT.xhtml new file mode 100644 index 0000000..ceca128 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/resources/COPYRIGHT.xhtml @@ -0,0 +1,102 @@ + + + + + W3C IPR SOFTWARE NOTICE + + +

+ W3C IPR SOFTWARE NOTICE +

+

+ Copyright © 2002-2005 World Wide Web + Consortium, (Massachusetts + Institute of Technology, Institut + National de Recherche en Informatique et en Automatique, Keio University). All Rights + Reserved. +

+

+ The DOM Conformance Test Suite for Level 1 core is published under + the W3C Software Copyright Notice and License. The software + license requires "Notice of any changes or modifications to the + W3C files, including the date changes were made." Consequently, + modified versions of the DOM ECMAScript or Java tests must + document that they do not conform to the DOM Conformance Test + Suites; in the case of the Java language binding, the package + names can no longer be in the 'org.w3c' package. +

+

+ Note: The original version of the W3C Software Copyright Notice + and License could be found at http://www.w3.org/Consortium/Legal/copyright-software-19980720 +

+

+ Copyright © 1994-2005 World Wide Web + Consortium, (Massachusetts + Institute of Technology, Institut + National de Recherche en Informatique et en Automatique, Keio University). All Rights + Reserved. http://www.w3.org/Consortium/Legal/ +

+

+ This W3C work (including software, documents, or other related items) is + being provided by the copyright holders under the following license. By + obtaining, using and/or copying this work, you (the licensee) agree that + you have read, understood, and will comply with the following terms and + conditions: +

+

+ Permission to use, copy, and modify this software and its documentation, + with or without modification,  for any purpose and without fee or + royalty is hereby granted, provided that you include the following on ALL + copies of the software and documentation or portions thereof, including + modifications, that you make: +

+
    +
  1. + The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. +
  2. +
  3. + Any pre-existing intellectual property disclaimers, notices, or terms + and conditions. If none exist, a short notice of the following form + (hypertext is preferred, text is permitted) should be used within the + body of any redistributed or derivative code: "Copyright © + [$date-of-software] World Wide Web + Consortium, (Massachusetts + Institute of Technology, Institut + National de Recherche en Informatique et en Automatique, Keio University). All Rights + Reserved. http://www.w3.org/Consortium/Legal/" +
  4. +
  5. + Notice of any changes or modifications to the W3C files, including the + date changes were made. (We recommend you provide URIs to the location + from which the code is derived.) +
  6. +
+

+ THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT + HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS + FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR + DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, + TRADEMARKS OR OTHER RIGHTS. +

+

+ COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR + DOCUMENTATION. +

+

+ The name and trademarks of copyright holders may NOT be used in + advertising or publicity pertaining to the software without specific, + written prior permission. Title to copyright in this software and any + associated documentation will at all times remain with copyright + holders. +

+ + diff --git a/LayoutTests/dom/xhtml/level1/core/selfxhtml.js b/LayoutTests/dom/xhtml/level1/core/selfxhtml.js new file mode 100644 index 0000000..98a710a --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/selfxhtml.js @@ -0,0 +1,743 @@ +/* +Copyright (c) 2001-2005 World Wide Web Consortium, +(Massachusetts Institute of Technology, European Research Consortium +for Informatics and Mathematics, Keio University). All +Rights Reserved. This work is distributed under the W3C(r) Software License [1] in the +hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 +*/ + + function assertSize(descr, expected, actual) { + var actualSize; + assertNotNull(descr, actual); + actualSize = actual.length; + assertEquals(descr, expected, actualSize); + } + + function assertEqualsAutoCase(context, descr, expected, actual) { + if (builder.contentType == "text/html") { + if(context == "attribute") { + assertEquals(descr, expected.toLowerCase(), actual.toLowerCase()); + } else { + assertEquals(descr, expected.toUpperCase(), actual); + } + } else { + assertEquals(descr, expected, actual); + } + } + + + function assertEqualsCollectionAutoCase(context, descr, expected, actual) { + // + // if they aren't the same size, they aren't equal + assertEquals(descr, expected.length, actual.length); + + // + // if there length is the same, then every entry in the expected list + // must appear once and only once in the actual list + var expectedLen = expected.length; + var expectedValue; + var actualLen = actual.length; + var i; + var j; + var matches; + for(i = 0; i < expectedLen; i++) { + matches = 0; + expectedValue = expected[i]; + for(j = 0; j < actualLen; j++) { + if (builder.contentType == "text/html") { + if (context == "attribute") { + if (expectedValue.toLowerCase() == actual[j].toLowerCase()) { + matches++; + } + } else { + if (expectedValue.toUpperCase() == actual[j]) { + matches++; + } + } + } else { + if(expectedValue == actual[j]) { + matches++; + } + } + } + if(matches == 0) { + assert(descr + ": No match found for " + expectedValue,false); + } + if(matches > 1) { + assert(descr + ": Multiple matches found for " + expectedValue, false); + } + } + } + + function assertEqualsCollection(descr, expected, actual) { + // + // if they aren't the same size, they aren't equal + assertEquals(descr, expected.length, actual.length); + // + // if there length is the same, then every entry in the expected list + // must appear once and only once in the actual list + var expectedLen = expected.length; + var expectedValue; + var actualLen = actual.length; + var i; + var j; + var matches; + for(i = 0; i < expectedLen; i++) { + matches = 0; + expectedValue = expected[i]; + for(j = 0; j < actualLen; j++) { + if(expectedValue == actual[j]) { + matches++; + } + } + if(matches == 0) { + assert(descr + ": No match found for " + expectedValue,false); + } + if(matches > 1) { + assert(descr + ": Multiple matches found for " + expectedValue, false); + } + } + } + + + function assertEqualsListAutoCase(context, descr, expected, actual) { + var minLength = expected.length; + if (actual.length < minLength) { + minLength = actual.length; + } + // + for(var i = 0; i < minLength; i++) { + assertEqualsAutoCase(context, descr, expected[i], actual[i]); + } + // + // if they aren't the same size, they aren't equal + assertEquals(descr, expected.length, actual.length); + } + + + function assertEqualsList(descr, expected, actual) { + var minLength = expected.length; + if (actual.length < minLength) { + minLength = actual.length; + } + // + for(var i = 0; i < minLength; i++) { + if(expected[i] != actual[i]) { + assertEquals(descr, expected[i], actual[i]); + } + } + // + // if they aren't the same size, they aren't equal + assertEquals(descr, expected.length, actual.length); + } + + function assertInstanceOf(descr, type, obj) { + if(type == "Attr") { + assertEquals(descr,2,obj.nodeType); + var specd = obj.specified; + } + } + + function assertSame(descr, expected, actual) { + if(expected != actual) { + assertEquals(descr, expected.nodeType, actual.nodeType); + assertEquals(descr, expected.nodeValue, actual.nodeValue); + } + } + + function assertURIEquals(assertID, scheme, path, host, file, name, query, fragment, isAbsolute, actual) { + // + // URI must be non-null + assertNotNull(assertID, actual); + + var uri = actual; + + var lastPound = actual.lastIndexOf("#"); + var actualFragment = ""; + if(lastPound != -1) { + // + // substring before pound + // + uri = actual.substring(0,lastPound); + actualFragment = actual.substring(lastPound+1); + } + if(fragment != null) assertEquals(assertID,fragment, actualFragment); + + var lastQuestion = uri.lastIndexOf("?"); + var actualQuery = ""; + if(lastQuestion != -1) { + // + // substring before pound + // + uri = actual.substring(0,lastQuestion); + actualQuery = actual.substring(lastQuestion+1); + } + if(query != null) assertEquals(assertID, query, actualQuery); + + var firstColon = uri.indexOf(":"); + var firstSlash = uri.indexOf("/"); + var actualPath = uri; + var actualScheme = ""; + if(firstColon != -1 && firstColon < firstSlash) { + actualScheme = uri.substring(0,firstColon); + actualPath = uri.substring(firstColon + 1); + } + + if(scheme != null) { + assertEquals(assertID, scheme, actualScheme); + } + + if(path != null) { + assertEquals(assertID, path, actualPath); + } + + if(host != null) { + var actualHost = ""; + if(actualPath.substring(0,2) == "//") { + var termSlash = actualPath.substring(2).indexOf("/") + 2; + actualHost = actualPath.substring(0,termSlash); + } + assertEquals(assertID, host, actualHost); + } + + if(file != null || name != null) { + var actualFile = actualPath; + var finalSlash = actualPath.lastIndexOf("/"); + if(finalSlash != -1) { + actualFile = actualPath.substring(finalSlash+1); + } + if (file != null) { + assertEquals(assertID, file, actualFile); + } + if (name != null) { + var actualName = actualFile; + var finalDot = actualFile.lastIndexOf("."); + if (finalDot != -1) { + actualName = actualName.substring(0, finalDot); + } + assertEquals(assertID, name, actualName); + } + } + + if(isAbsolute != null) { + assertEquals(assertID, isAbsolute, actualPath.substring(0,1) == "/"); + } + } + + +// size() used by assertSize element +function size(collection) +{ + return collection.length; +} + +function same(expected, actual) +{ + return expected === actual; +} + +function equalsAutoCase(context, expected, actual) { + if (builder.contentType == "text/html") { + if (context == "attribute") { + return expected.toLowerCase() == actual; + } + return expected.toUpperCase() == actual; + } + return expected == actual; +} + +function toLowerArray(src) { + var newArray = new Array(); + var i; + for (i = 0; i < src.length; i++) { + newArray[i] = src[i].toLowerCase(); + } + return newArray; +} + +function createTempURI(scheme) { + if (scheme == "http") { + return "http://localhost:8080/webdav/tmp" + Math.floor(Math.random() * 100000) + ".xml"; + } + return "file:///tmp/domts" + Math.floor(Math.random() * 100000) + ".xml"; +} + + + +function EventMonitor() { + this.atEvents = new Array(); + this.bubbledEvents = new Array(); + this.capturedEvents = new Array(); + this.allEvents = new Array(); +} + +EventMonitor.prototype.handleEvent = function(evt) { + switch(evt.eventPhase) { + case 1: + monitor.capturedEvents[monitor.capturedEvents.length] = evt; + break; + + case 2: + monitor.atEvents[monitor.atEvents.length] = evt; + break; + + case 3: + monitor.bubbledEvents[monitor.bubbledEvents.length] = evt; + break; + } + monitor.allEvents[monitor.allEvents.length] = evt; +} + +function DOMErrorImpl(err) { + this.severity = err.severity; + this.message = err.message; + this.type = err.type; + this.relatedException = err.relatedException; + this.relatedData = err.relatedData; + this.location = err.location; +} + + + +function DOMErrorMonitor() { + this.allErrors = new Array(); +} + +DOMErrorMonitor.prototype.handleError = function(err) { + errorMonitor.allErrors[errorMonitor.allErrors.length] = new DOMErrorImpl(err); +} + +DOMErrorMonitor.prototype.assertLowerSeverity = function(id, severity) { + var i; + for (i = 0; i < this.allErrors.length; i++) { + if (this.allErrors[i].severity >= severity) { + assertEquals(id, severity - 1, this.allErrors[i].severity); + } + } +} + +function UserDataNotification(operation, key, data, src, dst) { + this.operation = operation; + this.key = key; + this.data = data; + this.src = src; + this.dst = dst; +} + +function UserDataMonitor() { + this.allNotifications = new Array(); +} + +UserDataMonitor.prototype.handle = function(operation, key, data, src, dst) { + userDataMonitor.allNotifications[userDataMonitor.allNotifications.length] = + new UserDataNotification(operation, key, data, src, dst); +} + + + +function HTMLBuilder() { + this.contentType = "application/xhtml+xml"; + this.supportedContentTypes = [ "application/xhtml+xml" ]; + + this.supportsAsyncChange = false; + this.async = false; + this.fixedAttributeNames = [ + "validating", "expandEntityReferences", "coalescing", + "signed", "hasNullString", "ignoringElementContentWhitespace", "namespaceAware", "ignoringComments", "schemaValidating"]; + + this.fixedAttributeValues = [false, true, false, true, true , false, true, false, false ]; + this.configurableAttributeNames = [ ]; + this.configurableAttributeValues = [ ]; + this.initializationError = null; + this.initializationFatalError = null; + this.skipIncompatibleTests = true; + this.documentURLs = new Array(); + this.documentVarnames = new Array(); +} + +HTMLBuilder.prototype.hasFeature = function(feature, version) { + return document.implementation.hasFeature(feature, version); +} + +HTMLBuilder.prototype.getImplementation = function() { + return document.implementation; +} + +HTMLBuilder.prototype.preload = function(frame, varname, url) { + var i; + this.documentVarnames[this.documentVarnames.length] = varname; + this.documentURLs[this.documentURLs.length] = url; + if (this.documentURLs.length > 1) { + // + // if all the urls are not the same + // + for (i = 1; i < this.documentURLs.length; i++) { + if (this.documentURLs[i] != this.documentURLs[0]) { + throw "Tests with multiple loads of different documents are not currently supported"; + } + } + } + return 1; +} + +HTMLBuilder.prototype.cloneNode = function(srcNode, doc) { + var clone = null; + switch(srcNode.nodeType) { + // + // element + case 1: + clone = doc.createElementNS(srcNode.namespaceURI, srcNode.nodeName); + var attrs = srcNode.attributes; + for(var i = 0; i < attrs.length; i++) { + var srcAttr = attrs.item(i); + clone.setAttributeNS(srcAttr.namespaceURI, srcAttr.nodeName, srcAttr.nodeValue); + } + var srcChild = srcNode.firstChild; + while(srcChild != null) { + var cloneChild = this.cloneNode(srcChild, doc); + if (cloneChild != null) { + clone.appendChild(cloneChild); + } + srcChild = srcChild.nextSibling; + } + break; + + case 3: + clone = doc.createTextNode(srcNode.nodeValue); + break; + + case 4: + clone = doc.createCDATASection(srcNode.nodeValue); + break; + + case 5: + clone = doc.createEntityReference(srcNode.nodeName); + break; + + case 7: + clone = doc.createProcessingInstruction(srcNode.target, srcNode.data); + break; + + case 8: + clone = doc.createComment(srcNode.nodeValue); + break; + } + return clone; + +} + + +HTMLBuilder.prototype.load = function(frame, varname, url) { + if (this.documentVarnames[0] == varname) { + return document; + } + // + // + // not a perfect way to do this + // Document.cloneNode is implementation dependent but exists in L1 + // and implemented in IE. The alternative brute force copy + // only works in L2 or higher implementations and can't copy + // entity and notation definitions, etc. + var clone = null; + try { + clone = document.cloneNode(true); + } catch(ex) { + } + if (clone == null) { + clone = document.implementation.createDocument( + document.documentElement.namespaceURI, + document.documentElement.nodeName, + null); + // + // Work-around since + // Safari does not create document element + // create document. + if (clone.documentElement == null) { + clone.appendChild(clone.createElementNS( + document.documentElement.namespaceURI, + document.documentElement.nodeName)); + } + var attrs = document.documentElement.attributes; + for(var i = 0; i < attrs.length; i++) { + var srcAttr = attrs.item(i); + clone.documentElement.setAttributeNS( + srcAttr.namespaceURI, srcAttr.nodeName, srcAttr.nodeValue); + } + + var srcNode = document.firstChild; + while(srcNode != null && srcNode.nodeType != 1) { + if (srcNode.nodeType != 10) { + var cloneNode = this.cloneNode(srcNode, clone); + clone.insertBefore(cloneNode, clone.documentElement); + } + srcNode = srcNode.nextSibling; + } + srcNode = document.documentElement.nextSibling; + while(srcNode != null) { + var cloneNode = this.cloneNode(srcNode, clone); + clone.appendChild(cloneNode); + srcNode = srcNode.nextSibling; + } + srcNode = document.documentElement.firstChild; + while(srcNode != null) { + var cloneNode = this.cloneNode(srcNode, clone); + if (cloneNode != null) { + clone.documentElement.appendChild(cloneNode); + } + srcNode = srcNode.nextSibling; + } + } + return clone; +} + +HTMLBuilder.prototype.getImplementationAttribute = function(attr) { + for (var i = 0; i < this.fixedAttributeNames.length; i++) { + if (this.fixedAttributeNames[i] == attr) { + return this.fixedAttributeValues[i]; + } + } + throw "Unrecognized implementation attribute: " + attr; +} + + +HTMLBuilder.prototype.setImplementationAttribute = function(attribute, value) { + var supported = this.getImplementationAttribute(attribute); + if (supported != value) { + this.initializationError = "HTML loader does not support " + attribute + "=" + value; + } +} + +HTMLBuilder.prototype.canSetImplementationAttribute = function(attribute, value) { + var supported = this.getImplementationAttribute(attribute); + return (supported == value); +} + + + + +function createConfiguredBuilder() { + return new HTMLBuilder(); +} + +function catchInitializationError(buildr, ex) { + buildr.initializationError = ex; + buildr.initializationFatalError = ex; +} + + +function checkFeature(feature, version) +{ + if (!builder.hasFeature(feature, version)) + { + // + // don't throw exception so that users can select to ignore the precondition + // + builder.initializationError = "builder does not support feature " + feature + " version " + version; + } +} + +function setResult(resultType, message) { + var testName = getTargetURI(); + document.title = testName + ":" + resultType; + var xhtmlNS = "http://www.w3.org/1999/xhtml"; + var newBody = document.createElementNS(xhtmlNS, "body"); + var newTable = document.createElementNS(xhtmlNS, "table"); + newTable.width = "100%"; + newTable.border = "1"; + newBody.appendChild(newTable); + var testRow = newTable.insertRow(-1); + var testDiv1 = testRow.insertCell(-1); + testDiv1.appendChild(document.createTextNode("Test")); + var testDiv2 = testRow.insertCell(-1); + testDiv2.appendChild(document.createTextNode(testName)); + var statusRow = newTable.insertRow(-1); + var statusDiv1 = statusRow.insertCell(-1); + statusDiv1.appendChild(document.createTextNode("Status")); + var statusDiv2 = statusRow.insertCell(-1); + var style = "color:green"; + if (resultType == null) { + statusDiv2.appendChild(document.createTextNode("Success")); + } else { + statusDiv2.appendChild(document.createTextNode(resultType)); + if (resultType == "skip") { + style = "color:blue"; + } else { + style = "color:red"; + } + } + newTable.setAttributeNS(null, "style", style); + if (message != null) { + var messageRow = newTable.insertRow(-1); + var messageDiv1 = messageRow.insertCell(-1); + messageDiv1.appendChild(document.createTextNode("Message")); + var messageDiv2 = messageRow.insertCell(-1); + messageDiv2.appendChild(document.createTextNode(message)); + } + var oldBody = document.getElementsByTagName("body")[0]; + oldBody.parentNode.replaceChild(newBody, oldBody); + if (parent != window && typeof(parent.setResult) != 'undefined') { + parent.setResult(testName, resultType, message); + } +} + +function checkInitialization(buildr, testname) { + return buildr.initializationError; +} + +function preload(docRef, varname, href) { + return builder.preload(docRef, varname, href); +} + + +function load(docRef, varname, href) { + return builder.load(docRef, varname, href); +} + + +function getImplementationAttribute(attr) { + return builder.getImplementationAttribute(attr); +} + + +function setImplementationAttribute(attribute, value) { + builder.setImplementationAttribute(attribute, value); +} + +function createXPathEvaluator(doc) { + try { + return doc.getFeature("XPath", null); + } + catch(ex) { + } + return doc; +} + + +function getImplementation() { + return builder.getImplementation(); +} + +function assertEquals(id, expected, actual) { + var myActual; + if (expected != actual) { + myActual = actual; + if (actual == null) { + myActual = "null"; + } + throw "failure:" + id + ": assertEquals failed, actual " + myActual + ", expected " + expected + "."; + } +} + +function assertNull(id, actual) { + if (actual != null) { + throw "failure:" + id + ": assertNull failed, actual " + actual; + } +} + + +function assertTrue(id, actual) { + if (!actual) { + throw "failure:" + id + ": assertTrue failed"; + } +} + + +function assertFalse(id, actual) { + if (actual) { + throw "failure:" + id + ": assertTrue failed"; + } +} + +function assertNotNull(id, actual) { + if (actual == null) { + throw "failure:" + id + ": assertNotNull failed"; + } +} + +function fail(id) { + throw "failure:" + id + ": fail"; +} + + + +function getSuffix(contentType) { + switch(contentType) { + case "text/html": + return ".html"; + + case "text/xml": + return ".xml"; + + case "image/svg+xml": + return ".svg"; + + case "text/mathml": + return ".mml"; + } + return ".xhtml"; +} + + +function getResourceURI(name, scheme, contentType) { + var base = document.documentURI; + if (base == null) { + base = ""; + } else { + base = base.substring(0, base.lastIndexOf('/') + 1) + "files/"; + } + return base + name + getSuffix(contentType); +} + + + +function startTest() { + +// +// WebKit modification: 18-August-2005 +// +// Inform the test controller that this test has a text-format result and so should +// be dumped as text, and also that the dump should not occur automatically. +// +if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); +} +// +// End WebKit modification +// + + // + // invoke test setup + // + setUpPage(); + try { + runTest(); + if (builder.initializationError == null) { + setResult(null, null); + } else { + setResult("skip", builder.initializationError); + } + } catch(ex) { + if (typeof(ex.substring) != 'undefined' && ex.substring(0, 8) == "failure:") { + setResult("failure", ex.substring(8)); + } else { + setResult("error", ex); + } + } + +// +// WebKit modification: 18-August-2005 +// +// Inform the test controller that this test is complete, so it's time to dump. +// + if (window.layoutTestController) { + layoutTestController.notifyDone(); + } +// +// End WebKit modification +// + +} diff --git a/LayoutTests/dom/xhtml/level1/core/staff.dtd b/LayoutTests/dom/xhtml/level1/core/staff.dtd new file mode 100644 index 0000000..02a994d --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/staff.dtd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent b/LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent new file mode 100644 index 0000000..ffee223 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/xhtml-lat1.ent @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LayoutTests/dom/xhtml/level1/core/xhtml-special.ent b/LayoutTests/dom/xhtml/level1/core/xhtml-special.ent new file mode 100644 index 0000000..ca358b2 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/xhtml-special.ent @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent b/LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent new file mode 100644 index 0000000..63c2abf --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/xhtml-symbol.ent @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LayoutTests/dom/xhtml/level1/core/xhtml1-frameset.dtd b/LayoutTests/dom/xhtml/level1/core/xhtml1-frameset.dtd new file mode 100644 index 0000000..35773b0 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/xhtml1-frameset.dtd @@ -0,0 +1,1235 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LayoutTests/dom/xhtml/level1/core/xhtml1-strict.dtd b/LayoutTests/dom/xhtml/level1/core/xhtml1-strict.dtd new file mode 100644 index 0000000..7174a4e --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/xhtml1-strict.dtd @@ -0,0 +1,978 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LayoutTests/dom/xhtml/level1/core/xhtml1-transitional.dtd b/LayoutTests/dom/xhtml/level1/core/xhtml1-transitional.dtd new file mode 100644 index 0000000..8d62e50 --- /dev/null +++ b/LayoutTests/dom/xhtml/level1/core/xhtml1-transitional.dtd @@ -0,0 +1,1201 @@ + + + + + +%HTMLlat1; + + +%HTMLsymbol; + + +%HTMLspecial; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1