diff options
Diffstat (limited to 'LayoutTests/dom/html/level1/core')
716 files changed, 43360 insertions, 0 deletions
diff --git a/LayoutTests/dom/html/level1/core/documentgetdoctypenodtd-expected.txt b/LayoutTests/dom/html/level1/core/documentgetdoctypenodtd-expected.txt new file mode 100644 index 0000000..85b8f6e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentgetdoctypenodtd.html b/LayoutTests/dom/html/level1/core/documentgetdoctypenodtd.html new file mode 100644 index 0000000..7edd35c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/documentgetdoctypenodtd.html @@ -0,0 +1,10 @@ +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_nodtdstaff</title><script type='text/javascript' src='selfhtml.js'></script><script charset='UTF-8' type='text/javascript' src='documentgetdoctypenodtd.js'></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/documentgetdoctypenodtd.js b/LayoutTests/dom/html/level1/core/documentgetdoctypenodtd.js new file mode 100644 index 0000000..7d475f9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref-expected.txt new file mode 100644 index 0000000..12a8e46 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreateentref.html b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.html new file mode 100644 index 0000000..3b59ac3 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="documentinvalidcharacterexceptioncreateentref.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.js b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref.js new file mode 100644 index 0000000..ce7e127 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1-expected.txt new file mode 100644 index 0000000..49aebe4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreateentref1.html b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1.html new file mode 100644 index 0000000..3b6d09c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="documentinvalidcharacterexceptioncreateentref1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1.js b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreateentref1.js new file mode 100644 index 0000000..b4d1ec9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi-expected.txt new file mode 100644 index 0000000..b8a92eb --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreatepi.html b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi.html new file mode 100644 index 0000000..198c25c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="documentinvalidcharacterexceptioncreatepi.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi.js b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi.js new file mode 100644 index 0000000..3216c53 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1-expected.txt new file mode 100644 index 0000000..d23ea1c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/documentinvalidcharacterexceptioncreatepi1.html b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1.html new file mode 100644 index 0000000..7b0f65d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="documentinvalidcharacterexceptioncreatepi1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1.js b/LayoutTests/dom/html/level1/core/documentinvalidcharacterexceptioncreatepi1.js new file mode 100644 index 0000000..fb6104d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrappendchild1-expected.txt new file mode 100644 index 0000000..dfd0980 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild1.html b/LayoutTests/dom/html/level1/core/hc_attrappendchild1.html new file mode 100644 index 0000000..6c221ac --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrappendchild1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrappendchild1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild1.js b/LayoutTests/dom/html/level1/core/hc_attrappendchild1.js new file mode 100644 index 0000000..0bb0ad9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrappendchild2-expected.txt new file mode 100644 index 0000000..a735fa0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild2.html b/LayoutTests/dom/html/level1/core/hc_attrappendchild2.html new file mode 100644 index 0000000..d074183 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrappendchild2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrappendchild2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild2.js b/LayoutTests/dom/html/level1/core/hc_attrappendchild2.js new file mode 100644 index 0000000..ac53896 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild3-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrappendchild3-expected.txt new file mode 100644 index 0000000..514c75c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild3.html b/LayoutTests/dom/html/level1/core/hc_attrappendchild3.html new file mode 100644 index 0000000..2eb0236 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrappendchild3.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrappendchild3.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild3.js b/LayoutTests/dom/html/level1/core/hc_attrappendchild3.js new file mode 100644 index 0000000..66adc3d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild4-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrappendchild4-expected.txt new file mode 100644 index 0000000..629c052 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild4.html b/LayoutTests/dom/html/level1/core/hc_attrappendchild4.html new file mode 100644 index 0000000..c6c437b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrappendchild4.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrappendchild4.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild4.js b/LayoutTests/dom/html/level1/core/hc_attrappendchild4.js new file mode 100644 index 0000000..dc70102 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild5-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrappendchild5-expected.txt new file mode 100644 index 0000000..ce4a75c --- /dev/null +++ b/LayoutTests/dom/html/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 +Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild5.html b/LayoutTests/dom/html/level1/core/hc_attrappendchild5.html new file mode 100644 index 0000000..237342f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrappendchild5.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrappendchild5.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild5.js b/LayoutTests/dom/html/level1/core/hc_attrappendchild5.js new file mode 100644 index 0000000..c9e8855 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild6-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrappendchild6-expected.txt new file mode 100644 index 0000000..83e105c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrappendchild6.html b/LayoutTests/dom/html/level1/core/hc_attrappendchild6.html new file mode 100644 index 0000000..350a45a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrappendchild6.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrappendchild6.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrappendchild6.js b/LayoutTests/dom/html/level1/core/hc_attrappendchild6.js new file mode 100644 index 0000000..01b3d80 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrchildnodes1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrchildnodes1-expected.txt new file mode 100644 index 0000000..6e7bdc3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrchildnodes1.html b/LayoutTests/dom/html/level1/core/hc_attrchildnodes1.html new file mode 100644 index 0000000..d3b0b8e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrchildnodes1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrchildnodes1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrchildnodes1.js b/LayoutTests/dom/html/level1/core/hc_attrchildnodes1.js new file mode 100644 index 0000000..ac088f4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrchildnodes2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrchildnodes2-expected.txt new file mode 100644 index 0000000..db98264 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrchildnodes2.html b/LayoutTests/dom/html/level1/core/hc_attrchildnodes2.html new file mode 100644 index 0000000..9b00027 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrchildnodes2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrchildnodes2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrchildnodes2.js b/LayoutTests/dom/html/level1/core/hc_attrchildnodes2.js new file mode 100644 index 0000000..c6c6cd5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrclonenode1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrclonenode1-expected.txt new file mode 100644 index 0000000..c385eac --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrclonenode1.html b/LayoutTests/dom/html/level1/core/hc_attrclonenode1.html new file mode 100644 index 0000000..ce88477 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrclonenode1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrclonenode1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrclonenode1.js b/LayoutTests/dom/html/level1/core/hc_attrclonenode1.js new file mode 100644 index 0000000..7667e85 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrcreatedocumentfragment-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrcreatedocumentfragment-expected.txt new file mode 100644 index 0000000..eb91cb9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrcreatedocumentfragment.html b/LayoutTests/dom/html/level1/core/hc_attrcreatedocumentfragment.html new file mode 100644 index 0000000..510aea7 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrcreatedocumentfragment.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrcreatedocumentfragment.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrcreatedocumentfragment.js b/LayoutTests/dom/html/level1/core/hc_attrcreatedocumentfragment.js new file mode 100644 index 0000000..b35e00f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrcreatetextnode-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode-expected.txt new file mode 100644 index 0000000..e9fc2af --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrcreatetextnode.html b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode.html new file mode 100644 index 0000000..227e0a0 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrcreatetextnode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode.js b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode.js new file mode 100644 index 0000000..0298426 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrcreatetextnode2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode2-expected.txt new file mode 100644 index 0000000..4350fb8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrcreatetextnode2.html b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode2.html new file mode 100644 index 0000000..a9eb542 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrcreatetextnode2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode2.js b/LayoutTests/dom/html/level1/core/hc_attrcreatetextnode2.js new file mode 100644 index 0000000..bfa0d05 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attreffectivevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_attreffectivevalue-expected.txt new file mode 100644 index 0000000..c6e6ad0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attreffectivevalue.html b/LayoutTests/dom/html/level1/core/hc_attreffectivevalue.html new file mode 100644 index 0000000..8a9bc35 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attreffectivevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attreffectivevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attreffectivevalue.js b/LayoutTests/dom/html/level1/core/hc_attreffectivevalue.js new file mode 100644 index 0000000..89a41c0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrfirstchild-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrfirstchild-expected.txt new file mode 100644 index 0000000..a08ebfe --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrfirstchild.html b/LayoutTests/dom/html/level1/core/hc_attrfirstchild.html new file mode 100644 index 0000000..834b534 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrfirstchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrfirstchild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrfirstchild.js b/LayoutTests/dom/html/level1/core/hc_attrfirstchild.js new file mode 100644 index 0000000..68f8b52 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrgetvalue1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrgetvalue1-expected.txt new file mode 100644 index 0000000..e10e715 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrgetvalue1.html b/LayoutTests/dom/html/level1/core/hc_attrgetvalue1.html new file mode 100644 index 0000000..451f8ee --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrgetvalue1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrgetvalue1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrgetvalue1.js b/LayoutTests/dom/html/level1/core/hc_attrgetvalue1.js new file mode 100644 index 0000000..9ee328c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrgetvalue2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrgetvalue2-expected.txt new file mode 100644 index 0000000..c1082cb --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrgetvalue2-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrgetvalue2 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_attrgetvalue2.html b/LayoutTests/dom/html/level1/core/hc_attrgetvalue2.html new file mode 100644 index 0000000..4bb7bb8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrgetvalue2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrgetvalue2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrgetvalue2.js b/LayoutTests/dom/html/level1/core/hc_attrgetvalue2.js new file mode 100644 index 0000000..94cc2ae --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrhaschildnodes-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrhaschildnodes-expected.txt new file mode 100644 index 0000000..fefcead --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrhaschildnodes.html b/LayoutTests/dom/html/level1/core/hc_attrhaschildnodes.html new file mode 100644 index 0000000..db784cf --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrhaschildnodes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrhaschildnodes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrhaschildnodes.js b/LayoutTests/dom/html/level1/core/hc_attrhaschildnodes.js new file mode 100644 index 0000000..71487c3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore1-expected.txt new file mode 100644 index 0000000..631492a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore1.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore1.html new file mode 100644 index 0000000..99d7ae9 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore1.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore1.js new file mode 100644 index 0000000..89aa99e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore2-expected.txt new file mode 100644 index 0000000..b2f67e1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore2.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore2.html new file mode 100644 index 0000000..77fff79 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore2.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore2.js new file mode 100644 index 0000000..cc4f50e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore3-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore3-expected.txt new file mode 100644 index 0000000..ccdb3e3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore3.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore3.html new file mode 100644 index 0000000..9870d48 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore3.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore3.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore3.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore3.js new file mode 100644 index 0000000..3cb24cd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore4-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore4-expected.txt new file mode 100644 index 0000000..264d475 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore4.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore4.html new file mode 100644 index 0000000..66a4ea8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore4.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore4.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore4.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore4.js new file mode 100644 index 0000000..700e61d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore5-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore5-expected.txt new file mode 100644 index 0000000..87b5b69 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore5.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore5.html new file mode 100644 index 0000000..93a3e41 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore5.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore5.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore5.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore5.js new file mode 100644 index 0000000..a9737ed --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore6-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore6-expected.txt new file mode 100644 index 0000000..ee3fbfc --- /dev/null +++ b/LayoutTests/dom/html/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 +Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore6.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore6.html new file mode 100644 index 0000000..e68639d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore6.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore6.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore6.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore6.js new file mode 100644 index 0000000..dc04f62 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore7-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore7-expected.txt new file mode 100644 index 0000000..880ed5c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrinsertbefore7.html b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore7.html new file mode 100644 index 0000000..5304a3f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore7.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrinsertbefore7.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrinsertbefore7.js b/LayoutTests/dom/html/level1/core/hc_attrinsertbefore7.js new file mode 100644 index 0000000..f014502 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrlastchild-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrlastchild-expected.txt new file mode 100644 index 0000000..14472ba --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrlastchild.html b/LayoutTests/dom/html/level1/core/hc_attrlastchild.html new file mode 100644 index 0000000..b362a7a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrlastchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrlastchild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrlastchild.js b/LayoutTests/dom/html/level1/core/hc_attrlastchild.js new file mode 100644 index 0000000..1df7342 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrname-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrname-expected.txt new file mode 100644 index 0000000..1cb8d98 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrname.html b/LayoutTests/dom/html/level1/core/hc_attrname.html new file mode 100644 index 0000000..b93b715 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrname.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrname.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrname.js b/LayoutTests/dom/html/level1/core/hc_attrname.js new file mode 100644 index 0000000..890fae1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrnextsiblingnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrnextsiblingnull-expected.txt new file mode 100644 index 0000000..aef94d3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrnextsiblingnull.html b/LayoutTests/dom/html/level1/core/hc_attrnextsiblingnull.html new file mode 100644 index 0000000..ff2d600 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrnextsiblingnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrnextsiblingnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrnextsiblingnull.js b/LayoutTests/dom/html/level1/core/hc_attrnextsiblingnull.js new file mode 100644 index 0000000..12fc9f9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrnormalize-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrnormalize-expected.txt new file mode 100644 index 0000000..b852409 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrnormalize.html b/LayoutTests/dom/html/level1/core/hc_attrnormalize.html new file mode 100644 index 0000000..7e41a62 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrnormalize.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrnormalize.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrnormalize.js b/LayoutTests/dom/html/level1/core/hc_attrnormalize.js new file mode 100644 index 0000000..d9f5e29 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrparentnodenull-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrparentnodenull-expected.txt new file mode 100644 index 0000000..c92e147 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrparentnodenull.html b/LayoutTests/dom/html/level1/core/hc_attrparentnodenull.html new file mode 100644 index 0000000..679e7bb --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrparentnodenull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrparentnodenull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrparentnodenull.js b/LayoutTests/dom/html/level1/core/hc_attrparentnodenull.js new file mode 100644 index 0000000..3c6a403 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrprevioussiblingnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrprevioussiblingnull-expected.txt new file mode 100644 index 0000000..94e1c20 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrprevioussiblingnull.html b/LayoutTests/dom/html/level1/core/hc_attrprevioussiblingnull.html new file mode 100644 index 0000000..ce7f373 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrprevioussiblingnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrprevioussiblingnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrprevioussiblingnull.js b/LayoutTests/dom/html/level1/core/hc_attrprevioussiblingnull.js new file mode 100644 index 0000000..2773718 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrremovechild1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrremovechild1-expected.txt new file mode 100644 index 0000000..eb15e21 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrremovechild1.html b/LayoutTests/dom/html/level1/core/hc_attrremovechild1.html new file mode 100644 index 0000000..7ec22ff --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrremovechild1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrremovechild1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrremovechild1.js b/LayoutTests/dom/html/level1/core/hc_attrremovechild1.js new file mode 100644 index 0000000..5f98746 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrremovechild2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrremovechild2-expected.txt new file mode 100644 index 0000000..4f37a49 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrremovechild2.html b/LayoutTests/dom/html/level1/core/hc_attrremovechild2.html new file mode 100644 index 0000000..f8057f6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrremovechild2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrremovechild2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrremovechild2.js b/LayoutTests/dom/html/level1/core/hc_attrremovechild2.js new file mode 100644 index 0000000..3e19f4e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrreplacechild1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrreplacechild1-expected.txt new file mode 100644 index 0000000..c76d0a5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrreplacechild1.html b/LayoutTests/dom/html/level1/core/hc_attrreplacechild1.html new file mode 100644 index 0000000..be52c6d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrreplacechild1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrreplacechild1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrreplacechild1.js b/LayoutTests/dom/html/level1/core/hc_attrreplacechild1.js new file mode 100644 index 0000000..ff499e5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrreplacechild2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrreplacechild2-expected.txt new file mode 100644 index 0000000..798bea3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrreplacechild2.html b/LayoutTests/dom/html/level1/core/hc_attrreplacechild2.html new file mode 100644 index 0000000..1b272ec --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrreplacechild2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrreplacechild2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrreplacechild2.js b/LayoutTests/dom/html/level1/core/hc_attrreplacechild2.js new file mode 100644 index 0000000..c26d316 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrsetvalue1-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrsetvalue1-expected.txt new file mode 100644 index 0000000..edfe74b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrsetvalue1.html b/LayoutTests/dom/html/level1/core/hc_attrsetvalue1.html new file mode 100644 index 0000000..20cbcec --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrsetvalue1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrsetvalue1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrsetvalue1.js b/LayoutTests/dom/html/level1/core/hc_attrsetvalue1.js new file mode 100644 index 0000000..457f7b6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrsetvalue2-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrsetvalue2-expected.txt new file mode 100644 index 0000000..34743da --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrsetvalue2.html b/LayoutTests/dom/html/level1/core/hc_attrsetvalue2.html new file mode 100644 index 0000000..55150ca --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrsetvalue2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrsetvalue2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrsetvalue2.js b/LayoutTests/dom/html/level1/core/hc_attrsetvalue2.js new file mode 100644 index 0000000..029d7d5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrspecifiedvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvalue-expected.txt new file mode 100644 index 0000000..54d18d3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrspecifiedvalue.html b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvalue.html new file mode 100644 index 0000000..a1d316d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrspecifiedvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrspecifiedvalue.js b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvalue.js new file mode 100644 index 0000000..deb504d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrspecifiedvaluechanged-expected.txt b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvaluechanged-expected.txt new file mode 100644 index 0000000..29cda70 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_attrspecifiedvaluechanged.html b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvaluechanged.html new file mode 100644 index 0000000..5694f7e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvaluechanged.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_attrspecifiedvaluechanged.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_attrspecifiedvaluechanged.js b/LayoutTests/dom/html/level1/core/hc_attrspecifiedvaluechanged.js new file mode 100644 index 0000000..fd65931 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataappenddata-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataappenddata-expected.txt new file mode 100644 index 0000000..825535f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataappenddata.html b/LayoutTests/dom/html/level1/core/hc_characterdataappenddata.html new file mode 100644 index 0000000..054fe6b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataappenddata.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataappenddata.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataappenddata.js b/LayoutTests/dom/html/level1/core/hc_characterdataappenddata.js new file mode 100644 index 0000000..a479174 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataappenddatagetdata-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataappenddatagetdata-expected.txt new file mode 100644 index 0000000..c041751 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataappenddatagetdata.html b/LayoutTests/dom/html/level1/core/hc_characterdataappenddatagetdata.html new file mode 100644 index 0000000..8d0eaed --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataappenddatagetdata.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataappenddatagetdata.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataappenddatagetdata.js b/LayoutTests/dom/html/level1/core/hc_characterdataappenddatagetdata.js new file mode 100644 index 0000000..4aed0ce --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedatabegining-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatabegining-expected.txt new file mode 100644 index 0000000..55361c4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedatabegining.html b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatabegining.html new file mode 100644 index 0000000..18f0a58 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatabegining.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatadeletedatabegining.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatabegining.js b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatabegining.js new file mode 100644 index 0000000..8fc32ed --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedataend-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataend-expected.txt new file mode 100644 index 0000000..4effc83 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedataend.html b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataend.html new file mode 100644 index 0000000..d2524be --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataend.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatadeletedataend.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataend.js b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataend.js new file mode 100644 index 0000000..8d567d0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedataexceedslength-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataexceedslength-expected.txt new file mode 100644 index 0000000..c9ea475 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedataexceedslength.html b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataexceedslength.html new file mode 100644 index 0000000..97b5a92 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataexceedslength.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatadeletedataexceedslength.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataexceedslength.js b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedataexceedslength.js new file mode 100644 index 0000000..4dccc5e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatagetlengthanddata-expected.txt new file mode 100644 index 0000000..05715b1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedatagetlengthanddata.html b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatagetlengthanddata.html new file mode 100644 index 0000000..2148fb3 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatagetlengthanddata.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatadeletedatagetlengthanddata.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatagetlengthanddata.js b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatagetlengthanddata.js new file mode 100644 index 0000000..b3784f3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedatamiddle-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatamiddle-expected.txt new file mode 100644 index 0000000..46b1ad8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatadeletedatamiddle.html b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatamiddle.html new file mode 100644 index 0000000..06fc126 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatamiddle.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatadeletedatamiddle.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatamiddle.js b/LayoutTests/dom/html/level1/core/hc_characterdatadeletedatamiddle.js new file mode 100644 index 0000000..9afa810 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatagetdata-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatagetdata-expected.txt new file mode 100644 index 0000000..f09b690 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatagetdata.html b/LayoutTests/dom/html/level1/core/hc_characterdatagetdata.html new file mode 100644 index 0000000..d099f6b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatagetdata.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatagetdata.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatagetdata.js b/LayoutTests/dom/html/level1/core/hc_characterdatagetdata.js new file mode 100644 index 0000000..ef16bb0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatagetlength-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatagetlength-expected.txt new file mode 100644 index 0000000..c642592 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatagetlength.html b/LayoutTests/dom/html/level1/core/hc_characterdatagetlength.html new file mode 100644 index 0000000..742fb44 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatagetlength.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatagetlength.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatagetlength.js b/LayoutTests/dom/html/level1/core/hc_characterdatagetlength.js new file mode 100644 index 0000000..214b14c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative-expected.txt new file mode 100644 index 0000000..8a76fdf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.html new file mode 100644 index 0000000..85227a0 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrdeletedatacountnegative.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedatacountnegative.js new file mode 100644 index 0000000..9d03881 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater-expected.txt new file mode 100644 index 0000000..1b7782f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.html new file mode 100644 index 0000000..2f8d186 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrdeletedataoffsetgreater.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetgreater.js new file mode 100644 index 0000000..a66a6c1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative-expected.txt new file mode 100644 index 0000000..ce1be33 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.html new file mode 100644 index 0000000..5e4f0d6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrdeletedataoffsetnegative.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrdeletedataoffsetnegative.js new file mode 100644 index 0000000..ca26f7d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater-expected.txt new file mode 100644 index 0000000..434f5e6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.html new file mode 100644 index 0000000..3fd4cec --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrinsertdataoffsetgreater.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetgreater.js new file mode 100644 index 0000000..0abfe7e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative-expected.txt new file mode 100644 index 0000000..e114ede --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.html new file mode 100644 index 0000000..acfac05 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrinsertdataoffsetnegative.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrinsertdataoffsetnegative.js new file mode 100644 index 0000000..4712b94 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative-expected.txt new file mode 100644 index 0000000..d853344 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.html new file mode 100644 index 0000000..7314f13 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrreplacedatacountnegative.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedatacountnegative.js new file mode 100644 index 0000000..7a2b7d2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater-expected.txt new file mode 100644 index 0000000..db9fa89 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.html new file mode 100644 index 0000000..7323060 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrreplacedataoffsetgreater.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetgreater.js new file mode 100644 index 0000000..dc62aa7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative-expected.txt new file mode 100644 index 0000000..0fdb1de --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.html new file mode 100644 index 0000000..e8892ee --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrreplacedataoffsetnegative.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrreplacedataoffsetnegative.js new file mode 100644 index 0000000..af267df --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative-expected.txt new file mode 100644 index 0000000..71641dd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.html new file mode 100644 index 0000000..2a5a917 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrsubstringcountnegative.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringcountnegative.js new file mode 100644 index 0000000..2e96dbe --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset-expected.txt new file mode 100644 index 0000000..95dcabf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.html new file mode 100644 index 0000000..58f2152 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrsubstringnegativeoffset.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringnegativeoffset.js new file mode 100644 index 0000000..bc2fbf1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater-expected.txt new file mode 100644 index 0000000..b53c957 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.html b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.html new file mode 100644 index 0000000..ab662c8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdataindexsizeerrsubstringoffsetgreater.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js b/LayoutTests/dom/html/level1/core/hc_characterdataindexsizeerrsubstringoffsetgreater.js new file mode 100644 index 0000000..65325c7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatainsertdatabeginning-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatabeginning-expected.txt new file mode 100644 index 0000000..a8b179a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatainsertdatabeginning.html b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatabeginning.html new file mode 100644 index 0000000..fd9b1d0 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatabeginning.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatainsertdatabeginning.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatabeginning.js b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatabeginning.js new file mode 100644 index 0000000..576e855 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatainsertdataend-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdataend-expected.txt new file mode 100644 index 0000000..56f9db6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatainsertdataend.html b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdataend.html new file mode 100644 index 0000000..9606105 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdataend.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatainsertdataend.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatainsertdataend.js b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdataend.js new file mode 100644 index 0000000..424f776 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatainsertdatamiddle-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatamiddle-expected.txt new file mode 100644 index 0000000..a095db9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatainsertdatamiddle.html b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatamiddle.html new file mode 100644 index 0000000..cc28b54 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatamiddle.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatainsertdatamiddle.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatamiddle.js b/LayoutTests/dom/html/level1/core/hc_characterdatainsertdatamiddle.js new file mode 100644 index 0000000..081714c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedatabegining-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatabegining-expected.txt new file mode 100644 index 0000000..25627d9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedatabegining.html b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatabegining.html new file mode 100644 index 0000000..d229f77 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatabegining.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatareplacedatabegining.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatabegining.js b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatabegining.js new file mode 100644 index 0000000..2f5820d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedataend-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataend-expected.txt new file mode 100644 index 0000000..c476a3d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedataend.html b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataend.html new file mode 100644 index 0000000..cc046e9 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataend.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatareplacedataend.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataend.js b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataend.js new file mode 100644 index 0000000..8c01d58 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofarg-expected.txt new file mode 100644 index 0000000..90edeef --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedataexceedslengthofarg.html b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofarg.html new file mode 100644 index 0000000..58785d1 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofarg.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatareplacedataexceedslengthofarg.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofarg.js b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofarg.js new file mode 100644 index 0000000..a9cf8e2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofdata-expected.txt new file mode 100644 index 0000000..ea8fb30 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedataexceedslengthofdata.html b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofdata.html new file mode 100644 index 0000000..03e8938 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofdata.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatareplacedataexceedslengthofdata.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofdata.js b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedataexceedslengthofdata.js new file mode 100644 index 0000000..b2b4205 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedatamiddle-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatamiddle-expected.txt new file mode 100644 index 0000000..6ad4ce2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatareplacedatamiddle.html b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatamiddle.html new file mode 100644 index 0000000..2f61916 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatamiddle.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatareplacedatamiddle.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatamiddle.js b/LayoutTests/dom/html/level1/core/hc_characterdatareplacedatamiddle.js new file mode 100644 index 0000000..6558cde --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatasetnodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatasetnodevalue-expected.txt new file mode 100644 index 0000000..c1a6d02 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatasetnodevalue.html b/LayoutTests/dom/html/level1/core/hc_characterdatasetnodevalue.html new file mode 100644 index 0000000..eb6d45e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatasetnodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatasetnodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatasetnodevalue.js b/LayoutTests/dom/html/level1/core/hc_characterdatasetnodevalue.js new file mode 100644 index 0000000..e56ce72 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringexceedsvalue-expected.txt new file mode 100644 index 0000000..852506b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatasubstringexceedsvalue.html b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringexceedsvalue.html new file mode 100644 index 0000000..443ec8d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringexceedsvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatasubstringexceedsvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatasubstringexceedsvalue.js b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringexceedsvalue.js new file mode 100644 index 0000000..043dac2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatasubstringvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringvalue-expected.txt new file mode 100644 index 0000000..fed5479 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_characterdatasubstringvalue.html b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringvalue.html new file mode 100644 index 0000000..a057130 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_characterdatasubstringvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_characterdatasubstringvalue.js b/LayoutTests/dom/html/level1/core/hc_characterdatasubstringvalue.js new file mode 100644 index 0000000..379e3b0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_commentgetcomment-expected.txt b/LayoutTests/dom/html/level1/core/hc_commentgetcomment-expected.txt new file mode 100644 index 0000000..f4b06c3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_commentgetcomment.html b/LayoutTests/dom/html/level1/core/hc_commentgetcomment.html new file mode 100644 index 0000000..0203a96 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_commentgetcomment.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_commentgetcomment.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_commentgetcomment.js b/LayoutTests/dom/html/level1/core/hc_commentgetcomment.js new file mode 100644 index 0000000..b7c76b4 --- /dev/null +++ b/LayoutTests/dom/html/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 + '<!--' and ending '-->' + 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/html/level1/core/hc_documentcreateattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentcreateattribute-expected.txt new file mode 100644 index 0000000..d339c54 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreateattribute.html b/LayoutTests/dom/html/level1/core/hc_documentcreateattribute.html new file mode 100644 index 0000000..1741b72 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentcreateattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentcreateattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentcreateattribute.js b/LayoutTests/dom/html/level1/core/hc_documentcreateattribute.js new file mode 100644 index 0000000..31284f3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreatecomment-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentcreatecomment-expected.txt new file mode 100644 index 0000000..cea5920 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreatecomment.html b/LayoutTests/dom/html/level1/core/hc_documentcreatecomment.html new file mode 100644 index 0000000..d027a7e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentcreatecomment.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentcreatecomment.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentcreatecomment.js b/LayoutTests/dom/html/level1/core/hc_documentcreatecomment.js new file mode 100644 index 0000000..fdd69a8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreatedocumentfragment-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentcreatedocumentfragment-expected.txt new file mode 100644 index 0000000..5b4b366 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreatedocumentfragment.html b/LayoutTests/dom/html/level1/core/hc_documentcreatedocumentfragment.html new file mode 100644 index 0000000..566212e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentcreatedocumentfragment.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentcreatedocumentfragment.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentcreatedocumentfragment.js b/LayoutTests/dom/html/level1/core/hc_documentcreatedocumentfragment.js new file mode 100644 index 0000000..40240c5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreateelement-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentcreateelement-expected.txt new file mode 100644 index 0000000..2a43193 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreateelement.html b/LayoutTests/dom/html/level1/core/hc_documentcreateelement.html new file mode 100644 index 0000000..f7eeefe --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentcreateelement.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentcreateelement.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentcreateelement.js b/LayoutTests/dom/html/level1/core/hc_documentcreateelement.js new file mode 100644 index 0000000..fbba09a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreateelementcasesensitive-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentcreateelementcasesensitive-expected.txt new file mode 100644 index 0000000..217a461 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreateelementcasesensitive.html b/LayoutTests/dom/html/level1/core/hc_documentcreateelementcasesensitive.html new file mode 100644 index 0000000..32702fd --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentcreateelementcasesensitive.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentcreateelementcasesensitive.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentcreateelementcasesensitive.js b/LayoutTests/dom/html/level1/core/hc_documentcreateelementcasesensitive.js new file mode 100644 index 0000000..a22069f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreatetextnode-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentcreatetextnode-expected.txt new file mode 100644 index 0000000..5c20f61 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentcreatetextnode.html b/LayoutTests/dom/html/level1/core/hc_documentcreatetextnode.html new file mode 100644 index 0000000..e2d30c2 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentcreatetextnode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentcreatetextnode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentcreatetextnode.js b/LayoutTests/dom/html/level1/core/hc_documentcreatetextnode.js new file mode 100644 index 0000000..8b04106 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetdoctype-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentgetdoctype-expected.txt new file mode 100644 index 0000000..9ac4410 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetdoctype.html b/LayoutTests/dom/html/level1/core/hc_documentgetdoctype.html new file mode 100644 index 0000000..401ffec --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentgetdoctype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentgetdoctype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentgetdoctype.js b/LayoutTests/dom/html/level1/core/hc_documentgetdoctype.js new file mode 100644 index 0000000..c3aa3c5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetelementsbytagnamelength-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamelength-expected.txt new file mode 100644 index 0000000..ab012b2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetelementsbytagnamelength.html b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamelength.html new file mode 100644 index 0000000..750e7f6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamelength.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentgetelementsbytagnamelength.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamelength.js b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamelength.js new file mode 100644 index 0000000..1eb3e39 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnametotallength-expected.txt new file mode 100644 index 0000000..177d660 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetelementsbytagnametotallength.html b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnametotallength.html new file mode 100644 index 0000000..08cb542 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnametotallength.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentgetelementsbytagnametotallength.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnametotallength.js b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnametotallength.js new file mode 100644 index 0000000..00fa119 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamevalue-expected.txt new file mode 100644 index 0000000..6d6f0f4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetelementsbytagnamevalue.html b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamevalue.html new file mode 100644 index 0000000..75beb59 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentgetelementsbytagnamevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamevalue.js b/LayoutTests/dom/html/level1/core/hc_documentgetelementsbytagnamevalue.js new file mode 100644 index 0000000..e9d39ed --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetimplementation-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentgetimplementation-expected.txt new file mode 100644 index 0000000..ac97756 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetimplementation.html b/LayoutTests/dom/html/level1/core/hc_documentgetimplementation.html new file mode 100644 index 0000000..1ca6bfc --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentgetimplementation.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentgetimplementation.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentgetimplementation.js b/LayoutTests/dom/html/level1/core/hc_documentgetimplementation.js new file mode 100644 index 0000000..5bb3f3b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetrootnode-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentgetrootnode-expected.txt new file mode 100644 index 0000000..d4e5ec8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentgetrootnode.html b/LayoutTests/dom/html/level1/core/hc_documentgetrootnode.html new file mode 100644 index 0000000..a29fa60 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentgetrootnode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentgetrootnode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentgetrootnode.js b/LayoutTests/dom/html/level1/core/hc_documentgetrootnode.js new file mode 100644 index 0000000..e221ff1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute-expected.txt new file mode 100644 index 0000000..3d8d095 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.html b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.html new file mode 100644 index 0000000..d9b6965 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentinvalidcharacterexceptioncreateattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute.js new file mode 100644 index 0000000..9038f2e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1-expected.txt new file mode 100644 index 0000000..b4408fc --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.html b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.html new file mode 100644 index 0000000..53d09db --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentinvalidcharacterexceptioncreateattribute1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateattribute1.js new file mode 100644 index 0000000..4f9933d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement-expected.txt new file mode 100644 index 0000000..7e034f4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement.html b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement.html new file mode 100644 index 0000000..0653e1b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentinvalidcharacterexceptioncreateelement.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement.js new file mode 100644 index 0000000..624a46a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1-expected.txt new file mode 100644 index 0000000..879a299 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.html b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.html new file mode 100644 index 0000000..13b043c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_documentinvalidcharacterexceptioncreateelement1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js b/LayoutTests/dom/html/level1/core/hc_documentinvalidcharacterexceptioncreateelement1.js new file mode 100644 index 0000000..cbf69fe --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_domimplementationfeaturenoversion-expected.txt b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenoversion-expected.txt new file mode 100644 index 0000000..38c4cda --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_domimplementationfeaturenoversion.html b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenoversion.html new file mode 100644 index 0000000..a856f51 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenoversion.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_domimplementationfeaturenoversion.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenoversion.js b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenoversion.js new file mode 100644 index 0000000..f723ce5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_domimplementationfeaturenull-expected.txt b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenull-expected.txt new file mode 100644 index 0000000..eb02e29 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_domimplementationfeaturenull.html b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenull.html new file mode 100644 index 0000000..ed2fd6b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_domimplementationfeaturenull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenull.js b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturenull.js new file mode 100644 index 0000000..bfa69f3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_domimplementationfeaturexml-expected.txt b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturexml-expected.txt new file mode 100644 index 0000000..b0e5c43 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_domimplementationfeaturexml.html b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturexml.html new file mode 100644 index 0000000..e9e3fd9 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturexml.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_domimplementationfeaturexml.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturexml.js b/LayoutTests/dom/html/level1/core/hc_domimplementationfeaturexml.js new file mode 100644 index 0000000..acd4d37 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementaddnewattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementaddnewattribute-expected.txt new file mode 100644 index 0000000..87707b3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementaddnewattribute.html b/LayoutTests/dom/html/level1/core/hc_elementaddnewattribute.html new file mode 100644 index 0000000..9052f8d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementaddnewattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementaddnewattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementaddnewattribute.js b/LayoutTests/dom/html/level1/core/hc_elementaddnewattribute.js new file mode 100644 index 0000000..90d483b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementassociatedattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementassociatedattribute-expected.txt new file mode 100644 index 0000000..12a2b07 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementassociatedattribute.html b/LayoutTests/dom/html/level1/core/hc_elementassociatedattribute.html new file mode 100644 index 0000000..62518ec --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementassociatedattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementassociatedattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementassociatedattribute.js b/LayoutTests/dom/html/level1/core/hc_elementassociatedattribute.js new file mode 100644 index 0000000..c3642a9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementchangeattributevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementchangeattributevalue-expected.txt new file mode 100644 index 0000000..849fbd3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementchangeattributevalue.html b/LayoutTests/dom/html/level1/core/hc_elementchangeattributevalue.html new file mode 100644 index 0000000..e61d422 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementchangeattributevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementchangeattributevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementchangeattributevalue.js b/LayoutTests/dom/html/level1/core/hc_elementchangeattributevalue.js new file mode 100644 index 0000000..2777f22 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementcreatenewattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementcreatenewattribute-expected.txt new file mode 100644 index 0000000..8c83fcf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementcreatenewattribute.html b/LayoutTests/dom/html/level1/core/hc_elementcreatenewattribute.html new file mode 100644 index 0000000..4b73eb2 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementcreatenewattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementcreatenewattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementcreatenewattribute.js b/LayoutTests/dom/html/level1/core/hc_elementcreatenewattribute.js new file mode 100644 index 0000000..aad9aa1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetattributenode-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetattributenode-expected.txt new file mode 100644 index 0000000..4e57f62 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetattributenode.html b/LayoutTests/dom/html/level1/core/hc_elementgetattributenode.html new file mode 100644 index 0000000..ef3d318 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetattributenode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetattributenode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetattributenode.js b/LayoutTests/dom/html/level1/core/hc_elementgetattributenode.js new file mode 100644 index 0000000..17b0106 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetattributenodenull-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetattributenodenull-expected.txt new file mode 100644 index 0000000..7189a8b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetattributenodenull.html b/LayoutTests/dom/html/level1/core/hc_elementgetattributenodenull.html new file mode 100644 index 0000000..97b03a6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetattributenodenull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetattributenodenull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetattributenodenull.js b/LayoutTests/dom/html/level1/core/hc_elementgetattributenodenull.js new file mode 100644 index 0000000..2c9a905 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementempty-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetelementempty-expected.txt new file mode 100644 index 0000000..fdcaa13 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementempty.html b/LayoutTests/dom/html/level1/core/hc_elementgetelementempty.html new file mode 100644 index 0000000..008bb9b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetelementempty.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetelementempty.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetelementempty.js b/LayoutTests/dom/html/level1/core/hc_elementgetelementempty.js new file mode 100644 index 0000000..b4ddf55 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagname-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagname-expected.txt new file mode 100644 index 0000000..2ed0f52 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagname.html b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagname.html new file mode 100644 index 0000000..290cc01 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagname.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetelementsbytagname.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagname.js b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagname.js new file mode 100644 index 0000000..bed6cfe --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist-expected.txt new file mode 100644 index 0000000..7a1daa2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist.html b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist.html new file mode 100644 index 0000000..d705501 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetelementsbytagnameaccessnodelist.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnameaccessnodelist.js new file mode 100644 index 0000000..cd53408 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamenomatch-expected.txt new file mode 100644 index 0000000..b9eb065 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagnamenomatch.html b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamenomatch.html new file mode 100644 index 0000000..d513156 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamenomatch.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetelementsbytagnamenomatch.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamenomatch.js b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamenomatch.js new file mode 100644 index 0000000..941fd4a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamespecialvalue-expected.txt new file mode 100644 index 0000000..6be0ef2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgetelementsbytagnamespecialvalue.html b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamespecialvalue.html new file mode 100644 index 0000000..65a7504 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamespecialvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgetelementsbytagnamespecialvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamespecialvalue.js b/LayoutTests/dom/html/level1/core/hc_elementgetelementsbytagnamespecialvalue.js new file mode 100644 index 0000000..3b8c10d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgettagname-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementgettagname-expected.txt new file mode 100644 index 0000000..fba9799 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementgettagname.html b/LayoutTests/dom/html/level1/core/hc_elementgettagname.html new file mode 100644 index 0000000..70c6c96 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementgettagname.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementgettagname.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementgettagname.js b/LayoutTests/dom/html/level1/core/hc_elementgettagname.js new file mode 100644 index 0000000..567d234 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementinuseattributeerr-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementinuseattributeerr-expected.txt new file mode 100644 index 0000000..0589641 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementinuseattributeerr.html b/LayoutTests/dom/html/level1/core/hc_elementinuseattributeerr.html new file mode 100644 index 0000000..a5bd5b3 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementinuseattributeerr.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementinuseattributeerr.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementinuseattributeerr.js b/LayoutTests/dom/html/level1/core/hc_elementinuseattributeerr.js new file mode 100644 index 0000000..fa2fd0a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementinvalidcharacterexception-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception-expected.txt new file mode 100644 index 0000000..033994c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementinvalidcharacterexception.html b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception.html new file mode 100644 index 0000000..9e0d631 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementinvalidcharacterexception.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception.js b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception.js new file mode 100644 index 0000000..4d581a3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementinvalidcharacterexception1-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception1-expected.txt new file mode 100644 index 0000000..589147c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementinvalidcharacterexception1.html b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception1.html new file mode 100644 index 0000000..ed99859 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementinvalidcharacterexception1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception1.js b/LayoutTests/dom/html/level1/core/hc_elementinvalidcharacterexception1.js new file mode 100644 index 0000000..5376968 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementnormalize-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementnormalize-expected.txt new file mode 100644 index 0000000..489896f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementnormalize.html b/LayoutTests/dom/html/level1/core/hc_elementnormalize.html new file mode 100644 index 0000000..7d41e93 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementnormalize.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementnormalize.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementnormalize.js b/LayoutTests/dom/html/level1/core/hc_elementnormalize.js new file mode 100644 index 0000000..c00a5bc --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementnormalize2-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementnormalize2-expected.txt new file mode 100644 index 0000000..8c46839 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementnormalize2.html b/LayoutTests/dom/html/level1/core/hc_elementnormalize2.html new file mode 100644 index 0000000..c0ba6e7 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementnormalize2.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementnormalize2.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementnormalize2.js b/LayoutTests/dom/html/level1/core/hc_elementnormalize2.js new file mode 100644 index 0000000..b2197ed --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementnotfounderr-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementnotfounderr-expected.txt new file mode 100644 index 0000000..b10c1ed --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementnotfounderr.html b/LayoutTests/dom/html/level1/core/hc_elementnotfounderr.html new file mode 100644 index 0000000..f150b70 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementnotfounderr.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementnotfounderr.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementnotfounderr.js b/LayoutTests/dom/html/level1/core/hc_elementnotfounderr.js new file mode 100644 index 0000000..ad15587 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementremoveattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementremoveattribute-expected.txt new file mode 100644 index 0000000..b269615 --- /dev/null +++ b/LayoutTests/dom/html/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 +Detail: attrValue: assertEquals failed, actual null, expected . diff --git a/LayoutTests/dom/html/level1/core/hc_elementremoveattribute.html b/LayoutTests/dom/html/level1/core/hc_elementremoveattribute.html new file mode 100644 index 0000000..8e36e24 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementremoveattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementremoveattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementremoveattribute.js b/LayoutTests/dom/html/level1/core/hc_elementremoveattribute.js new file mode 100644 index 0000000..81224e7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementremoveattributeaftercreate-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementremoveattributeaftercreate-expected.txt new file mode 100644 index 0000000..c4678d9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementremoveattributeaftercreate.html b/LayoutTests/dom/html/level1/core/hc_elementremoveattributeaftercreate.html new file mode 100644 index 0000000..c77c47f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementremoveattributeaftercreate.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementremoveattributeaftercreate.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementremoveattributeaftercreate.js b/LayoutTests/dom/html/level1/core/hc_elementremoveattributeaftercreate.js new file mode 100644 index 0000000..724a3e8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementremoveattributenode-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementremoveattributenode-expected.txt new file mode 100644 index 0000000..eba3d8a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementremoveattributenode.html b/LayoutTests/dom/html/level1/core/hc_elementremoveattributenode.html new file mode 100644 index 0000000..ca1a3f2 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementremoveattributenode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementremoveattributenode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementremoveattributenode.js b/LayoutTests/dom/html/level1/core/hc_elementremoveattributenode.js new file mode 100644 index 0000000..58bf730 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementreplaceattributewithself-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementreplaceattributewithself-expected.txt new file mode 100644 index 0000000..dcea4ba --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementreplaceattributewithself.html b/LayoutTests/dom/html/level1/core/hc_elementreplaceattributewithself.html new file mode 100644 index 0000000..6d84d65 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementreplaceattributewithself.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementreplaceattributewithself.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementreplaceattributewithself.js b/LayoutTests/dom/html/level1/core/hc_elementreplaceattributewithself.js new file mode 100644 index 0000000..14b1f7d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementreplaceexistingattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattribute-expected.txt new file mode 100644 index 0000000..6cce615 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementreplaceexistingattribute.html b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattribute.html new file mode 100644 index 0000000..bfd2ddd --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementreplaceexistingattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattribute.js b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattribute.js new file mode 100644 index 0000000..949ac3b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattributegevalue-expected.txt new file mode 100644 index 0000000..2f963f4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementreplaceexistingattributegevalue.html b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattributegevalue.html new file mode 100644 index 0000000..eb7e38a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattributegevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementreplaceexistingattributegevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattributegevalue.js b/LayoutTests/dom/html/level1/core/hc_elementreplaceexistingattributegevalue.js new file mode 100644 index 0000000..0318918 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementretrieveallattributes-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementretrieveallattributes-expected.txt new file mode 100644 index 0000000..e92f3d2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementretrieveallattributes.html b/LayoutTests/dom/html/level1/core/hc_elementretrieveallattributes.html new file mode 100644 index 0000000..58c5aff --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementretrieveallattributes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementretrieveallattributes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementretrieveallattributes.js b/LayoutTests/dom/html/level1/core/hc_elementretrieveallattributes.js new file mode 100644 index 0000000..56c79ba --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementretrieveattrvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementretrieveattrvalue-expected.txt new file mode 100644 index 0000000..e23b71f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementretrieveattrvalue.html b/LayoutTests/dom/html/level1/core/hc_elementretrieveattrvalue.html new file mode 100644 index 0000000..303ce31 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementretrieveattrvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementretrieveattrvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementretrieveattrvalue.js b/LayoutTests/dom/html/level1/core/hc_elementretrieveattrvalue.js new file mode 100644 index 0000000..288afcd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementretrievetagname-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementretrievetagname-expected.txt new file mode 100644 index 0000000..2373403 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementretrievetagname.html b/LayoutTests/dom/html/level1/core/hc_elementretrievetagname.html new file mode 100644 index 0000000..3469257 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementretrievetagname.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementretrievetagname.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementretrievetagname.js b/LayoutTests/dom/html/level1/core/hc_elementretrievetagname.js new file mode 100644 index 0000000..9208b54 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementsetattributenodenull-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementsetattributenodenull-expected.txt new file mode 100644 index 0000000..4c4b5ec --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementsetattributenodenull.html b/LayoutTests/dom/html/level1/core/hc_elementsetattributenodenull.html new file mode 100644 index 0000000..8b4e9bc --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementsetattributenodenull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementsetattributenodenull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementsetattributenodenull.js b/LayoutTests/dom/html/level1/core/hc_elementsetattributenodenull.js new file mode 100644 index 0000000..65db9d7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementwrongdocumenterr-expected.txt b/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr-expected.txt new file mode 100644 index 0000000..7b6e36d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_elementwrongdocumenterr.html b/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr.html new file mode 100644 index 0000000..7c16e78 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_elementwrongdocumenterr.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr.js b/LayoutTests/dom/html/level1/core/hc_elementwrongdocumenterr.js new file mode 100644 index 0000000..e17340c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_entitiesremovenameditem1-expected.txt b/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1-expected.txt new file mode 100644 index 0000000..7a3b1fd --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiesremovenameditem1 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1.html b/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1.html new file mode 100644 index 0000000..b609cd3 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_entitiesremovenameditem1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1.js b/LayoutTests/dom/html/level1/core/hc_entitiesremovenameditem1.js new file mode 100644 index 0000000..54ca9ff --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_entitiessetnameditem1-expected.txt b/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1-expected.txt new file mode 100644 index 0000000..4116982 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_entitiessetnameditem1 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1.html b/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1.html new file mode 100644 index 0000000..a83fff8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_entitiessetnameditem1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1.js b/LayoutTests/dom/html/level1/core/hc_entitiessetnameditem1.js new file mode 100644 index 0000000..17876c0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapchildnoderange-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapchildnoderange-expected.txt new file mode 100644 index 0000000..ac7e53f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapchildnoderange.html b/LayoutTests/dom/html/level1/core/hc_namednodemapchildnoderange.html new file mode 100644 index 0000000..11e7409 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapchildnoderange.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapchildnoderange.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapchildnoderange.js b/LayoutTests/dom/html/level1/core/hc_namednodemapchildnoderange.js new file mode 100644 index 0000000..d70da8d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapgetnameditem-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapgetnameditem-expected.txt new file mode 100644 index 0000000..5757180 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapgetnameditem.html b/LayoutTests/dom/html/level1/core/hc_namednodemapgetnameditem.html new file mode 100644 index 0000000..f91b260 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapgetnameditem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapgetnameditem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapgetnameditem.js b/LayoutTests/dom/html/level1/core/hc_namednodemapgetnameditem.js new file mode 100644 index 0000000..3fa01c4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapinuseattributeerr-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapinuseattributeerr-expected.txt new file mode 100644 index 0000000..266ca30 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapinuseattributeerr.html b/LayoutTests/dom/html/level1/core/hc_namednodemapinuseattributeerr.html new file mode 100644 index 0000000..822b814 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapinuseattributeerr.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapinuseattributeerr.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapinuseattributeerr.js b/LayoutTests/dom/html/level1/core/hc_namednodemapinuseattributeerr.js new file mode 100644 index 0000000..fdf0c15 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapnotfounderr-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapnotfounderr-expected.txt new file mode 100644 index 0000000..d8e5762 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapnotfounderr.html b/LayoutTests/dom/html/level1/core/hc_namednodemapnotfounderr.html new file mode 100644 index 0000000..617ef6f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapnotfounderr.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapnotfounderr.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapnotfounderr.js b/LayoutTests/dom/html/level1/core/hc_namednodemapnotfounderr.js new file mode 100644 index 0000000..67467c3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapnumberofnodes-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapnumberofnodes-expected.txt new file mode 100644 index 0000000..5697c32 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapnumberofnodes.html b/LayoutTests/dom/html/level1/core/hc_namednodemapnumberofnodes.html new file mode 100644 index 0000000..6a9a08a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapnumberofnodes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapnumberofnodes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapnumberofnodes.js b/LayoutTests/dom/html/level1/core/hc_namednodemapnumberofnodes.js new file mode 100644 index 0000000..b703b21 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapremovenameditem-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapremovenameditem-expected.txt new file mode 100644 index 0000000..d94949c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapremovenameditem.html b/LayoutTests/dom/html/level1/core/hc_namednodemapremovenameditem.html new file mode 100644 index 0000000..4bb6589 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapremovenameditem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapremovenameditem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapremovenameditem.js b/LayoutTests/dom/html/level1/core/hc_namednodemapremovenameditem.js new file mode 100644 index 0000000..1370fa9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnattrnode-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnattrnode-expected.txt new file mode 100644 index 0000000..137818e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnattrnode.html b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnattrnode.html new file mode 100644 index 0000000..51d1636 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnattrnode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapreturnattrnode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapreturnattrnode.js b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnattrnode.js new file mode 100644 index 0000000..bfb396b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnfirstitem-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnfirstitem-expected.txt new file mode 100644 index 0000000..93e3a80 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnfirstitem.html b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnfirstitem.html new file mode 100644 index 0000000..6a26469 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnfirstitem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapreturnfirstitem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapreturnfirstitem.js b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnfirstitem.js new file mode 100644 index 0000000..9b17c3f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnlastitem-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnlastitem-expected.txt new file mode 100644 index 0000000..1f9b0a1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnlastitem.html b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnlastitem.html new file mode 100644 index 0000000..199d202 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnlastitem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapreturnlastitem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapreturnlastitem.js b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnlastitem.js new file mode 100644 index 0000000..90422c8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnnull-expected.txt new file mode 100644 index 0000000..3483ffc --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapreturnnull.html b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnnull.html new file mode 100644 index 0000000..27cefc7 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapreturnnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapreturnnull.js b/LayoutTests/dom/html/level1/core/hc_namednodemapreturnnull.js new file mode 100644 index 0000000..04cb17e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditem-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditem-expected.txt new file mode 100644 index 0000000..f55d77a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditem.html b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditem.html new file mode 100644 index 0000000..690efef --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapsetnameditem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditem.js b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditem.js new file mode 100644 index 0000000..ffba08a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemreturnvalue-expected.txt new file mode 100644 index 0000000..a7f45f2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditemreturnvalue.html b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemreturnvalue.html new file mode 100644 index 0000000..85c52b8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemreturnvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapsetnameditemreturnvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemreturnvalue.js b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemreturnvalue.js new file mode 100644 index 0000000..0d82c40 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemthatexists-expected.txt new file mode 100644 index 0000000..55e2f86 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditemthatexists.html b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemthatexists.html new file mode 100644 index 0000000..e022169 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemthatexists.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapsetnameditemthatexists.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemthatexists.js b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemthatexists.js new file mode 100644 index 0000000..7ba88c4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemwithnewvalue-expected.txt new file mode 100644 index 0000000..2b389c3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapsetnameditemwithnewvalue.html b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemwithnewvalue.html new file mode 100644 index 0000000..d58cb17 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemwithnewvalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapsetnameditemwithnewvalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemwithnewvalue.js b/LayoutTests/dom/html/level1/core/hc_namednodemapsetnameditemwithnewvalue.js new file mode 100644 index 0000000..0ecee32 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt b/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr-expected.txt new file mode 100644 index 0000000..63a88c9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_namednodemapwrongdocumenterr.html b/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr.html new file mode 100644 index 0000000..d9aafbc --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_namednodemapwrongdocumenterr.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr.js b/LayoutTests/dom/html/level1/core/hc_namednodemapwrongdocumenterr.js new file mode 100644 index 0000000..bde21e4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchild-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchild-expected.txt new file mode 100644 index 0000000..fc8635b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchild.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchild.html new file mode 100644 index 0000000..26bc398 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchild.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchild.js new file mode 100644 index 0000000..0da5325 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildchildexists-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchildchildexists-expected.txt new file mode 100644 index 0000000..d813871 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildchildexists.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchildchildexists.html new file mode 100644 index 0000000..4ad85de --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchildchildexists.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchildchildexists.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchildchildexists.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchildchildexists.js new file mode 100644 index 0000000..2c95d9f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchilddocfragment-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchilddocfragment-expected.txt new file mode 100644 index 0000000..a9ea1c8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchilddocfragment.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchilddocfragment.html new file mode 100644 index 0000000..775926b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchilddocfragment.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchilddocfragment.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchilddocfragment.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchilddocfragment.js new file mode 100644 index 0000000..f1b95ea --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildgetnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchildgetnodename-expected.txt new file mode 100644 index 0000000..23c738c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildgetnodename.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchildgetnodename.html new file mode 100644 index 0000000..1afdd25 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchildgetnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchildgetnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchildgetnodename.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchildgetnodename.js new file mode 100644 index 0000000..f7499c5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchildinvalidnodetype-expected.txt new file mode 100644 index 0000000..4673ad8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildinvalidnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchildinvalidnodetype.html new file mode 100644 index 0000000..14b8da5 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchildinvalidnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchildinvalidnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchildinvalidnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchildinvalidnodetype.js new file mode 100644 index 0000000..854d1c3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnewchilddiffdocument-expected.txt new file mode 100644 index 0000000..bf9947e --- /dev/null +++ b/LayoutTests/dom/html/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 +Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchildnewchilddiffdocument.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnewchilddiffdocument.html new file mode 100644 index 0000000..c9a7413 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnewchilddiffdocument.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchildnewchilddiffdocument.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchildnewchilddiffdocument.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnewchilddiffdocument.js new file mode 100644 index 0000000..1be650b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildnodeancestor-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnodeancestor-expected.txt new file mode 100644 index 0000000..7dda946 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeappendchildnodeancestor.html b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnodeancestor.html new file mode 100644 index 0000000..2253ea6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnodeancestor.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeappendchildnodeancestor.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeappendchildnodeancestor.js b/LayoutTests/dom/html/level1/core/hc_nodeappendchildnodeancestor.js new file mode 100644 index 0000000..a8ba817 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodeattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeattributenodeattribute-expected.txt new file mode 100644 index 0000000..190ee42 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodeattribute.html b/LayoutTests/dom/html/level1/core/hc_nodeattributenodeattribute.html new file mode 100644 index 0000000..c1320ef --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeattributenodeattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeattributenodeattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeattributenodeattribute.js b/LayoutTests/dom/html/level1/core/hc_nodeattributenodeattribute.js new file mode 100644 index 0000000..e8443db --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeattributenodename-expected.txt new file mode 100644 index 0000000..a174ce6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodename.html b/LayoutTests/dom/html/level1/core/hc_nodeattributenodename.html new file mode 100644 index 0000000..7f6246c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeattributenodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeattributenodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeattributenodename.js b/LayoutTests/dom/html/level1/core/hc_nodeattributenodename.js new file mode 100644 index 0000000..20b8e71 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeattributenodetype-expected.txt new file mode 100644 index 0000000..50b0e7c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodetype.html b/LayoutTests/dom/html/level1/core/hc_nodeattributenodetype.html new file mode 100644 index 0000000..1551ef8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeattributenodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeattributenodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeattributenodetype.js b/LayoutTests/dom/html/level1/core/hc_nodeattributenodetype.js new file mode 100644 index 0000000..41d7f10 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeattributenodevalue-expected.txt new file mode 100644 index 0000000..d50bf03 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeattributenodevalue.html b/LayoutTests/dom/html/level1/core/hc_nodeattributenodevalue.html new file mode 100644 index 0000000..c54cb3f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeattributenodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeattributenodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeattributenodevalue.js b/LayoutTests/dom/html/level1/core/hc_nodeattributenodevalue.js new file mode 100644 index 0000000..679a9dd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodechildnodes-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodechildnodes-expected.txt new file mode 100644 index 0000000..dbbb22d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodechildnodes.html b/LayoutTests/dom/html/level1/core/hc_nodechildnodes.html new file mode 100644 index 0000000..3b0dd93 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodechildnodes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodechildnodes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodechildnodes.js b/LayoutTests/dom/html/level1/core/hc_nodechildnodes.js new file mode 100644 index 0000000..855ec35 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodechildnodesappendchild-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodechildnodesappendchild-expected.txt new file mode 100644 index 0000000..a792f31 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodechildnodesappendchild.html b/LayoutTests/dom/html/level1/core/hc_nodechildnodesappendchild.html new file mode 100644 index 0000000..bc69c6a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodechildnodesappendchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodechildnodesappendchild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodechildnodesappendchild.js b/LayoutTests/dom/html/level1/core/hc_nodechildnodesappendchild.js new file mode 100644 index 0000000..a262e24 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodechildnodesempty-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodechildnodesempty-expected.txt new file mode 100644 index 0000000..7d7be7b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodechildnodesempty.html b/LayoutTests/dom/html/level1/core/hc_nodechildnodesempty.html new file mode 100644 index 0000000..b721fda --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodechildnodesempty.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodechildnodesempty.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodechildnodesempty.js b/LayoutTests/dom/html/level1/core/hc_nodechildnodesempty.js new file mode 100644 index 0000000..612307c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecloneattributescopied-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodecloneattributescopied-expected.txt new file mode 100644 index 0000000..6bff5de --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecloneattributescopied.html b/LayoutTests/dom/html/level1/core/hc_nodecloneattributescopied.html new file mode 100644 index 0000000..7543344 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodecloneattributescopied.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodecloneattributescopied.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodecloneattributescopied.js b/LayoutTests/dom/html/level1/core/hc_nodecloneattributescopied.js new file mode 100644 index 0000000..d753c4b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonefalsenocopytext-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeclonefalsenocopytext-expected.txt new file mode 100644 index 0000000..0ad515f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonefalsenocopytext.html b/LayoutTests/dom/html/level1/core/hc_nodeclonefalsenocopytext.html new file mode 100644 index 0000000..4ad78fc --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeclonefalsenocopytext.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeclonefalsenocopytext.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeclonefalsenocopytext.js b/LayoutTests/dom/html/level1/core/hc_nodeclonefalsenocopytext.js new file mode 100644 index 0000000..8d41464 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonegetparentnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeclonegetparentnull-expected.txt new file mode 100644 index 0000000..8ef68da --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonegetparentnull.html b/LayoutTests/dom/html/level1/core/hc_nodeclonegetparentnull.html new file mode 100644 index 0000000..885373d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeclonegetparentnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeclonegetparentnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeclonegetparentnull.js b/LayoutTests/dom/html/level1/core/hc_nodeclonegetparentnull.js new file mode 100644 index 0000000..ab52c8a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonenodefalse-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeclonenodefalse-expected.txt new file mode 100644 index 0000000..4f13cce --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonenodefalse.html b/LayoutTests/dom/html/level1/core/hc_nodeclonenodefalse.html new file mode 100644 index 0000000..a445e54 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeclonenodefalse.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeclonenodefalse.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeclonenodefalse.js b/LayoutTests/dom/html/level1/core/hc_nodeclonenodefalse.js new file mode 100644 index 0000000..7d48edf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonenodetrue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeclonenodetrue-expected.txt new file mode 100644 index 0000000..f501b19 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonenodetrue.html b/LayoutTests/dom/html/level1/core/hc_nodeclonenodetrue.html new file mode 100644 index 0000000..8964aff --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeclonenodetrue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeclonenodetrue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeclonenodetrue.js b/LayoutTests/dom/html/level1/core/hc_nodeclonenodetrue.js new file mode 100644 index 0000000..5eba8cd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonetruecopytext-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeclonetruecopytext-expected.txt new file mode 100644 index 0000000..45446d1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeclonetruecopytext.html b/LayoutTests/dom/html/level1/core/hc_nodeclonetruecopytext.html new file mode 100644 index 0000000..53404f0 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeclonetruecopytext.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeclonetruecopytext.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeclonetruecopytext.js b/LayoutTests/dom/html/level1/core/hc_nodeclonetruecopytext.js new file mode 100644 index 0000000..c12370b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodeattributes-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodecommentnodeattributes-expected.txt new file mode 100644 index 0000000..6b34ee0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodeattributes.html b/LayoutTests/dom/html/level1/core/hc_nodecommentnodeattributes.html new file mode 100644 index 0000000..4237302 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodecommentnodeattributes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodecommentnodeattributes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodecommentnodeattributes.js b/LayoutTests/dom/html/level1/core/hc_nodecommentnodeattributes.js new file mode 100644 index 0000000..7e3e2e9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodecommentnodename-expected.txt new file mode 100644 index 0000000..f2cb340 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodename.html b/LayoutTests/dom/html/level1/core/hc_nodecommentnodename.html new file mode 100644 index 0000000..ee05182 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodecommentnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodecommentnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodecommentnodename.js b/LayoutTests/dom/html/level1/core/hc_nodecommentnodename.js new file mode 100644 index 0000000..de7013a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodecommentnodetype-expected.txt new file mode 100644 index 0000000..cca3a71 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodecommentnodetype.html new file mode 100644 index 0000000..ae52053 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodecommentnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodecommentnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodecommentnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodecommentnodetype.js new file mode 100644 index 0000000..168b918 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodecommentnodevalue-expected.txt new file mode 100644 index 0000000..f70ff88 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodecommentnodevalue.html b/LayoutTests/dom/html/level1/core/hc_nodecommentnodevalue.html new file mode 100644 index 0000000..03e8bbe --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodecommentnodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodecommentnodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodecommentnodevalue.js b/LayoutTests/dom/html/level1/core/hc_nodecommentnodevalue.js new file mode 100644 index 0000000..64e35b2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentfragmentnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodename-expected.txt new file mode 100644 index 0000000..df8afe5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentfragmentnodename.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodename.html new file mode 100644 index 0000000..7df2d79 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentfragmentnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodename.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodename.js new file mode 100644 index 0000000..4c3b8f2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentfragmentnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodetype-expected.txt new file mode 100644 index 0000000..ea7c75e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentfragmentnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodetype.html new file mode 100644 index 0000000..7760a09 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentfragmentnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodetype.js new file mode 100644 index 0000000..404dcd4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodevalue-expected.txt new file mode 100644 index 0000000..ff2870d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentfragmentnodevalue.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodevalue.html new file mode 100644 index 0000000..59f3c89 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentfragmentnodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodevalue.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentfragmentnodevalue.js new file mode 100644 index 0000000..3817faf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodeattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodeattribute-expected.txt new file mode 100644 index 0000000..f589a92 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodeattribute.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodeattribute.html new file mode 100644 index 0000000..7943311 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodeattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentnodeattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentnodeattribute.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodeattribute.js new file mode 100644 index 0000000..0509317 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodename-expected.txt new file mode 100644 index 0000000..8c17fa2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodename.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodename.html new file mode 100644 index 0000000..473ff55 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentnodename.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodename.js new file mode 100644 index 0000000..7cdef03 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodetype-expected.txt new file mode 100644 index 0000000..856611e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodetype.html new file mode 100644 index 0000000..1299eda --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodetype.js new file mode 100644 index 0000000..12ac065 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodevalue-expected.txt new file mode 100644 index 0000000..a3e77ef --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodedocumentnodevalue.html b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodevalue.html new file mode 100644 index 0000000..41c02dc --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodedocumentnodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodedocumentnodevalue.js b/LayoutTests/dom/html/level1/core/hc_nodedocumentnodevalue.js new file mode 100644 index 0000000..6cd8934 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodeattributes-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeelementnodeattributes-expected.txt new file mode 100644 index 0000000..213286c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodeattributes.html b/LayoutTests/dom/html/level1/core/hc_nodeelementnodeattributes.html new file mode 100644 index 0000000..12b374a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeelementnodeattributes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeelementnodeattributes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeelementnodeattributes.js b/LayoutTests/dom/html/level1/core/hc_nodeelementnodeattributes.js new file mode 100644 index 0000000..7046cdd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeelementnodename-expected.txt new file mode 100644 index 0000000..bc670d5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodename.html b/LayoutTests/dom/html/level1/core/hc_nodeelementnodename.html new file mode 100644 index 0000000..8320054 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeelementnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeelementnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeelementnodename.js b/LayoutTests/dom/html/level1/core/hc_nodeelementnodename.js new file mode 100644 index 0000000..693d23e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeelementnodetype-expected.txt new file mode 100644 index 0000000..85e912c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodeelementnodetype.html new file mode 100644 index 0000000..0c337e6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeelementnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeelementnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeelementnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodeelementnodetype.js new file mode 100644 index 0000000..56dd936 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeelementnodevalue-expected.txt new file mode 100644 index 0000000..39f7753 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeelementnodevalue.html b/LayoutTests/dom/html/level1/core/hc_nodeelementnodevalue.html new file mode 100644 index 0000000..d301e12 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeelementnodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeelementnodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeelementnodevalue.js b/LayoutTests/dom/html/level1/core/hc_nodeelementnodevalue.js new file mode 100644 index 0000000..29124cf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetfirstchild-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchild-expected.txt new file mode 100644 index 0000000..75a19e7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetfirstchild.html b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchild.html new file mode 100644 index 0000000..3de1d2b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetfirstchild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetfirstchild.js b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchild.js new file mode 100644 index 0000000..a4681f0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetfirstchildnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchildnull-expected.txt new file mode 100644 index 0000000..7912b05 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetfirstchildnull.html b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchildnull.html new file mode 100644 index 0000000..a682077 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchildnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetfirstchildnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetfirstchildnull.js b/LayoutTests/dom/html/level1/core/hc_nodegetfirstchildnull.js new file mode 100644 index 0000000..dec151f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetlastchild-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetlastchild-expected.txt new file mode 100644 index 0000000..0a20c60 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetlastchild.html b/LayoutTests/dom/html/level1/core/hc_nodegetlastchild.html new file mode 100644 index 0000000..9e0c636 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetlastchild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetlastchild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetlastchild.js b/LayoutTests/dom/html/level1/core/hc_nodegetlastchild.js new file mode 100644 index 0000000..712c5ef --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetlastchildnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetlastchildnull-expected.txt new file mode 100644 index 0000000..33a80e9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetlastchildnull.html b/LayoutTests/dom/html/level1/core/hc_nodegetlastchildnull.html new file mode 100644 index 0000000..4f6da41 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetlastchildnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetlastchildnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetlastchildnull.js b/LayoutTests/dom/html/level1/core/hc_nodegetlastchildnull.js new file mode 100644 index 0000000..9e5a6ad --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetnextsibling-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetnextsibling-expected.txt new file mode 100644 index 0000000..6923b2b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetnextsibling.html b/LayoutTests/dom/html/level1/core/hc_nodegetnextsibling.html new file mode 100644 index 0000000..5b57620 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetnextsibling.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetnextsibling.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetnextsibling.js b/LayoutTests/dom/html/level1/core/hc_nodegetnextsibling.js new file mode 100644 index 0000000..3daca44 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetnextsiblingnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetnextsiblingnull-expected.txt new file mode 100644 index 0000000..c8eb7f3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetnextsiblingnull.html b/LayoutTests/dom/html/level1/core/hc_nodegetnextsiblingnull.html new file mode 100644 index 0000000..ece3736 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetnextsiblingnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetnextsiblingnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetnextsiblingnull.js b/LayoutTests/dom/html/level1/core/hc_nodegetnextsiblingnull.js new file mode 100644 index 0000000..0f9cb7b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetownerdocument-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocument-expected.txt new file mode 100644 index 0000000..f61859b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetownerdocument.html b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocument.html new file mode 100644 index 0000000..1fa551f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocument.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetownerdocument.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetownerdocument.js b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocument.js new file mode 100644 index 0000000..85853b8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetownerdocumentnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocumentnull-expected.txt new file mode 100644 index 0000000..541ed24 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetownerdocumentnull.html b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocumentnull.html new file mode 100644 index 0000000..97c7626 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocumentnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetownerdocumentnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetownerdocumentnull.js b/LayoutTests/dom/html/level1/core/hc_nodegetownerdocumentnull.js new file mode 100644 index 0000000..67bfd87 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetprevioussibling-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussibling-expected.txt new file mode 100644 index 0000000..d8fe68e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetprevioussibling.html b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussibling.html new file mode 100644 index 0000000..b9bc07e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussibling.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetprevioussibling.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetprevioussibling.js b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussibling.js new file mode 100644 index 0000000..5434f05 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetprevioussiblingnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussiblingnull-expected.txt new file mode 100644 index 0000000..6d74696 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodegetprevioussiblingnull.html b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussiblingnull.html new file mode 100644 index 0000000..d5218cb --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussiblingnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodegetprevioussiblingnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodegetprevioussiblingnull.js b/LayoutTests/dom/html/level1/core/hc_nodegetprevioussiblingnull.js new file mode 100644 index 0000000..b1dc787 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodehaschildnodes-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodes-expected.txt new file mode 100644 index 0000000..c39fafb --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodehaschildnodes.html b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodes.html new file mode 100644 index 0000000..27c1ae6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodes.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodehaschildnodes.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodehaschildnodes.js b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodes.js new file mode 100644 index 0000000..1ff38a9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodehaschildnodesfalse-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodesfalse-expected.txt new file mode 100644 index 0000000..55c67cd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodehaschildnodesfalse.html b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodesfalse.html new file mode 100644 index 0000000..4f9c7df --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodesfalse.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodehaschildnodesfalse.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodehaschildnodesfalse.js b/LayoutTests/dom/html/level1/core/hc_nodehaschildnodesfalse.js new file mode 100644 index 0000000..f966eba --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbefore-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbefore-expected.txt new file mode 100644 index 0000000..25e32b8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbefore.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbefore.html new file mode 100644 index 0000000..b3a5e6b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbefore.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbefore.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbefore.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbefore.js new file mode 100644 index 0000000..f73bd6d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforedocfragment-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforedocfragment-expected.txt new file mode 100644 index 0000000..8eaa3c3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforedocfragment.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforedocfragment.html new file mode 100644 index 0000000..1b27170 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforedocfragment.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforedocfragment.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforedocfragment.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforedocfragment.js new file mode 100644 index 0000000..1e132c9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforeinvalidnodetype-expected.txt new file mode 100644 index 0000000..25bf5bc --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforeinvalidnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforeinvalidnodetype.html new file mode 100644 index 0000000..25801c0 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforeinvalidnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforeinvalidnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforeinvalidnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforeinvalidnodetype.js new file mode 100644 index 0000000..e467f33 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument-expected.txt new file mode 100644 index 0000000..0e63d07 --- /dev/null +++ b/LayoutTests/dom/html/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 +Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument.html new file mode 100644 index 0000000..732bf0c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforenewchilddiffdocument.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchilddiffdocument.js new file mode 100644 index 0000000..915104f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchildexists-expected.txt new file mode 100644 index 0000000..3371d4e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenewchildexists.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchildexists.html new file mode 100644 index 0000000..d7a5775 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchildexists.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforenewchildexists.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchildexists.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenewchildexists.js new file mode 100644 index 0000000..f7adaff --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodeancestor-expected.txt new file mode 100644 index 0000000..f8234d9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenodeancestor.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodeancestor.html new file mode 100644 index 0000000..80affdd --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodeancestor.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforenodeancestor.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodeancestor.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodeancestor.js new file mode 100644 index 0000000..cd7c956 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodename-expected.txt new file mode 100644 index 0000000..4b2c81b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforenodename.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodename.html new file mode 100644 index 0000000..d02a36b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforenodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodename.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforenodename.js new file mode 100644 index 0000000..eeb61c8 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnonexistent-expected.txt new file mode 100644 index 0000000..0a2f71d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforerefchildnonexistent.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnonexistent.html new file mode 100644 index 0000000..97a276f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnonexistent.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforerefchildnonexistent.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnonexistent.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnonexistent.js new file mode 100644 index 0000000..d4c8f3e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnull-expected.txt new file mode 100644 index 0000000..be403d0 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeinsertbeforerefchildnull.html b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnull.html new file mode 100644 index 0000000..0e099ac --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeinsertbeforerefchildnull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnull.js b/LayoutTests/dom/html/level1/core/hc_nodeinsertbeforerefchildnull.js new file mode 100644 index 0000000..a0bf5e4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexequalzero-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelistindexequalzero-expected.txt new file mode 100644 index 0000000..0b472c9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexequalzero.html b/LayoutTests/dom/html/level1/core/hc_nodelistindexequalzero.html new file mode 100644 index 0000000..01a0893 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelistindexequalzero.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelistindexequalzero.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelistindexequalzero.js b/LayoutTests/dom/html/level1/core/hc_nodelistindexequalzero.js new file mode 100644 index 0000000..eff64d9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexgetlength-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlength-expected.txt new file mode 100644 index 0000000..a2ef03d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexgetlength.html b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlength.html new file mode 100644 index 0000000..bc36c26 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlength.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelistindexgetlength.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlength.js b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlength.js new file mode 100644 index 0000000..d169a62 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlengthofemptylist-expected.txt new file mode 100644 index 0000000..60fc464 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexgetlengthofemptylist.html b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlengthofemptylist.html new file mode 100644 index 0000000..fb846e8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlengthofemptylist.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelistindexgetlengthofemptylist.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlengthofemptylist.js b/LayoutTests/dom/html/level1/core/hc_nodelistindexgetlengthofemptylist.js new file mode 100644 index 0000000..9ae4969 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexnotzero-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelistindexnotzero-expected.txt new file mode 100644 index 0000000..3c05231 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistindexnotzero.html b/LayoutTests/dom/html/level1/core/hc_nodelistindexnotzero.html new file mode 100644 index 0000000..b974e36 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelistindexnotzero.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelistindexnotzero.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelistindexnotzero.js b/LayoutTests/dom/html/level1/core/hc_nodelistindexnotzero.js new file mode 100644 index 0000000..8976e02 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistreturnfirstitem-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelistreturnfirstitem-expected.txt new file mode 100644 index 0000000..66ccc37 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistreturnfirstitem.html b/LayoutTests/dom/html/level1/core/hc_nodelistreturnfirstitem.html new file mode 100644 index 0000000..7a83e0f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelistreturnfirstitem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelistreturnfirstitem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelistreturnfirstitem.js b/LayoutTests/dom/html/level1/core/hc_nodelistreturnfirstitem.js new file mode 100644 index 0000000..117be61 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistreturnlastitem-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelistreturnlastitem-expected.txt new file mode 100644 index 0000000..5e8c7d1 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelistreturnlastitem.html b/LayoutTests/dom/html/level1/core/hc_nodelistreturnlastitem.html new file mode 100644 index 0000000..1408237 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelistreturnlastitem.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelistreturnlastitem.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelistreturnlastitem.js b/LayoutTests/dom/html/level1/core/hc_nodelistreturnlastitem.js new file mode 100644 index 0000000..b6652fe --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelisttraverselist-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodelisttraverselist-expected.txt new file mode 100644 index 0000000..5f1ec33 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodelisttraverselist.html b/LayoutTests/dom/html/level1/core/hc_nodelisttraverselist.html new file mode 100644 index 0000000..30a7175 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodelisttraverselist.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodelisttraverselist.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodelisttraverselist.js b/LayoutTests/dom/html/level1/core/hc_nodelisttraverselist.js new file mode 100644 index 0000000..dc6862b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeparentnode-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeparentnode-expected.txt new file mode 100644 index 0000000..50dbdea --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeparentnode.html b/LayoutTests/dom/html/level1/core/hc_nodeparentnode.html new file mode 100644 index 0000000..ed6fc67 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeparentnode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeparentnode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeparentnode.js b/LayoutTests/dom/html/level1/core/hc_nodeparentnode.js new file mode 100644 index 0000000..e3408f6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeparentnodenull-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodeparentnodenull-expected.txt new file mode 100644 index 0000000..2feac92 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodeparentnodenull.html b/LayoutTests/dom/html/level1/core/hc_nodeparentnodenull.html new file mode 100644 index 0000000..32bae6c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodeparentnodenull.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodeparentnodenull.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodeparentnodenull.js b/LayoutTests/dom/html/level1/core/hc_nodeparentnodenull.js new file mode 100644 index 0000000..9c80de3 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechild-expected.txt b/LayoutTests/dom/html/level1/core/hc_noderemovechild-expected.txt new file mode 100644 index 0000000..9a47f28 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechild.html b/LayoutTests/dom/html/level1/core/hc_noderemovechild.html new file mode 100644 index 0000000..becc596 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_noderemovechild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_noderemovechild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_noderemovechild.js b/LayoutTests/dom/html/level1/core/hc_noderemovechild.js new file mode 100644 index 0000000..35e04b2 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_noderemovechild.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_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; + + childToRemove = childList.item(1); + removedChild = rootNode.removeChild(childToRemove); + parentNode = removedChild.parentNode; + + assertNull("parentNodeNull",parentNode); + +} + + + + +function runTest() { + hc_noderemovechild(); +} diff --git a/LayoutTests/dom/html/level1/core/hc_noderemovechildgetnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_noderemovechildgetnodename-expected.txt new file mode 100644 index 0000000..27367bc --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechildgetnodename.html b/LayoutTests/dom/html/level1/core/hc_noderemovechildgetnodename.html new file mode 100644 index 0000000..a586755 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_noderemovechildgetnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_noderemovechildgetnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_noderemovechildgetnodename.js b/LayoutTests/dom/html/level1/core/hc_noderemovechildgetnodename.js new file mode 100644 index 0000000..d81a2a9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechildnode-expected.txt b/LayoutTests/dom/html/level1/core/hc_noderemovechildnode-expected.txt new file mode 100644 index 0000000..c0ef24e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechildnode.html b/LayoutTests/dom/html/level1/core/hc_noderemovechildnode.html new file mode 100644 index 0000000..8ad215e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_noderemovechildnode.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_noderemovechildnode.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_noderemovechildnode.js b/LayoutTests/dom/html/level1/core/hc_noderemovechildnode.js new file mode 100644 index 0000000..b6cef22 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt b/LayoutTests/dom/html/level1/core/hc_noderemovechildoldchildnonexistent-expected.txt new file mode 100644 index 0000000..96ee030 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_noderemovechildoldchildnonexistent.html b/LayoutTests/dom/html/level1/core/hc_noderemovechildoldchildnonexistent.html new file mode 100644 index 0000000..bc80850 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_noderemovechildoldchildnonexistent.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_noderemovechildoldchildnonexistent.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_noderemovechildoldchildnonexistent.js b/LayoutTests/dom/html/level1/core/hc_noderemovechildoldchildnonexistent.js new file mode 100644 index 0000000..7f68dbd --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechild-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechild-expected.txt new file mode 100644 index 0000000..c892b45 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechild.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechild.html new file mode 100644 index 0000000..1443b65 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechild.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechild.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechild.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechild.js new file mode 100644 index 0000000..db4ba3b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechildinvalidnodetype-expected.txt new file mode 100644 index 0000000..2afd22b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildinvalidnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechildinvalidnodetype.html new file mode 100644 index 0000000..40a0526 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechildinvalidnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechildinvalidnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildinvalidnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechildinvalidnodetype.js new file mode 100644 index 0000000..789f5cf --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchilddiffdocument-expected.txt new file mode 100644 index 0000000..4cacbb9 --- /dev/null +++ b/LayoutTests/dom/html/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 +Detail: throw_WRONG_DOCUMENT_ERR: assertTrue failed diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchilddiffdocument.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchilddiffdocument.html new file mode 100644 index 0000000..6843660 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchilddiffdocument.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechildnewchilddiffdocument.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchilddiffdocument.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchilddiffdocument.js new file mode 100644 index 0000000..23af319 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnewchildexists-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchildexists-expected.txt new file mode 100644 index 0000000..c32b87d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnewchildexists.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchildexists.html new file mode 100644 index 0000000..4d927c5 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchildexists.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechildnewchildexists.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchildexists.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnewchildexists.js new file mode 100644 index 0000000..06be50b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnodeancestor-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodeancestor-expected.txt new file mode 100644 index 0000000..b5f75a6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnodeancestor.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodeancestor.html new file mode 100644 index 0000000..d5c187a --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodeancestor.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechildnodeancestor.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodeancestor.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodeancestor.js new file mode 100644 index 0000000..5e7b044 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodename-expected.txt new file mode 100644 index 0000000..8916ac6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildnodename.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodename.html new file mode 100644 index 0000000..ef85dbb --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechildnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodename.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechildnodename.js new file mode 100644 index 0000000..baeab8a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodereplacechildoldchildnonexistent-expected.txt new file mode 100644 index 0000000..8f75cb4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodereplacechildoldchildnonexistent.html b/LayoutTests/dom/html/level1/core/hc_nodereplacechildoldchildnonexistent.html new file mode 100644 index 0000000..b045d97 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodereplacechildoldchildnonexistent.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodereplacechildoldchildnonexistent.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodereplacechildoldchildnonexistent.js b/LayoutTests/dom/html/level1/core/hc_nodereplacechildoldchildnonexistent.js new file mode 100644 index 0000000..74ef15c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodeattribute-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodetextnodeattribute-expected.txt new file mode 100644 index 0000000..a8f60ee --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodeattribute.html b/LayoutTests/dom/html/level1/core/hc_nodetextnodeattribute.html new file mode 100644 index 0000000..8eb486e2 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodetextnodeattribute.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodetextnodeattribute.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodetextnodeattribute.js b/LayoutTests/dom/html/level1/core/hc_nodetextnodeattribute.js new file mode 100644 index 0000000..fd1f751 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodename-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodetextnodename-expected.txt new file mode 100644 index 0000000..59dbd4c --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodename.html b/LayoutTests/dom/html/level1/core/hc_nodetextnodename.html new file mode 100644 index 0000000..4ad337e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodetextnodename.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodetextnodename.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodetextnodename.js b/LayoutTests/dom/html/level1/core/hc_nodetextnodename.js new file mode 100644 index 0000000..bad6607 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodetype-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodetextnodetype-expected.txt new file mode 100644 index 0000000..2d3450e --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodetype.html b/LayoutTests/dom/html/level1/core/hc_nodetextnodetype.html new file mode 100644 index 0000000..472e3cc --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodetextnodetype.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodetextnodetype.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodetextnodetype.js b/LayoutTests/dom/html/level1/core/hc_nodetextnodetype.js new file mode 100644 index 0000000..43c358d --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodevalue-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodetextnodevalue-expected.txt new file mode 100644 index 0000000..9610f47 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodetextnodevalue.html b/LayoutTests/dom/html/level1/core/hc_nodetextnodevalue.html new file mode 100644 index 0000000..b4038d1 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodetextnodevalue.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodetextnodevalue.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodetextnodevalue.js b/LayoutTests/dom/html/level1/core/hc_nodetextnodevalue.js new file mode 100644 index 0000000..1a1ec4b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue01-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue01-expected.txt new file mode 100644 index 0000000..1ab9cc2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue01.html b/LayoutTests/dom/html/level1/core/hc_nodevalue01.html new file mode 100644 index 0000000..102553e --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue01.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue01.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue01.js b/LayoutTests/dom/html/level1/core/hc_nodevalue01.js new file mode 100644 index 0000000..c632b22 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue02-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue02-expected.txt new file mode 100644 index 0000000..08bca96 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue02.html b/LayoutTests/dom/html/level1/core/hc_nodevalue02.html new file mode 100644 index 0000000..cf4e85c --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue02.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue02.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue02.js b/LayoutTests/dom/html/level1/core/hc_nodevalue02.js new file mode 100644 index 0000000..80682b9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue03-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue03-expected.txt new file mode 100644 index 0000000..c70c7c3 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue03-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue03 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue03.html b/LayoutTests/dom/html/level1/core/hc_nodevalue03.html new file mode 100644 index 0000000..b8046f1 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue03.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue03.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue03.js b/LayoutTests/dom/html/level1/core/hc_nodevalue03.js new file mode 100644 index 0000000..e61671a --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue04-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue04-expected.txt new file mode 100644 index 0000000..6cf28d9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue04.html b/LayoutTests/dom/html/level1/core/hc_nodevalue04.html new file mode 100644 index 0000000..2e0e312 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue04.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue04.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue04.js b/LayoutTests/dom/html/level1/core/hc_nodevalue04.js new file mode 100644 index 0000000..40ceb64 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue05-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue05-expected.txt new file mode 100644 index 0000000..cf46b32 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue05.html b/LayoutTests/dom/html/level1/core/hc_nodevalue05.html new file mode 100644 index 0000000..edb2730 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue05.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue05.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue05.js b/LayoutTests/dom/html/level1/core/hc_nodevalue05.js new file mode 100644 index 0000000..34e2e33 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue06-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue06-expected.txt new file mode 100644 index 0000000..3616491 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue06.html b/LayoutTests/dom/html/level1/core/hc_nodevalue06.html new file mode 100644 index 0000000..b5235f3 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue06.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue06.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue06.js b/LayoutTests/dom/html/level1/core/hc_nodevalue06.js new file mode 100644 index 0000000..6cb9ac7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue07-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue07-expected.txt new file mode 100644 index 0000000..5876edf --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue07-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue07 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue07.html b/LayoutTests/dom/html/level1/core/hc_nodevalue07.html new file mode 100644 index 0000000..1a635b8 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue07.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue07.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue07.js b/LayoutTests/dom/html/level1/core/hc_nodevalue07.js new file mode 100644 index 0000000..867a682 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_nodevalue08-expected.txt b/LayoutTests/dom/html/level1/core/hc_nodevalue08-expected.txt new file mode 100644 index 0000000..6c332e5 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue08-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_nodevalue08 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue08.html b/LayoutTests/dom/html/level1/core/hc_nodevalue08.html new file mode 100644 index 0000000..75bea5d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_nodevalue08.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_nodevalue08.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_nodevalue08.js b/LayoutTests/dom/html/level1/core/hc_nodevalue08.js new file mode 100644 index 0000000..6bbab84 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_notationsremovenameditem1-expected.txt b/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1-expected.txt new file mode 100644 index 0000000..688f638 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationsremovenameditem1 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1.html b/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1.html new file mode 100644 index 0000000..e5478d4 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_notationsremovenameditem1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1.js b/LayoutTests/dom/html/level1/core/hc_notationsremovenameditem1.js new file mode 100644 index 0000000..28d3cc6 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_notationssetnameditem1-expected.txt b/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1-expected.txt new file mode 100644 index 0000000..66419be --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_notationssetnameditem1 +Status: Success diff --git a/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1.html b/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1.html new file mode 100644 index 0000000..c172478 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_notationssetnameditem1.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1.js b/LayoutTests/dom/html/level1/core/hc_notationssetnameditem1.js new file mode 100644 index 0000000..0ae1333 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt b/LayoutTests/dom/html/level1/core/hc_textindexsizeerrnegativeoffset-expected.txt new file mode 100644 index 0000000..98e2601 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textindexsizeerrnegativeoffset.html b/LayoutTests/dom/html/level1/core/hc_textindexsizeerrnegativeoffset.html new file mode 100644 index 0000000..56485c6 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textindexsizeerrnegativeoffset.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textindexsizeerrnegativeoffset.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textindexsizeerrnegativeoffset.js b/LayoutTests/dom/html/level1/core/hc_textindexsizeerrnegativeoffset.js new file mode 100644 index 0000000..965648b --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt b/LayoutTests/dom/html/level1/core/hc_textindexsizeerroffsetoutofbounds-expected.txt new file mode 100644 index 0000000..cf61411 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textindexsizeerroffsetoutofbounds.html b/LayoutTests/dom/html/level1/core/hc_textindexsizeerroffsetoutofbounds.html new file mode 100644 index 0000000..d61e189 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textindexsizeerroffsetoutofbounds.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textindexsizeerroffsetoutofbounds.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textindexsizeerroffsetoutofbounds.js b/LayoutTests/dom/html/level1/core/hc_textindexsizeerroffsetoutofbounds.js new file mode 100644 index 0000000..170d435 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textparseintolistofelements-expected.txt b/LayoutTests/dom/html/level1/core/hc_textparseintolistofelements-expected.txt new file mode 100644 index 0000000..6b676a9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textparseintolistofelements.html b/LayoutTests/dom/html/level1/core/hc_textparseintolistofelements.html new file mode 100644 index 0000000..cc6f03d --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textparseintolistofelements.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textparseintolistofelements.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textparseintolistofelements.js b/LayoutTests/dom/html/level1/core/hc_textparseintolistofelements.js new file mode 100644 index 0000000..71d362f --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittextfour-expected.txt b/LayoutTests/dom/html/level1/core/hc_textsplittextfour-expected.txt new file mode 100644 index 0000000..7e84360 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittextfour.html b/LayoutTests/dom/html/level1/core/hc_textsplittextfour.html new file mode 100644 index 0000000..b608b30 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textsplittextfour.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textsplittextfour.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textsplittextfour.js b/LayoutTests/dom/html/level1/core/hc_textsplittextfour.js new file mode 100644 index 0000000..ece64c2 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittextone-expected.txt b/LayoutTests/dom/html/level1/core/hc_textsplittextone-expected.txt new file mode 100644 index 0000000..820c6e4 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittextone.html b/LayoutTests/dom/html/level1/core/hc_textsplittextone.html new file mode 100644 index 0000000..85a166f --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textsplittextone.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textsplittextone.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textsplittextone.js b/LayoutTests/dom/html/level1/core/hc_textsplittextone.js new file mode 100644 index 0000000..2e089c5 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittextthree-expected.txt b/LayoutTests/dom/html/level1/core/hc_textsplittextthree-expected.txt new file mode 100644 index 0000000..4cc03f7 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittextthree.html b/LayoutTests/dom/html/level1/core/hc_textsplittextthree.html new file mode 100644 index 0000000..1cee22b --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textsplittextthree.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textsplittextthree.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textsplittextthree.js b/LayoutTests/dom/html/level1/core/hc_textsplittextthree.js new file mode 100644 index 0000000..6992628 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittexttwo-expected.txt b/LayoutTests/dom/html/level1/core/hc_textsplittexttwo-expected.txt new file mode 100644 index 0000000..57f63dc --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textsplittexttwo.html b/LayoutTests/dom/html/level1/core/hc_textsplittexttwo.html new file mode 100644 index 0000000..1749779 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textsplittexttwo.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textsplittexttwo.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textsplittexttwo.js b/LayoutTests/dom/html/level1/core/hc_textsplittexttwo.js new file mode 100644 index 0000000..8778694 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textwithnomarkup-expected.txt b/LayoutTests/dom/html/level1/core/hc_textwithnomarkup-expected.txt new file mode 100644 index 0000000..26539da --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/hc_textwithnomarkup.html b/LayoutTests/dom/html/level1/core/hc_textwithnomarkup.html new file mode 100644 index 0000000..490afdd --- /dev/null +++ b/LayoutTests/dom/html/level1/core/hc_textwithnomarkup.html @@ -0,0 +1,48 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd" > +<!-- This is comment number 1.--> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>hc_staff</title><script type="text/javascript" src="selfhtml.js"></script><script charset="UTF-8" type="text/javascript" src="hc_textwithnomarkup.js"></script><script type='text/javascript'>function loadComplete() { startTest(); }</script></head><body onload="loadComplete()"> + <p> + <em>EMP0001</em> + <strong>Margaret Martin</strong> + <code>Accountant</code> + <sup>56,000</sup> + <var>Female</var> + <acronym title="Yes">1230 North Ave. Dallas, Texas 98551</acronym> + </p> + <p> + <em>EMP0002</em> + <strong>Martha RaynoldsThis is a CDATASection with EntityReference number 2 &ent2; +This is an adjacent CDATASection with a reference to a tab &tab;</strong> + <code>Secretary</code> + <sup>35,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yes">β Dallas, γ + 98554</acronym> + </p> + <p> + <em>EMP0003</em> + <strong>Roger + Jones</strong> + <code>Department Manager</code> + <sup>100,000</sup> + <var>δ</var> + <acronym title="Yes" class="No">PO Box 27 Irving, texas 98553</acronym> + </p> + <p> + <em>EMP0004</em> + <strong>Jeny Oconnor</strong> + <code>Personnel Director</code> + <sup>95,000</sup> + <var>Female</var> + <acronym title="Yes" class="Yα">27 South Road. Dallas, Texas 98556</acronym> + </p> + <p> + <em>EMP0005</em> + <strong>Robert Myers</strong> + <code>Computer Specialist</code> + <sup>90,000</sup> + <var>male</var> + <acronym title="Yes">1821 Nordic. Road, Irving Texas 98558</acronym> + </p> +</body></html> diff --git a/LayoutTests/dom/html/level1/core/hc_textwithnomarkup.js b/LayoutTests/dom/html/level1/core/hc_textwithnomarkup.js new file mode 100644 index 0000000..2b3bae9 --- /dev/null +++ b/LayoutTests/dom/html/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/html/level1/core/resources/COPYRIGHT.html b/LayoutTests/dom/html/level1/core/resources/COPYRIGHT.html new file mode 100644 index 0000000..d03a7da --- /dev/null +++ b/LayoutTests/dom/html/level1/core/resources/COPYRIGHT.html @@ -0,0 +1,106 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> + <title>W3C IPR SOFTWARE NOTICE</title> +<style type="text/css"> +<!-- +html, body { background: #fff; color: #000; } /* body for Windows IE3 */ +--> +</style> + </head> + <body> + <h1> + W3C IPR SOFTWARE NOTICE + </h1> + <h3> + Copyright © 2002-2004 <a href="http://www.w3.org/">World Wide Web + Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts + Institute of Technology</a>, <a href="http://www.inria.fr/">Institut + National de Recherche en Informatique et en Automatique</a>, <a + href="http://www.keio.ac.jp/">Keio University</a>). All Rights + Reserved. + </h3> + <p> + 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. + </p> + <p> + <b>Note:</b> The original version of the W3C Software Copyright Notice + and License could be found at <a + href='http://www.w3.org/Consortium/Legal/copyright-software-19980720'>http://www.w3.org/Consortium/Legal/copyright-software-19980720</a> + </p> + <h3> + Copyright © 1994-2004 <a href="http://www.w3.org/">World Wide Web + Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts + Institute of Technology</a>, <a href="http://www.inria.fr/">Institut + National de Recherche en Informatique et en Automatique</a>, <a + href="http://www.keio.ac.jp/">Keio University</a>). All Rights + Reserved. http://www.w3.org/Consortium/Legal/ + </h3> + <p> + 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: + </p> + <p> + 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: + </p> + <ol> + <li> + The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. + </li> + <li> + 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] <a href="http://www.w3.org/">World Wide Web + Consortium</a>, (<a href="http://www.lcs.mit.edu/">Massachusetts + Institute of Technology</a>, <a href="http://www.inria.fr/">Institut + National de Recherche en Informatique et en Automatique</a>, <a + href="http://www.keio.ac.jp/">Keio University</a>). All Rights + Reserved. http://www.w3.org/Consortium/Legal/" + </li> + <li> + 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.) + </li> + </ol> + <p> + 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. + </p> + <p> + COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR + DOCUMENTATION. + </p> + <p> + 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. + </p> + </body> +</html> diff --git a/LayoutTests/dom/html/level1/core/selfhtml.js b/LayoutTests/dom/html/level1/core/selfhtml.js new file mode 100644 index 0000000..06b0cc1 --- /dev/null +++ b/LayoutTests/dom/html/level1/core/selfhtml.js @@ -0,0 +1,721 @@ +/* +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 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 = "text/html"; + this.supportedContentTypes = [ "text/html" ]; + + 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, false, 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.createElement(srcNode.nodeName.toLowerCase()); + var attrs = srcNode.attributes; + for(var i = 0; i < attrs.length; i++) { + var srcAttr = attrs.item(i); + clone.setAttribute(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 7: + clone = doc.createProcessingInstruction(srcNode.nodeValue); + 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.createElement(document.documentElement.nodeName)); + } + var attrs = document.documentElement.attributes; + for(var i = 0; i < attrs.length; i++) { + var srcAttr = attrs.item(i); + clone.documentElement.setAttribute(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 toLowerArray(src) { + var newArray = new Array(); + var i; + for (i = 0; i < src.length; i++) { + newArray[i] = src[i].toLowerCase(); + } + return newArray; +} + + +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.open(); + document.writeln("<html><head>"); + document.writeln("<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; CHARSET=utf-8'>"); + document.write("<title>"); + document.write(testName + ":" + resultType); + document.write("</title></head><body><table width='100%' border='1' style='color:"); + if (resultType == null) { + document.writeln("green'><tr><td>Test:</td><td>" + testName + "</td></tr><tr><td>Status:</td><td>Success</td></tr>"); + } else { + if (resultType == "skip") { + document.writeln("blue'><tr><td>Test:</td><td>" + testName + "</td></tr><tr><td>Status:</td><td>Skipped</td></tr>"); + } else { + document.writeln("red'><tr><td>Test:</td><td>" + testName + "</td><td></tr><tr><td>Status:</td><td>" + resultType + "</td></tr>"); + } + } + if (message != null) { + document.writeln("<tr><td>Detail:</td><td>" + message + "</td></tr>"); + } + document.write("</table></body></html>"); + document.close(); + if (parent != window) { + 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/xml": + return ".xml"; + + case "application/xhtml+xml": + return ".xhtml"; + + case "image/svg+xml": + return ".svg"; + + case "text/mathml": + return ".mml"; + } + return ".html"; +} + + +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 +// + +} |