| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 Copyright © 2001-2004 World Wide Web Consortium, | |
| 3 (Massachusetts Institute of Technology, European Research Consortium | |
| 4 for Informatics and Mathematics, Keio University). All | |
| 5 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the | |
| 6 hope that it will be useful, but WITHOUT ANY WARRANTY; without even | |
| 7 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 8 | |
| 9 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 | |
| 10 */ | |
| 11 | |
| 12 /** | |
| 13 * Gets URI that identifies the test. | |
| 14 * @return uri identifier of test | |
| 15 */ | |
| 16 function getTargetURI() { | |
| 17 return "http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLFrameElement
09"; | |
| 18 } | |
| 19 | |
| 20 var docsLoaded = -1000000; | |
| 21 var builder = null; | |
| 22 | |
| 23 // | |
| 24 // This function is called by the testing framework before | |
| 25 // running the test suite. | |
| 26 // | |
| 27 // If there are no configuration exceptions, asynchronous | |
| 28 // document loading is started. Otherwise, the status | |
| 29 // is set to complete and the exception is immediately | |
| 30 // raised when entering the body of the test. | |
| 31 // | |
| 32 function setUpPage() { | |
| 33 setUpPageStatus = 'running'; | |
| 34 try { | |
| 35 // | |
| 36 // creates test document builder, may throw exception | |
| 37 // | |
| 38 builder = createConfiguredBuilder(); | |
| 39 | |
| 40 docsLoaded = 0; | |
| 41 | |
| 42 var docRef = null; | |
| 43 if (typeof(this.doc) != 'undefined') { | |
| 44 docRef = this.doc; | |
| 45 } | |
| 46 docsLoaded += preload(docRef, "doc", "frame2"); | |
| 47 | |
| 48 if (docsLoaded == 1) { | |
| 49 // WebKit fix: corrected variable name from 'setUpPage': | |
| 50 // <http://bugs.webkit.org/show_bug.cgi?id=21506> | |
| 51 setUpPageStatus = 'complete'; | |
| 52 } | |
| 53 } catch(ex) { | |
| 54 catchInitializationError(builder, ex); | |
| 55 // WebKit fix: corrected variable name from 'setUpPage': | |
| 56 // <http://bugs.webkit.org/show_bug.cgi?id=21506> | |
| 57 setUpPageStatus = 'complete'; | |
| 58 } | |
| 59 } | |
| 60 | |
| 61 // | |
| 62 // This method is called on the completion of | |
| 63 // each asychronous load started in setUpTests. | |
| 64 // | |
| 65 // When every synchronous loaded document has completed, | |
| 66 // the page status is changed which allows the | |
| 67 // body of the test to be executed. | |
| 68 function loadComplete() { | |
| 69 if (++docsLoaded == 1) { | |
| 70 setUpPageStatus = 'complete'; | |
| 71 } | |
| 72 } | |
| 73 | |
| 74 /** | |
| 75 * | |
| 76 The contentDocument attribute specifies the document this frame contains, | |
| 77 if there is any and it is available, or null otherwise. | |
| 78 | |
| 79 Retrieve the contentDocument attribute of the first FRAME element | |
| 80 and examine its TITLE value. | |
| 81 | |
| 82 * @author NIST | |
| 83 * @author Rick Rivello | |
| 84 * @see http://www.w3.org/TR/DOM-Level-2-HTML/html#ID-78799536 | |
| 85 */ | |
| 86 function HTMLFrameElement09() { | |
| 87 var success; | |
| 88 if(checkInitialization(builder, "HTMLFrameElement09") != null) return; | |
| 89 var testNode; | |
| 90 var cd; | |
| 91 var vtitle; | |
| 92 var doc; | |
| 93 | |
| 94 var docRef = null; | |
| 95 if (typeof(this.doc) != 'undefined') { | |
| 96 docRef = this.doc; | |
| 97 } | |
| 98 doc = load(docRef, "doc", "frame2"); | |
| 99 testNode = doc.getElementById("Frame1"); | |
| 100 cd = testNode.contentDocument; | |
| 101 | |
| 102 vtitle = cd.title; | |
| 103 | |
| 104 assertEquals("titleLink","NIST DOM HTML Test - FRAMESET",vtitle); | |
| 105 | |
| 106 } | |
| 107 | |
| 108 function runTest() { | |
| 109 HTMLFrameElement09(); | |
| 110 } | |
| OLD | NEW |