domino 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/lib/Element.js +5 -2
- package/package.json +2 -2
- package/test/domino.js +35 -0
- package/test/w3c/level1/core/documentgetdoctypenodtd.js +110 -0
- package/test/w3c/level1/core/documentinvalidcharacterexceptioncreatepi.js +143 -0
- package/test/w3c/level1/core/documentinvalidcharacterexceptioncreatepi1.js +140 -0
- package/test/w3c/level1/core/files/.cvsignore +0 -0
- package/test/w3c/level1/core/files/hc_nodtdstaff.html +10 -0
- package/test/w3c/level1/core/files/hc_staff.html +48 -0
- package/test/w3c/level1/core/files/staff.dtd +17 -0
- package/test/w3c/level1/core/hc_characterdataappenddata.js +124 -0
- package/test/w3c/level1/core/hc_characterdataappenddatagetdata.js +123 -0
- package/test/w3c/level1/core/hc_characterdatadeletedatabegining.js +122 -0
- package/test/w3c/level1/core/hc_characterdatadeletedataend.js +123 -0
- package/test/w3c/level1/core/hc_characterdatadeletedataexceedslength.js +125 -0
- package/test/w3c/level1/core/hc_characterdatadeletedatagetlengthanddata.js +132 -0
- package/test/w3c/level1/core/hc_characterdatadeletedatamiddle.js +123 -0
- package/test/w3c/level1/core/hc_characterdatagetdata.js +124 -0
- package/test/w3c/level1/core/hc_characterdatagetlength.js +119 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js +131 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js +131 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js +130 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js +130 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js +129 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js +132 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js +131 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js +131 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js +131 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js +130 -0
- package/test/w3c/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js +131 -0
- package/test/w3c/level1/core/hc_characterdatainsertdatabeginning.js +122 -0
- package/test/w3c/level1/core/hc_characterdatainsertdataend.js +123 -0
- package/test/w3c/level1/core/hc_characterdatainsertdatamiddle.js +123 -0
- package/test/w3c/level1/core/hc_characterdatareplacedatabegining.js +122 -0
- package/test/w3c/level1/core/hc_characterdatareplacedataend.js +123 -0
- package/test/w3c/level1/core/hc_characterdatareplacedataexceedslengthofarg.js +124 -0
- package/test/w3c/level1/core/hc_characterdatareplacedataexceedslengthofdata.js +122 -0
- package/test/w3c/level1/core/hc_characterdatareplacedatamiddle.js +123 -0
- package/test/w3c/level1/core/hc_characterdatasetnodevalue.js +122 -0
- package/test/w3c/level1/core/hc_characterdatasubstringexceedsvalue.js +120 -0
- package/test/w3c/level1/core/hc_characterdatasubstringvalue.js +119 -0
- package/test/w3c/level1/core/hc_commentgetcomment.js +144 -0
- package/test/w3c/level1/core/hc_documentcreatecomment.js +120 -0
- package/test/w3c/level1/core/hc_documentcreatedocumentfragment.js +126 -0
- package/test/w3c/level1/core/hc_documentcreateelement.js +121 -0
- package/test/w3c/level1/core/hc_documentcreateelementcasesensitive.js +132 -0
- package/test/w3c/level1/core/hc_documentcreatetextnode.js +120 -0
- package/test/w3c/level1/core/hc_documentgetdoctype.js +149 -0
- package/test/w3c/level1/core/hc_documentgetelementsbytagnamelength.js +110 -0
- package/test/w3c/level1/core/hc_documentgetelementsbytagnametotallength.js +221 -0
- package/test/w3c/level1/core/hc_documentgetelementsbytagnamevalue.js +120 -0
- package/test/w3c/level1/core/hc_documentgetimplementation.js +126 -0
- package/test/w3c/level1/core/hc_documentgetrootnode.js +123 -0
- package/test/w3c/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js +124 -0
- package/test/w3c/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js +117 -0
- package/test/w3c/level1/core/hc_domimplementationfeaturenoversion.js +126 -0
- package/test/w3c/level1/core/hc_domimplementationfeaturenull.js +129 -0
- package/test/w3c/level1/core/hc_domimplementationfeaturexml.js +125 -0
- package/test/w3c/level1/core/hc_elementaddnewattribute.js +117 -0
- package/test/w3c/level1/core/hc_elementchangeattributevalue.js +119 -0
- package/test/w3c/level1/core/hc_elementgetelementsbytagname.js +112 -0
- package/test/w3c/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js +144 -0
- package/test/w3c/level1/core/hc_elementgetelementsbytagnamenomatch.js +110 -0
- package/test/w3c/level1/core/hc_elementgetelementsbytagnamespecialvalue.js +134 -0
- package/test/w3c/level1/core/hc_elementgettagname.js +123 -0
- package/test/w3c/level1/core/hc_elementinvalidcharacterexception.js +125 -0
- package/test/w3c/level1/core/hc_elementinvalidcharacterexception1.js +119 -0
- package/test/w3c/level1/core/hc_elementnormalize.js +126 -0
- package/test/w3c/level1/core/hc_elementremoveattribute.js +113 -0
- package/test/w3c/level1/core/hc_elementretrieveallattributes.js +144 -0
- package/test/w3c/level1/core/hc_elementretrieveattrvalue.js +113 -0
- package/test/w3c/level1/core/hc_elementretrievetagname.js +118 -0
- package/test/w3c/level1/core/hc_entitiesremovenameditem1.js +133 -0
- package/test/w3c/level1/core/hc_entitiessetnameditem1.js +144 -0
- package/test/w3c/level1/core/hc_namednodemapchildnoderange.js +141 -0
- package/test/w3c/level1/core/hc_namednodemapnumberofnodes.js +127 -0
- package/test/w3c/level1/core/hc_nodeappendchild.js +123 -0
- package/test/w3c/level1/core/hc_nodeappendchildchildexists.js +160 -0
- package/test/w3c/level1/core/hc_nodeappendchilddocfragment.js +158 -0
- package/test/w3c/level1/core/hc_nodeappendchildgetnodename.js +123 -0
- package/test/w3c/level1/core/hc_nodeappendchildnewchilddiffdocument.js +145 -0
- package/test/w3c/level1/core/hc_nodeappendchildnodeancestor.js +132 -0
- package/test/w3c/level1/core/hc_nodeattributenodeattribute.js +120 -0
- package/test/w3c/level1/core/hc_nodechildnodes.js +149 -0
- package/test/w3c/level1/core/hc_nodechildnodesappendchild.js +159 -0
- package/test/w3c/level1/core/hc_nodechildnodesempty.js +123 -0
- package/test/w3c/level1/core/hc_nodecloneattributescopied.js +149 -0
- package/test/w3c/level1/core/hc_nodeclonefalsenocopytext.js +122 -0
- package/test/w3c/level1/core/hc_nodeclonegetparentnull.js +117 -0
- package/test/w3c/level1/core/hc_nodeclonenodefalse.js +126 -0
- package/test/w3c/level1/core/hc_nodeclonenodetrue.js +145 -0
- package/test/w3c/level1/core/hc_nodeclonetruecopytext.js +121 -0
- package/test/w3c/level1/core/hc_nodecommentnodeattributes.js +135 -0
- package/test/w3c/level1/core/hc_nodecommentnodename.js +134 -0
- package/test/w3c/level1/core/hc_nodecommentnodetype.js +133 -0
- package/test/w3c/level1/core/hc_nodecommentnodevalue.js +133 -0
- package/test/w3c/level1/core/hc_nodedocumentfragmentnodename.js +114 -0
- package/test/w3c/level1/core/hc_nodedocumentfragmentnodetype.js +114 -0
- package/test/w3c/level1/core/hc_nodedocumentfragmentnodevalue.js +120 -0
- package/test/w3c/level1/core/hc_nodedocumentnodeattribute.js +111 -0
- package/test/w3c/level1/core/hc_nodedocumentnodename.js +111 -0
- package/test/w3c/level1/core/hc_nodedocumentnodetype.js +110 -0
- package/test/w3c/level1/core/hc_nodedocumentnodevalue.js +112 -0
- package/test/w3c/level1/core/hc_nodeelementnodeattributes.js +145 -0
- package/test/w3c/level1/core/hc_nodeelementnodename.js +125 -0
- package/test/w3c/level1/core/hc_nodeelementnodetype.js +112 -0
- package/test/w3c/level1/core/hc_nodeelementnodevalue.js +109 -0
- package/test/w3c/level1/core/hc_nodegetfirstchild.js +130 -0
- package/test/w3c/level1/core/hc_nodegetfirstchildnull.js +117 -0
- package/test/w3c/level1/core/hc_nodegetlastchild.js +117 -0
- package/test/w3c/level1/core/hc_nodegetlastchildnull.js +118 -0
- package/test/w3c/level1/core/hc_nodegetnextsibling.js +117 -0
- package/test/w3c/level1/core/hc_nodegetnextsiblingnull.js +124 -0
- package/test/w3c/level1/core/hc_nodegetownerdocument.js +129 -0
- package/test/w3c/level1/core/hc_nodegetownerdocumentnull.js +115 -0
- package/test/w3c/level1/core/hc_nodegetprevioussibling.js +117 -0
- package/test/w3c/level1/core/hc_nodegetprevioussiblingnull.js +124 -0
- package/test/w3c/level1/core/hc_nodehaschildnodes.js +113 -0
- package/test/w3c/level1/core/hc_nodehaschildnodesfalse.js +117 -0
- package/test/w3c/level1/core/hc_nodeinsertbefore.js +153 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforedocfragment.js +141 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js +148 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforenewchildexists.js +151 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforenodeancestor.js +135 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforenodename.js +126 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforerefchildnonexistent.js +133 -0
- package/test/w3c/level1/core/hc_nodeinsertbeforerefchildnull.js +131 -0
- package/test/w3c/level1/core/hc_nodelistindexequalzero.js +135 -0
- package/test/w3c/level1/core/hc_nodelistindexgetlength.js +129 -0
- package/test/w3c/level1/core/hc_nodelistindexgetlengthofemptylist.js +122 -0
- package/test/w3c/level1/core/hc_nodelistindexnotzero.js +133 -0
- package/test/w3c/level1/core/hc_nodelistreturnfirstitem.js +129 -0
- package/test/w3c/level1/core/hc_nodelistreturnlastitem.js +133 -0
- package/test/w3c/level1/core/hc_nodelisttraverselist.js +149 -0
- package/test/w3c/level1/core/hc_nodeparentnode.js +117 -0
- package/test/w3c/level1/core/hc_nodeparentnodenull.js +114 -0
- package/test/w3c/level1/core/hc_noderemovechild.js +123 -0
- package/test/w3c/level1/core/hc_noderemovechildgetnodename.js +128 -0
- package/test/w3c/level1/core/hc_noderemovechildnode.js +160 -0
- package/test/w3c/level1/core/hc_noderemovechildoldchildnonexistent.js +129 -0
- package/test/w3c/level1/core/hc_nodereplacechild.js +127 -0
- package/test/w3c/level1/core/hc_nodereplacechildnewchilddiffdocument.js +148 -0
- package/test/w3c/level1/core/hc_nodereplacechildnewchildexists.js +155 -0
- package/test/w3c/level1/core/hc_nodereplacechildnodeancestor.js +135 -0
- package/test/w3c/level1/core/hc_nodereplacechildnodename.js +126 -0
- package/test/w3c/level1/core/hc_nodereplacechildoldchildnonexistent.js +131 -0
- package/test/w3c/level1/core/hc_nodetextnodeattribute.js +118 -0
- package/test/w3c/level1/core/hc_nodetextnodename.js +113 -0
- package/test/w3c/level1/core/hc_nodetextnodetype.js +124 -0
- package/test/w3c/level1/core/hc_nodetextnodevalue.js +118 -0
- package/test/w3c/level1/core/hc_nodevalue01.js +114 -0
- package/test/w3c/level1/core/hc_nodevalue02.js +114 -0
- package/test/w3c/level1/core/hc_nodevalue04.js +132 -0
- package/test/w3c/level1/core/hc_nodevalue05.js +114 -0
- package/test/w3c/level1/core/hc_nodevalue06.js +112 -0
- package/test/w3c/level1/core/hc_nodevalue07.js +134 -0
- package/test/w3c/level1/core/hc_nodevalue08.js +134 -0
- package/test/w3c/level1/core/hc_notationsremovenameditem1.js +133 -0
- package/test/w3c/level1/core/hc_notationssetnameditem1.js +144 -0
- package/test/w3c/level1/core/hc_textindexsizeerrnegativeoffset.js +130 -0
- package/test/w3c/level1/core/hc_textindexsizeerroffsetoutofbounds.js +131 -0
- package/test/w3c/level1/core/hc_textparseintolistofelements.js +169 -0
- package/test/w3c/level1/core/hc_textsplittextfour.js +122 -0
- package/test/w3c/level1/core/hc_textsplittextone.js +126 -0
- package/test/w3c/level1/core/hc_textsplittextthree.js +124 -0
- package/test/w3c/level1/core/hc_textsplittexttwo.js +123 -0
- package/test/w3c/level1/core/hc_textwithnomarkup.js +122 -0
- package/test/w3c/level1/core/obsolete/documentinvalidcharacterexceptioncreateentref.js +143 -0
- package/test/w3c/level1/core/obsolete/documentinvalidcharacterexceptioncreateentref1.js +140 -0
- package/test/w3c/level1/core/obsolete/hc_attrappendchild1.js +132 -0
- package/test/w3c/level1/core/obsolete/hc_attrappendchild2.js +127 -0
- package/test/w3c/level1/core/obsolete/hc_attrappendchild3.js +138 -0
- package/test/w3c/level1/core/obsolete/hc_attrappendchild4.js +152 -0
- package/test/w3c/level1/core/obsolete/hc_attrappendchild5.js +141 -0
- package/test/w3c/level1/core/obsolete/hc_attrappendchild6.js +127 -0
- package/test/w3c/level1/core/obsolete/hc_attrchildnodes1.js +124 -0
- package/test/w3c/level1/core/obsolete/hc_attrchildnodes2.js +130 -0
- package/test/w3c/level1/core/obsolete/hc_attrclonenode1.js +132 -0
- package/test/w3c/level1/core/obsolete/hc_attrcreatedocumentfragment.js +138 -0
- package/test/w3c/level1/core/obsolete/hc_attrcreatetextnode.js +127 -0
- package/test/w3c/level1/core/obsolete/hc_attrcreatetextnode2.js +127 -0
- package/test/w3c/level1/core/obsolete/hc_attreffectivevalue.js +118 -0
- package/test/w3c/level1/core/obsolete/hc_attrfirstchild.js +127 -0
- package/test/w3c/level1/core/obsolete/hc_attrgetvalue1.js +117 -0
- package/test/w3c/level1/core/obsolete/hc_attrgetvalue2.js +146 -0
- package/test/w3c/level1/core/obsolete/hc_attrhaschildnodes.js +114 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore1.js +140 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore2.js +141 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore3.js +146 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore4.js +147 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore5.js +153 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore6.js +142 -0
- package/test/w3c/level1/core/obsolete/hc_attrinsertbefore7.js +160 -0
- package/test/w3c/level1/core/obsolete/hc_attrlastchild.js +127 -0
- package/test/w3c/level1/core/obsolete/hc_attrname.js +123 -0
- package/test/w3c/level1/core/obsolete/hc_attrnextsiblingnull.js +118 -0
- package/test/w3c/level1/core/obsolete/hc_attrnormalize.js +133 -0
- package/test/w3c/level1/core/obsolete/hc_attrparentnodenull.js +118 -0
- package/test/w3c/level1/core/obsolete/hc_attrprevioussiblingnull.js +118 -0
- package/test/w3c/level1/core/obsolete/hc_attrremovechild1.js +131 -0
- package/test/w3c/level1/core/obsolete/hc_attrremovechild2.js +126 -0
- package/test/w3c/level1/core/obsolete/hc_attrreplacechild1.js +135 -0
- package/test/w3c/level1/core/obsolete/hc_attrreplacechild2.js +141 -0
- package/test/w3c/level1/core/obsolete/hc_attrsetvalue1.js +135 -0
- package/test/w3c/level1/core/obsolete/hc_attrsetvalue2.js +138 -0
- package/test/w3c/level1/core/obsolete/hc_attrspecifiedvalue.js +121 -0
- package/test/w3c/level1/core/obsolete/hc_attrspecifiedvaluechanged.js +123 -0
- package/test/w3c/level1/core/obsolete/hc_documentcreateattribute.js +122 -0
- package/test/w3c/level1/core/obsolete/hc_documentinvalidcharacterexceptioncreateattribute.js +124 -0
- package/test/w3c/level1/core/obsolete/hc_documentinvalidcharacterexceptioncreateattribute1.js +117 -0
- package/test/w3c/level1/core/obsolete/hc_elementassociatedattribute.js +119 -0
- package/test/w3c/level1/core/obsolete/hc_elementcreatenewattribute.js +124 -0
- package/test/w3c/level1/core/obsolete/hc_elementgetattributenode.js +114 -0
- package/test/w3c/level1/core/obsolete/hc_elementgetattributenodenull.js +115 -0
- package/test/w3c/level1/core/obsolete/hc_elementgetelementempty.js +123 -0
- package/test/w3c/level1/core/obsolete/hc_elementinuseattributeerr.js +131 -0
- package/test/w3c/level1/core/obsolete/hc_elementnormalize2.js +129 -0
- package/test/w3c/level1/core/obsolete/hc_elementnotfounderr.js +130 -0
- package/test/w3c/level1/core/obsolete/hc_elementremoveattributeaftercreate.js +124 -0
- package/test/w3c/level1/core/obsolete/hc_elementremoveattributenode.js +119 -0
- package/test/w3c/level1/core/obsolete/hc_elementreplaceattributewithself.js +117 -0
- package/test/w3c/level1/core/obsolete/hc_elementreplaceexistingattribute.js +122 -0
- package/test/w3c/level1/core/obsolete/hc_elementreplaceexistingattributegevalue.js +123 -0
- package/test/w3c/level1/core/obsolete/hc_elementsetattributenodenull.js +120 -0
- package/test/w3c/level1/core/obsolete/hc_elementwrongdocumenterr.js +147 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapgetnameditem.js +121 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapinuseattributeerr.js +139 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapnotfounderr.js +131 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapremovenameditem.js +124 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapreturnattrnode.js +126 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapreturnfirstitem.js +150 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapreturnlastitem.js +152 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapreturnnull.js +121 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapsetnameditem.js +131 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapsetnameditemreturnvalue.js +132 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapsetnameditemthatexists.js +134 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapsetnameditemwithnewvalue.js +126 -0
- package/test/w3c/level1/core/obsolete/hc_namednodemapwrongdocumenterr.js +149 -0
- package/test/w3c/level1/core/obsolete/hc_nodeappendchildinvalidnodetype.js +130 -0
- package/test/w3c/level1/core/obsolete/hc_nodeattributenodename.js +115 -0
- package/test/w3c/level1/core/obsolete/hc_nodeattributenodetype.js +123 -0
- package/test/w3c/level1/core/obsolete/hc_nodeattributenodevalue.js +118 -0
- package/test/w3c/level1/core/obsolete/hc_nodeinsertbeforeinvalidnodetype.js +136 -0
- package/test/w3c/level1/core/obsolete/hc_nodereplacechildinvalidnodetype.js +136 -0
- package/test/w3c/level1/core/obsolete/hc_nodevalue03.js +138 -0
- package/test/web-platform-blacklist.json +38 -19
package/CHANGELOG.md
CHANGED
package/lib/Element.js
CHANGED
|
@@ -922,8 +922,11 @@ Element.prototype = Object.create(ContainerNode.prototype, {
|
|
|
922
922
|
|
|
923
923
|
closest: { value: function(selector) {
|
|
924
924
|
var el = this;
|
|
925
|
-
|
|
926
|
-
|
|
925
|
+
do {
|
|
926
|
+
if (el.matches && el.matches(selector)) { return el; }
|
|
927
|
+
el = el.parentElement || el.parentNode;
|
|
928
|
+
} while (el !== null && el.nodeType === Node.ELEMENT_NODE);
|
|
929
|
+
return null;
|
|
927
930
|
}},
|
|
928
931
|
|
|
929
932
|
querySelector: { value: function(selector) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domino",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"license": "BSD-2-Clause",
|
|
5
5
|
"author": "Felix Gnass <fgnass@gmail.com>",
|
|
6
6
|
"description": "Server-side DOM implementation based on Mozilla's dom.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"types": "lib/index.d.ts",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"jquery": "^3.
|
|
25
|
+
"jquery": "^3.4.1",
|
|
26
26
|
"jshint": "^2.10.1",
|
|
27
27
|
"mocha": "^5.2.0",
|
|
28
28
|
"should": "^13.2.3"
|
package/test/domino.js
CHANGED
|
@@ -16,6 +16,41 @@ exports.matches = function() {
|
|
|
16
16
|
h1.matches('h2,h1').should.equal(true);
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
exports.closest = function() {
|
|
20
|
+
// see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
|
|
21
|
+
var html =
|
|
22
|
+
'<article>\n' +
|
|
23
|
+
' <div id="div-01">Here is div-01\n' +
|
|
24
|
+
' <div id="div-02">Here is div-02\n' +
|
|
25
|
+
' <div id="div-03">Here is div-03</div>\n' +
|
|
26
|
+
' </div>\n' +
|
|
27
|
+
' </div>\n' +
|
|
28
|
+
'</article>';
|
|
29
|
+
var document = domino.createWindow(html).document;
|
|
30
|
+
var el = document.getElementById('div-03');
|
|
31
|
+
var r1 = el.closest('#div-02');
|
|
32
|
+
r1.id.should.equal('div-02');
|
|
33
|
+
var r2 = el.closest('div div');
|
|
34
|
+
r2.id.should.equal('div-03');
|
|
35
|
+
var r3 = el.closest('article > div');
|
|
36
|
+
r3.id.should.equal('div-01');
|
|
37
|
+
var r4 = el.closest(':not(div)');
|
|
38
|
+
r4.tagName.should.equal('ARTICLE');
|
|
39
|
+
var r5 = el.closest('#nothere');
|
|
40
|
+
(r5 === null).should.be.true();
|
|
41
|
+
// GH #154
|
|
42
|
+
var disconnected = document.createElement('div');
|
|
43
|
+
var r6 = disconnected.closest('#nothere');
|
|
44
|
+
(r6 === null).should.be.true();
|
|
45
|
+
var fragment = document.createDocumentFragment();
|
|
46
|
+
fragment.appendChild(disconnected);
|
|
47
|
+
var r7 = disconnected.closest('#nothere');
|
|
48
|
+
(r7 === null).should.be.true();
|
|
49
|
+
var r8 = disconnected.closest(':not(div)');
|
|
50
|
+
// This should not return DocumentFragment! Always should return an Element.
|
|
51
|
+
(r8 === null).should.be.true();
|
|
52
|
+
};
|
|
53
|
+
|
|
19
54
|
exports.querySelectorAll = function() {
|
|
20
55
|
var window = domino.createWindow(html);
|
|
21
56
|
var d = window.document;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
Copyright © 2001-2004 World Wide Web Consortium,
|
|
4
|
+
(Massachusetts Institute of Technology, European Research Consortium
|
|
5
|
+
for Informatics and Mathematics, Keio University). All
|
|
6
|
+
Rights Reserved. This work is distributed under the W3C® Software License [1] in the
|
|
7
|
+
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
8
|
+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
|
|
10
|
+
[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gets URI that identifies the test.
|
|
17
|
+
* @return uri identifier of test
|
|
18
|
+
*/
|
|
19
|
+
function getTargetURI() {
|
|
20
|
+
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentgetdoctypenodtd";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var docsLoaded = -1000000;
|
|
24
|
+
var builder = null;
|
|
25
|
+
|
|
26
|
+
//
|
|
27
|
+
// This function is called by the testing framework before
|
|
28
|
+
// running the test suite.
|
|
29
|
+
//
|
|
30
|
+
// If there are no configuration exceptions, asynchronous
|
|
31
|
+
// document loading is started. Otherwise, the status
|
|
32
|
+
// is set to complete and the exception is immediately
|
|
33
|
+
// raised when entering the body of the test.
|
|
34
|
+
//
|
|
35
|
+
function setUpPage() {
|
|
36
|
+
setUpPageStatus = 'running';
|
|
37
|
+
try {
|
|
38
|
+
//
|
|
39
|
+
// creates test document builder, may throw exception
|
|
40
|
+
//
|
|
41
|
+
builder = createConfiguredBuilder();
|
|
42
|
+
setImplementationAttribute("validating", false);
|
|
43
|
+
|
|
44
|
+
docsLoaded = 0;
|
|
45
|
+
|
|
46
|
+
var docRef = null;
|
|
47
|
+
if (typeof(this.doc) != 'undefined') {
|
|
48
|
+
docRef = this.doc;
|
|
49
|
+
}
|
|
50
|
+
docsLoaded += preload(docRef, "doc", "hc_nodtdstaff");
|
|
51
|
+
|
|
52
|
+
if (docsLoaded == 1) {
|
|
53
|
+
setUpPageStatus = 'complete';
|
|
54
|
+
}
|
|
55
|
+
} catch(ex) {
|
|
56
|
+
catchInitializationError(builder, ex);
|
|
57
|
+
setUpPageStatus = 'complete';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
//
|
|
64
|
+
// This method is called on the completion of
|
|
65
|
+
// each asychronous load started in setUpTests.
|
|
66
|
+
//
|
|
67
|
+
// When every synchronous loaded document has completed,
|
|
68
|
+
// the page status is changed which allows the
|
|
69
|
+
// body of the test to be executed.
|
|
70
|
+
function loadComplete() {
|
|
71
|
+
if (++docsLoaded == 1) {
|
|
72
|
+
setUpPageStatus = 'complete';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
The "getDoctype()" method returns null for XML documents
|
|
80
|
+
without a document type declaration.
|
|
81
|
+
Retrieve the XML document without a DTD and invoke the
|
|
82
|
+
"getDoctype()" method. It should return null.
|
|
83
|
+
|
|
84
|
+
* @author NIST
|
|
85
|
+
* @author Mary Brady
|
|
86
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-B63ED1A31
|
|
87
|
+
*/
|
|
88
|
+
function documentgetdoctypenodtd() {
|
|
89
|
+
var success;
|
|
90
|
+
if(checkInitialization(builder, "documentgetdoctypenodtd") != null) return;
|
|
91
|
+
var doc;
|
|
92
|
+
var docType;
|
|
93
|
+
|
|
94
|
+
var docRef = null;
|
|
95
|
+
if (typeof(this.doc) != 'undefined') {
|
|
96
|
+
docRef = this.doc;
|
|
97
|
+
}
|
|
98
|
+
doc = load(docRef, "doc", "hc_nodtdstaff");
|
|
99
|
+
docType = doc.doctype;
|
|
100
|
+
|
|
101
|
+
assertNull("documentGetDocTypeNoDTDAssert",docType);
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
function runTest() {
|
|
109
|
+
documentgetdoctypenodtd();
|
|
110
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
Copyright © 2001-2004 World Wide Web Consortium,
|
|
4
|
+
(Massachusetts Institute of Technology, European Research Consortium
|
|
5
|
+
for Informatics and Mathematics, Keio University). All
|
|
6
|
+
Rights Reserved. This work is distributed under the W3C® Software License [1] in the
|
|
7
|
+
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
8
|
+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
|
|
10
|
+
[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gets URI that identifies the test.
|
|
17
|
+
* @return uri identifier of test
|
|
18
|
+
*/
|
|
19
|
+
function getTargetURI() {
|
|
20
|
+
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var docsLoaded = -1000000;
|
|
24
|
+
var builder = null;
|
|
25
|
+
|
|
26
|
+
//
|
|
27
|
+
// This function is called by the testing framework before
|
|
28
|
+
// running the test suite.
|
|
29
|
+
//
|
|
30
|
+
// If there are no configuration exceptions, asynchronous
|
|
31
|
+
// document loading is started. Otherwise, the status
|
|
32
|
+
// is set to complete and the exception is immediately
|
|
33
|
+
// raised when entering the body of the test.
|
|
34
|
+
//
|
|
35
|
+
function setUpPage() {
|
|
36
|
+
setUpPageStatus = 'running';
|
|
37
|
+
try {
|
|
38
|
+
//
|
|
39
|
+
// creates test document builder, may throw exception
|
|
40
|
+
//
|
|
41
|
+
builder = createConfiguredBuilder();
|
|
42
|
+
checkFeature("XML", null);
|
|
43
|
+
|
|
44
|
+
docsLoaded = 0;
|
|
45
|
+
|
|
46
|
+
var docRef = null;
|
|
47
|
+
if (typeof(this.doc) != 'undefined') {
|
|
48
|
+
docRef = this.doc;
|
|
49
|
+
}
|
|
50
|
+
docsLoaded += preload(docRef, "doc", "hc_staff");
|
|
51
|
+
|
|
52
|
+
if (docsLoaded == 1) {
|
|
53
|
+
setUpPageStatus = 'complete';
|
|
54
|
+
}
|
|
55
|
+
} catch(ex) {
|
|
56
|
+
catchInitializationError(builder, ex);
|
|
57
|
+
setUpPageStatus = 'complete';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
//
|
|
64
|
+
// This method is called on the completion of
|
|
65
|
+
// each asychronous load started in setUpTests.
|
|
66
|
+
//
|
|
67
|
+
// When every synchronous loaded document has completed,
|
|
68
|
+
// the page status is changed which allows the
|
|
69
|
+
// body of the test to be executed.
|
|
70
|
+
function loadComplete() {
|
|
71
|
+
if (++docsLoaded == 1) {
|
|
72
|
+
setUpPageStatus = 'complete';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
The "createProcessingInstruction(target,data) method
|
|
80
|
+
raises an INVALID_CHARACTER_ERR DOMException if the
|
|
81
|
+
specified tagName contains an invalid character.
|
|
82
|
+
|
|
83
|
+
* @author NIST
|
|
84
|
+
* @author Mary Brady
|
|
85
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])
|
|
86
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439
|
|
87
|
+
* @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'])
|
|
88
|
+
* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=249
|
|
89
|
+
*/
|
|
90
|
+
function documentinvalidcharacterexceptioncreatepi() {
|
|
91
|
+
var success;
|
|
92
|
+
if(checkInitialization(builder, "documentinvalidcharacterexceptioncreatepi") != null) return;
|
|
93
|
+
var doc;
|
|
94
|
+
var badPI;
|
|
95
|
+
|
|
96
|
+
var docRef = null;
|
|
97
|
+
if (typeof(this.doc) != 'undefined') {
|
|
98
|
+
docRef = this.doc;
|
|
99
|
+
}
|
|
100
|
+
doc = load(docRef, "doc", "hc_staff");
|
|
101
|
+
|
|
102
|
+
if(
|
|
103
|
+
|
|
104
|
+
(builder.contentType == "text/html" && false /*CSA: allowed in DOM 4*/)
|
|
105
|
+
|
|
106
|
+
) {
|
|
107
|
+
|
|
108
|
+
{
|
|
109
|
+
success = false;
|
|
110
|
+
try {
|
|
111
|
+
badPI = doc.createProcessingInstruction("foo","data");
|
|
112
|
+
}
|
|
113
|
+
catch(ex) {
|
|
114
|
+
success = (typeof(ex.code) != 'undefined' && ex.code == 9);
|
|
115
|
+
}
|
|
116
|
+
assertTrue("throw_NOT_SUPPORTED_ERR",success);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
else {
|
|
122
|
+
|
|
123
|
+
{
|
|
124
|
+
success = false;
|
|
125
|
+
try {
|
|
126
|
+
badPI = doc.createProcessingInstruction("invalid^Name","data");
|
|
127
|
+
}
|
|
128
|
+
catch(ex) {
|
|
129
|
+
success = (typeof(ex.code) != 'undefined' && ex.code == 5);
|
|
130
|
+
}
|
|
131
|
+
assertTrue("throw_INVALID_CHARACTER_ERR",success);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
function runTest() {
|
|
142
|
+
documentinvalidcharacterexceptioncreatepi();
|
|
143
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
Copyright © 2001-2004 World Wide Web Consortium,
|
|
4
|
+
(Massachusetts Institute of Technology, European Research Consortium
|
|
5
|
+
for Informatics and Mathematics, Keio University). All
|
|
6
|
+
Rights Reserved. This work is distributed under the W3C® Software License [1] in the
|
|
7
|
+
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
8
|
+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
|
|
10
|
+
[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gets URI that identifies the test.
|
|
17
|
+
* @return uri identifier of test
|
|
18
|
+
*/
|
|
19
|
+
function getTargetURI() {
|
|
20
|
+
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/documentinvalidcharacterexceptioncreatepi1";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var docsLoaded = -1000000;
|
|
24
|
+
var builder = null;
|
|
25
|
+
|
|
26
|
+
//
|
|
27
|
+
// This function is called by the testing framework before
|
|
28
|
+
// running the test suite.
|
|
29
|
+
//
|
|
30
|
+
// If there are no configuration exceptions, asynchronous
|
|
31
|
+
// document loading is started. Otherwise, the status
|
|
32
|
+
// is set to complete and the exception is immediately
|
|
33
|
+
// raised when entering the body of the test.
|
|
34
|
+
//
|
|
35
|
+
function setUpPage() {
|
|
36
|
+
setUpPageStatus = 'running';
|
|
37
|
+
try {
|
|
38
|
+
//
|
|
39
|
+
// creates test document builder, may throw exception
|
|
40
|
+
//
|
|
41
|
+
builder = createConfiguredBuilder();
|
|
42
|
+
checkFeature("XML", null);
|
|
43
|
+
|
|
44
|
+
docsLoaded = 0;
|
|
45
|
+
|
|
46
|
+
var docRef = null;
|
|
47
|
+
if (typeof(this.doc) != 'undefined') {
|
|
48
|
+
docRef = this.doc;
|
|
49
|
+
}
|
|
50
|
+
docsLoaded += preload(docRef, "doc", "hc_staff");
|
|
51
|
+
|
|
52
|
+
if (docsLoaded == 1) {
|
|
53
|
+
setUpPageStatus = 'complete';
|
|
54
|
+
}
|
|
55
|
+
} catch(ex) {
|
|
56
|
+
catchInitializationError(builder, ex);
|
|
57
|
+
setUpPageStatus = 'complete';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
//
|
|
64
|
+
// This method is called on the completion of
|
|
65
|
+
// each asychronous load started in setUpTests.
|
|
66
|
+
//
|
|
67
|
+
// When every synchronous loaded document has completed,
|
|
68
|
+
// the page status is changed which allows the
|
|
69
|
+
// body of the test to be executed.
|
|
70
|
+
function loadComplete() {
|
|
71
|
+
if (++docsLoaded == 1) {
|
|
72
|
+
setUpPageStatus = 'complete';
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
*
|
|
79
|
+
Creating a processing instruction with an empty target should cause an INVALID_CHARACTER_ERR.
|
|
80
|
+
|
|
81
|
+
* @author Curt Arnold
|
|
82
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#xpointer(id('ID-258A00AF')/constant[@name='INVALID_CHARACTER_ERR'])
|
|
83
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-135944439
|
|
84
|
+
* @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'])
|
|
85
|
+
* @see http://www.w3.org/Bugs/Public/show_bug.cgi?id=525
|
|
86
|
+
*/
|
|
87
|
+
function documentinvalidcharacterexceptioncreatepi1() {
|
|
88
|
+
var success;
|
|
89
|
+
if(checkInitialization(builder, "documentinvalidcharacterexceptioncreatepi1") != null) return;
|
|
90
|
+
var doc;
|
|
91
|
+
var badPI;
|
|
92
|
+
|
|
93
|
+
var docRef = null;
|
|
94
|
+
if (typeof(this.doc) != 'undefined') {
|
|
95
|
+
docRef = this.doc;
|
|
96
|
+
}
|
|
97
|
+
doc = load(docRef, "doc", "hc_staff");
|
|
98
|
+
|
|
99
|
+
if(
|
|
100
|
+
|
|
101
|
+
(builder.contentType == "text/html" && false /*CSA: allowed in DOM 4*/)
|
|
102
|
+
|
|
103
|
+
) {
|
|
104
|
+
|
|
105
|
+
{
|
|
106
|
+
success = false;
|
|
107
|
+
try {
|
|
108
|
+
badPI = doc.createProcessingInstruction("foo","data");
|
|
109
|
+
}
|
|
110
|
+
catch(ex) {
|
|
111
|
+
success = (typeof(ex.code) != 'undefined' && ex.code == 9);
|
|
112
|
+
}
|
|
113
|
+
assertTrue("throw_NOT_SUPPORTED_ERR",success);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
else {
|
|
119
|
+
|
|
120
|
+
{
|
|
121
|
+
success = false;
|
|
122
|
+
try {
|
|
123
|
+
badPI = doc.createProcessingInstruction("","data");
|
|
124
|
+
}
|
|
125
|
+
catch(ex) {
|
|
126
|
+
success = (typeof(ex.code) != 'undefined' && ex.code == 5);
|
|
127
|
+
}
|
|
128
|
+
assertTrue("throw_INVALID_CHARACTER_ERR",success);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
function runTest() {
|
|
139
|
+
documentinvalidcharacterexceptioncreatepi1();
|
|
140
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_nodtdstaff</title></head><body onload="parent.loadComplete()">
|
|
2
|
+
<p>
|
|
3
|
+
<em>EMP0001</em>
|
|
4
|
+
<strong>Margaret Martin</strong>
|
|
5
|
+
<code>Accountant</code>
|
|
6
|
+
<sup>56,000</sup>
|
|
7
|
+
<var>Female</var>
|
|
8
|
+
<acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
|
|
9
|
+
</p>
|
|
10
|
+
</body></html>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
2
|
+
"http://www.w3.org/TR/html4/strict.dtd" >
|
|
3
|
+
<!-- This is comment number 1.-->
|
|
4
|
+
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="svgunit.js"></script><script charset="UTF-8" type="text/javascript" src="svgtest.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="parent.loadComplete()">
|
|
5
|
+
<p>
|
|
6
|
+
<em>EMP0001</em>
|
|
7
|
+
<strong>Margaret Martin</strong>
|
|
8
|
+
<code>Accountant</code>
|
|
9
|
+
<sup>56,000</sup>
|
|
10
|
+
<var>Female</var>
|
|
11
|
+
<acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym>
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<em>EMP0002</em>
|
|
15
|
+
<strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2;
|
|
16
|
+
This is an adjacent CDATASection with a reference to a tab &tab;</strong>
|
|
17
|
+
<code>Secretary</code>
|
|
18
|
+
<sup>35,000</sup>
|
|
19
|
+
<var>Female</var>
|
|
20
|
+
<acronym title="Yes" class="Yes">β Dallas, γ
|
|
21
|
+
98554</acronym>
|
|
22
|
+
</p>
|
|
23
|
+
<p>
|
|
24
|
+
<em>EMP0003</em>
|
|
25
|
+
<strong>Roger
|
|
26
|
+
Jones</strong>
|
|
27
|
+
<code>Department Manager</code>
|
|
28
|
+
<sup>100,000</sup>
|
|
29
|
+
<var>δ</var>
|
|
30
|
+
<acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym>
|
|
31
|
+
</p>
|
|
32
|
+
<p>
|
|
33
|
+
<em>EMP0004</em>
|
|
34
|
+
<strong>Jeny Oconnor</strong>
|
|
35
|
+
<code>Personnel Director</code>
|
|
36
|
+
<sup>95,000</sup>
|
|
37
|
+
<var>Female</var>
|
|
38
|
+
<acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym>
|
|
39
|
+
</p>
|
|
40
|
+
<p>
|
|
41
|
+
<em>EMP0005</em>
|
|
42
|
+
<strong>Robert Myers</strong>
|
|
43
|
+
<code>Computer Specialist</code>
|
|
44
|
+
<sup>90,000</sup>
|
|
45
|
+
<var>male</var>
|
|
46
|
+
<acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym>
|
|
47
|
+
</p>
|
|
48
|
+
</body></html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!ELEMENT employeeId (#PCDATA)>
|
|
2
|
+
<!ELEMENT name (#PCDATA)>
|
|
3
|
+
<!ELEMENT position (#PCDATA)>
|
|
4
|
+
<!ELEMENT salary (#PCDATA)>
|
|
5
|
+
<!ELEMENT address (#PCDATA)>
|
|
6
|
+
<!ELEMENT entElement ( #PCDATA ) >
|
|
7
|
+
<!ELEMENT gender ( #PCDATA | entElement )* >
|
|
8
|
+
<!ELEMENT employee (employeeId, name, position, salary, gender, address) >
|
|
9
|
+
<!ELEMENT staff (employee)+>
|
|
10
|
+
<!ATTLIST entElement
|
|
11
|
+
attr1 CDATA "Attr">
|
|
12
|
+
<!ATTLIST address
|
|
13
|
+
domestic CDATA #IMPLIED
|
|
14
|
+
street CDATA "Yes">
|
|
15
|
+
<!ATTLIST entElement
|
|
16
|
+
domestic CDATA "MALE" >
|
|
17
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
Copyright © 2001-2004 World Wide Web Consortium,
|
|
4
|
+
(Massachusetts Institute of Technology, European Research Consortium
|
|
5
|
+
for Informatics and Mathematics, Keio University). All
|
|
6
|
+
Rights Reserved. This work is distributed under the W3C® Software License [1] in the
|
|
7
|
+
hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
|
8
|
+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
9
|
+
|
|
10
|
+
[1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gets URI that identifies the test.
|
|
17
|
+
* @return uri identifier of test
|
|
18
|
+
*/
|
|
19
|
+
function getTargetURI() {
|
|
20
|
+
return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_characterdataappenddata";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var docsLoaded = -1000000;
|
|
24
|
+
var builder = null;
|
|
25
|
+
|
|
26
|
+
//
|
|
27
|
+
// This function is called by the testing framework before
|
|
28
|
+
// running the test suite.
|
|
29
|
+
//
|
|
30
|
+
// If there are no configuration exceptions, asynchronous
|
|
31
|
+
// document loading is started. Otherwise, the status
|
|
32
|
+
// is set to complete and the exception is immediately
|
|
33
|
+
// raised when entering the body of the test.
|
|
34
|
+
//
|
|
35
|
+
function setUpPage() {
|
|
36
|
+
setUpPageStatus = 'running';
|
|
37
|
+
try {
|
|
38
|
+
//
|
|
39
|
+
// creates test document builder, may throw exception
|
|
40
|
+
//
|
|
41
|
+
builder = createConfiguredBuilder();
|
|
42
|
+
|
|
43
|
+
docsLoaded = 0;
|
|
44
|
+
|
|
45
|
+
var docRef = null;
|
|
46
|
+
if (typeof(this.doc) != 'undefined') {
|
|
47
|
+
docRef = this.doc;
|
|
48
|
+
}
|
|
49
|
+
docsLoaded += preload(docRef, "doc", "hc_staff");
|
|
50
|
+
|
|
51
|
+
if (docsLoaded == 1) {
|
|
52
|
+
setUpPageStatus = 'complete';
|
|
53
|
+
}
|
|
54
|
+
} catch(ex) {
|
|
55
|
+
catchInitializationError(builder, ex);
|
|
56
|
+
setUpPageStatus = 'complete';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
//
|
|
63
|
+
// This method is called on the completion of
|
|
64
|
+
// each asychronous load started in setUpTests.
|
|
65
|
+
//
|
|
66
|
+
// When every synchronous loaded document has completed,
|
|
67
|
+
// the page status is changed which allows the
|
|
68
|
+
// body of the test to be executed.
|
|
69
|
+
function loadComplete() {
|
|
70
|
+
if (++docsLoaded == 1) {
|
|
71
|
+
setUpPageStatus = 'complete';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
The "appendData(arg)" method appends a string to the end
|
|
79
|
+
of the character data of the node.
|
|
80
|
+
|
|
81
|
+
Retrieve the character data from the second child
|
|
82
|
+
of the first employee. The appendData(arg) method is
|
|
83
|
+
called with arg=", Esquire". The method should append
|
|
84
|
+
the specified data to the already existing character
|
|
85
|
+
data. The new value return by the "getLength()" method
|
|
86
|
+
should be 24.
|
|
87
|
+
|
|
88
|
+
* @author Curt Arnold
|
|
89
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-72AB8359
|
|
90
|
+
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-32791A2F
|
|
91
|
+
*/
|
|
92
|
+
function hc_characterdataappenddata() {
|
|
93
|
+
var success;
|
|
94
|
+
if(checkInitialization(builder, "hc_characterdataappenddata") != null) return;
|
|
95
|
+
var doc;
|
|
96
|
+
var elementList;
|
|
97
|
+
var nameNode;
|
|
98
|
+
var child;
|
|
99
|
+
var childValue;
|
|
100
|
+
var childLength;
|
|
101
|
+
|
|
102
|
+
var docRef = null;
|
|
103
|
+
if (typeof(this.doc) != 'undefined') {
|
|
104
|
+
docRef = this.doc;
|
|
105
|
+
}
|
|
106
|
+
doc = load(docRef, "doc", "hc_staff");
|
|
107
|
+
elementList = doc.getElementsByTagName("strong");
|
|
108
|
+
nameNode = elementList.item(0);
|
|
109
|
+
child = nameNode.firstChild;
|
|
110
|
+
|
|
111
|
+
child.appendData(", Esquire");
|
|
112
|
+
childValue = child.data;
|
|
113
|
+
|
|
114
|
+
childLength = childValue.length;
|
|
115
|
+
assertEquals("characterdataAppendDataAssert",24,childLength);
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
function runTest() {
|
|
123
|
+
hc_characterdataappenddata();
|
|
124
|
+
}
|