Annotation of 2001/DOM-Test-Suite/ecmascript/DOMTestCase.js, revision 1.40

1.1       dom-ts-4    1: /*
1.32      dom-ts-4    2: Copyright (c) 2001-2004 World Wide Web Consortium,
1.1       dom-ts-4    3: (Massachusetts Institute of Technology, Institut National de
                      4: Recherche en Informatique et en Automatique, Keio University). All
                      5: Rights Reserved. This program is distributed under the W3C's Software
                      6: Intellectual Property License. This program is distributed in the
                      7: hope that it will be useful, but WITHOUT ANY WARRANTY; without even
                      8: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
                      9: PURPOSE.
                     10: See W3C License http://www.w3.org/Consortium/Legal/ for more details.
                     11: */
1.3       dom-ts-4   12:   function assertSize(descr, expected, actual) {
                     13:     var actualSize;
1.38      dom-ts-4   14:     assertNotNull(descr, actual);
1.3       dom-ts-4   15:     actualSize = actual.length;
                     16:     assertEquals(descr, expected, actualSize);
                     17:   }
1.15      dom-ts-4   18: 
1.32      dom-ts-4   19:   function assertEqualsAutoCase(context, descr, expected, actual) {
                     20:        if (builder.contentType == "text/html") {
                     21:            if(context == "attribute") {
                     22:                assertEquals(descr, expected.toLowerCase(), actual.toLowerCase());
                     23:            } else {
                     24:                assertEquals(descr, expected.toUpperCase(), actual);
                     25:            }
                     26:        } else {
                     27:                assertEquals(descr, expected, actual); 
                     28:        }
                     29:   }
1.9       dom-ts-4   30:   
1.32      dom-ts-4   31: 
                     32:   function assertEqualsCollectionAutoCase(context, descr, expected, actual) {
                     33:     //
                     34:     //  if they aren't the same size, they aren't equal
                     35:     assertEquals(descr, expected.length, actual.length);
                     36:     
                     37:     //
                     38:     //  if there length is the same, then every entry in the expected list
                     39:     //     must appear once and only once in the actual list
                     40:     var expectedLen = expected.length;
                     41:     var expectedValue;
                     42:     var actualLen = actual.length;
                     43:     var i;
                     44:     var j;
                     45:     var matches;
                     46:     for(i = 0; i < expectedLen; i++) {
                     47:         matches = 0;
                     48:         expectedValue = expected[i];
                     49:         for(j = 0; j < actualLen; j++) {
                     50:                if (builder.contentType == "text/html") {
                     51:                        if (context == "attribute") {
                     52:                                if (expectedValue.toLowerCase() == actual[j].toLowerCase()) {
                     53:                                        matches++;
                     54:                                }
                     55:                        } else {
                     56:                                if (expectedValue.toUpperCase() == actual[j]) {
                     57:                                        matches++;
                     58:                                }
                     59:                        }
                     60:                } else {
                     61:                if(expectedValue == actual[j]) {
                     62:                        matches++;
                     63:                 }
                     64:             }
                     65:         }
                     66:         if(matches == 0) {
                     67:             assert(descr + ": No match found for " + expectedValue,false);
                     68:         }
                     69:         if(matches > 1) {
                     70:             assert(descr + ": Multiple matches found for " + expectedValue, false);
                     71:         }
                     72:     }
                     73:   }
                     74: 
1.13      dom-ts-4   75:   function assertEqualsCollection(descr, expected, actual) {
1.3       dom-ts-4   76:     //
                     77:     //  if they aren't the same size, they aren't equal
1.17      dom-ts-4   78:     assertEquals(descr, expected.length, actual.length);
1.3       dom-ts-4   79:     //
                     80:     //  if there length is the same, then every entry in the expected list
                     81:     //     must appear once and only once in the actual list
                     82:     var expectedLen = expected.length;
                     83:     var expectedValue;
                     84:     var actualLen = actual.length;
                     85:     var i;
                     86:     var j;
                     87:     var matches;
                     88:     for(i = 0; i < expectedLen; i++) {
                     89:         matches = 0;
                     90:         expectedValue = expected[i];
                     91:         for(j = 0; j < actualLen; j++) {
                     92:             if(expectedValue == actual[j]) {
                     93:                 matches++;
                     94:             }
                     95:         }
                     96:         if(matches == 0) {
1.17      dom-ts-4   97:             assert(descr + ": No match found for " + expectedValue,false);
1.3       dom-ts-4   98:         }
                     99:         if(matches > 1) {
1.17      dom-ts-4  100:             assert(descr + ": Multiple matches found for " + expectedValue, false);
1.3       dom-ts-4  101:         }
                    102:     }
                    103:   }
                    104: 
                    105: 
1.32      dom-ts-4  106:   function assertEqualsListAutoCase(context, descr, expected, actual) {
                    107:        var minLength = expected.length;
                    108:        if (actual.length < minLength) {
                    109:            minLength = actual.length;
                    110:        }
                    111:     //
                    112:     for(var i = 0; i < minLength; i++) {
                    113:                assertEqualsAutoCase(context, descr, expected[i], actual[i]);
                    114:     }
                    115:     //
                    116:     //  if they aren't the same size, they aren't equal
                    117:     assertEquals(descr, expected.length, actual.length);
                    118:   }
                    119: 
                    120: 
1.13      dom-ts-4  121:   function assertEqualsList(descr, expected, actual) {
1.27      dom-ts-4  122:        var minLength = expected.length;
                    123:        if (actual.length < minLength) {
                    124:            minLength = actual.length;
                    125:        }
1.3       dom-ts-4  126:     //
1.27      dom-ts-4  127:     for(var i = 0; i < minLength; i++) {
1.3       dom-ts-4  128:         if(expected[i] != actual[i]) {
1.17      dom-ts-4  129:                        assertEquals(descr, expected[i], actual[i]);
1.3       dom-ts-4  130:         }
                    131:     }
1.27      dom-ts-4  132:     //
                    133:     //  if they aren't the same size, they aren't equal
                    134:     assertEquals(descr, expected.length, actual.length);
1.3       dom-ts-4  135:   }
                    136: 
                    137:   function assertInstanceOf(descr, type, obj) {
                    138:     if(type == "Attr") {
1.17      dom-ts-4  139:         assertEquals(descr,2,obj.nodeType);
1.3       dom-ts-4  140:         var specd = obj.specified;
                    141:     }
                    142:   }
                    143: 
                    144:   function assertSame(descr, expected, actual) {
                    145:     if(expected != actual) {
1.17      dom-ts-4  146:         assertEquals(descr, expected.nodeType, actual.nodeType);
                    147:         assertEquals(descr, expected.nodeValue, actual.nodeValue);
1.3       dom-ts-4  148:     }
                    149:   }
                    150: 
1.16      dom-ts-4  151:   function assertURIEquals(assertID, scheme, path, host, file, name, query, fragment, isAbsolute, actual) {
1.7       dom-ts-4  152:     //
                    153:     //  URI must be non-null
1.17      dom-ts-4  154:     assertNotNull(assertID, actual);
1.7       dom-ts-4  155: 
                    156:     var uri = actual;
                    157: 
                    158:     var lastPound = actual.lastIndexOf("#");
                    159:     var actualFragment = "";
                    160:     if(lastPound != -1) {
                    161:         //
                    162:         //   substring before pound
                    163:         //
                    164:         uri = actual.substring(0,lastPound);
                    165:         actualFragment = actual.substring(lastPound+1);
                    166:     }
1.17      dom-ts-4  167:     if(fragment != null) assertEquals(assertID,fragment, actualFragment);
1.7       dom-ts-4  168: 
                    169:     var lastQuestion = uri.lastIndexOf("?");
                    170:     var actualQuery = "";
                    171:     if(lastQuestion != -1) {
                    172:         //
                    173:         //   substring before pound
                    174:         //
                    175:         uri = actual.substring(0,lastQuestion);
                    176:         actualQuery = actual.substring(lastQuestion+1);
                    177:     }
1.17      dom-ts-4  178:     if(query != null) assertEquals(assertID, query, actualQuery);
1.7       dom-ts-4  179: 
                    180:     var firstColon = uri.indexOf(":");
                    181:     var firstSlash = uri.indexOf("/");
                    182:     var actualPath = uri;
                    183:     var actualScheme = "";
                    184:     if(firstColon != -1 && firstColon < firstSlash) {
                    185:         actualScheme = uri.substring(0,firstColon);
                    186:         actualPath = uri.substring(firstColon + 1);
                    187:     }
                    188: 
                    189:     if(scheme != null) {
1.17      dom-ts-4  190:         assertEquals(assertID, scheme, actualScheme);
1.7       dom-ts-4  191:     }
                    192: 
                    193:     if(path != null) {
1.17      dom-ts-4  194:         assertEquals(assertID, path, actualPath);
1.7       dom-ts-4  195:     }
                    196: 
                    197:     if(host != null) {
                    198:         var actualHost = "";
1.16      dom-ts-4  199:         if(actualPath.substring(0,2) == "//") {
1.8       dom-ts-4  200:             var termSlash = actualPath.substring(2).indexOf("/") + 2;
1.7       dom-ts-4  201:             actualHost = actualPath.substring(0,termSlash);
                    202:         }
1.17      dom-ts-4  203:         assertEquals(assertID, host, actualHost);
1.7       dom-ts-4  204:     }
                    205: 
1.16      dom-ts-4  206:     if(file != null || name != null) {
1.7       dom-ts-4  207:         var actualFile = actualPath;
                    208:         var finalSlash = actualPath.lastIndexOf("/");
                    209:         if(finalSlash != -1) {
                    210:             actualFile = actualPath.substring(finalSlash+1);
                    211:         }
1.16      dom-ts-4  212:         if (file != null) {
1.17      dom-ts-4  213:             assertEquals(assertID, file, actualFile);
1.16      dom-ts-4  214:         }
                    215:         if (name != null) {
                    216:             var actualName = actualFile;
                    217:             var finalDot = actualFile.lastIndexOf(".");
                    218:             if (finalDot != -1) {
                    219:                 actualName = actualName.substring(0, finalDot);
                    220:             }
1.17      dom-ts-4  221:             assertEquals(assertID, name, actualName);
1.16      dom-ts-4  222:         }
1.7       dom-ts-4  223:     }
                    224: 
                    225:     if(isAbsolute != null) {
1.17      dom-ts-4  226:         assertEquals(assertID, isAbsolute, actualPath.substring(0,1) == "/");
1.13      dom-ts-4  227:     }
                    228:   }
                    229: 
1.29      dom-ts-4  230: 
                    231: // size() used by assertSize element
                    232: function size(collection)
                    233: {
                    234:   return collection.length;
                    235: }
                    236: 
1.30      dom-ts-4  237: function same(expected, actual)
                    238: {
                    239:   return expected === actual;
                    240: }
                    241: 
1.18      dom-ts-4  242: function getSuffix(contentType) {
                    243:     switch(contentType) {
                    244:         case "text/html":
                    245:         return ".html";
                    246: 
                    247:         case "text/xml":
                    248:         return ".xml";
                    249: 
                    250:         case "application/xhtml+xml":
                    251:         return ".xhtml";
                    252: 
                    253:         case "image/svg+xml":
                    254:         return ".svg";
                    255: 
                    256:         case "text/mathml":
                    257:         return ".mml";
                    258:     }
                    259:     return ".html";
                    260: }
                    261: 
1.34      dom-ts-4  262: function equalsAutoCase(context, expected, actual) {
                    263:        if (builder.contentType == "text/html") {
1.38      dom-ts-4  264:                if (context == "attribute") {
1.34      dom-ts-4  265:                        return expected.toLowerCase() == actual;
                    266:                }
                    267:                return expected.toUpperCase() == actual;
                    268:        }
                    269:        return expected == actual;
                    270: }
                    271: 
                    272: function catchInitializationError(blder, ex) {
                    273:        blder.initializationError = ex;
                    274:        blder.initializationFatalError = ex;
                    275: }
                    276: 
                    277: function checkInitialization(blder, testname) {
                    278:     if (blder.initializationError != null) {
                    279:         if (blder.skipIncompatibleTests) {
                    280:                info(testname + " not run:" + blder.initializationError);
                    281:                return blder.initializationError;
                    282:         } else {
                    283:                //
                    284:                //   if an exception was thrown
                    285:                //        rethrow it and do not run the test
                    286:             if (blder.initializationFatalError != null) {
                    287:                        throw blder.initializationFatalError;
                    288:                } else {
                    289:                        //
                    290:                        //   might be recoverable, warn but continue the test
                    291:                        warn(testname + ": " +  blder.initializationError);
                    292:                }
                    293:         }
                    294:     }
                    295:     return null;
                    296: }
                    297: 
                    298: 
1.35      dom-ts-4  299: function EventMonitor() {
                    300:   this.atEvents = new Array();
                    301:   this.bubbledEvents = new Array();
                    302:   this.capturedEvents = new Array();
                    303:   this.allEvents = new Array();
                    304: }
                    305: 
                    306: EventMonitor.prototype.handleEvent = function(evt) {
                    307:     switch(evt.eventPhase) {
                    308:        case 1:
                    309:        monitor.capturedEvents[monitor.capturedEvents.length] = evt;
                    310:        break;
                    311:        
                    312:        case 2:
                    313:        monitor.atEvents[monitor.atEvents.length] = evt;
                    314:        break;
                    315: 
                    316:        case 3:
                    317:        monitor.bubbledEvents[monitor.bubbledEvents.length] = evt;
                    318:        break;
                    319:     }
                    320:     monitor.allEvents[monitor.allEvents.length] = evt;
                    321: }
                    322: 
1.36      dom-ts-4  323: function DOMErrorImpl(err) {
                    324:   this.severity = err.severity;
                    325:   this.message = err.message;
                    326:   this.type = err.type;
                    327:   this.relatedException = err.relatedException;
                    328:   this.relatedData = err.relatedData;
                    329:   this.location = err.location;
                    330: }
                    331: 
                    332: 
                    333: 
                    334: function DOMErrorMonitor() {
                    335:   this.allErrors = new Array();
                    336: }
                    337: 
                    338: DOMErrorMonitor.prototype.handleError = function(err) {
1.39      dom-ts-4  339:     errorMonitor.allErrors[errorMonitor.allErrors.length] = new DOMErrorImpl(err);
1.36      dom-ts-4  340: }
                    341: 
                    342: DOMErrorMonitor.prototype.assertLowerSeverity = function(id, severity) {
                    343:     var i;
1.39      dom-ts-4  344:     for (i = 0; i < errorMonitor.allErrors.length; i++) {
                    345:         if (errorMonitor.allErrors[i].severity >= severity) {
                    346:            assertEquals(id, severity - 1, errorMonitor.allErrors[i].severity);
1.36      dom-ts-4  347:         }
                    348:     }
                    349: }
                    350: 
                    351: function UserDataNotification(operation, key, data, src, dst) {
                    352:     this.operation = operation;
                    353:     this.key = key;
                    354:     this.data = data;
                    355:     this.src = src;
                    356:     this.dst = dst;
                    357: }
                    358: 
                    359: function UserDataMonitor() {
                    360:        this.allNotifications = new Array();
                    361: }
                    362: 
                    363: UserDataMonitor.prototype.handle = function(operation, key, data, src, dst) {
1.39      dom-ts-4  364:     userDataMonitor.allNotifications[this.allNotifications.length] =
1.36      dom-ts-4  365:          new UserDataNotification(operation, key, data, src, dst);
                    366: }
                    367: 
1.35      dom-ts-4  368: 
                    369: 
1.17      dom-ts-4  370: function IFrameBuilder() {
1.18      dom-ts-4  371:     this.contentType = "text/html";
1.26      dom-ts-4  372:     this.supportedContentTypes = [ "text/html", 
1.40    ! dom-ts-4  373:         "text/xml",
        !           374:         "image/svg+xml",
1.38      dom-ts-4  375:         "application/xhtml+xml" ];    
1.18      dom-ts-4  376: 
                    377:     this.supportsAsyncChange = false;
1.26      dom-ts-4  378:     this.async = true;
1.18      dom-ts-4  379:     this.fixedAttributeNames = [
                    380:         "validating",  "expandEntityReferences", "coalescing", 
1.34      dom-ts-4  381:         "signed", "hasNullString", "ignoringElementContentWhitespace", "namespaceAware", "ignoringComments"];
1.18      dom-ts-4  382: 
1.31      dom-ts-4  383:     this.fixedAttributeValues = [false,  true, false, true, true , false, false, true ];
1.18      dom-ts-4  384:     this.configurableAttributeNames = [ ];
                    385:     this.configurableAttributeValues = [ ];
1.34      dom-ts-4  386:     this.initializationError = null;
                    387:     this.initializationFatalError = null;
                    388:     this.skipIncompatibleTests = false;
1.17      dom-ts-4  389: }
1.12      dom-ts-4  390: 
1.18      dom-ts-4  391: IFrameBuilder.prototype.hasFeature = function(feature, version) {
                    392:     return document.implementation.hasFeature(feature, version);
                    393: }
                    394: 
1.23      dom-ts-4  395: IFrameBuilder.prototype.getImplementation = function() {
                    396:     return document.implementation;
                    397: }
                    398: 
1.31      dom-ts-4  399: IFrameBuilder.prototype.setContentType = function(contentType) {
                    400:     this.contentType = contentType;
                    401:     if (contentType == "text/html") {
1.34      dom-ts-4  402:         this.fixedAttributeValues[6] = false;
1.31      dom-ts-4  403:     } else {
1.34      dom-ts-4  404:         this.fixedAttributeValues[6] = true;
1.31      dom-ts-4  405:     }
                    406: }
                    407: 
                    408: 
1.18      dom-ts-4  409: 
1.17      dom-ts-4  410: IFrameBuilder.prototype.preload = function(frame, varname, url) {
1.34      dom-ts-4  411:   if (this.contentType == "text/html" || this.contentType == "application/xhtml+xml") {
                    412:        if (url.substring(0,5) == "staff" || url == "nodtdstaff" || url == "datatype_normalization") {
1.26      dom-ts-4  413:        throw "Tests using staff or nodtdstaff are not supported by HTML processors";
                    414:        }  
1.18      dom-ts-4  415:   }
1.26      dom-ts-4  416:   var iframe = document.createElement("iframe");
                    417:   var srcname = url + getSuffix(this.contentType);
                    418:   iframe.setAttribute("name", srcname);
                    419:   iframe.setAttribute("src", fileBase + srcname);
1.40    ! dom-ts-4  420:   //
        !           421:   //   HTML and XHTML have onload attributes that will invoke loadComplete
        !           422:   //       
        !           423:   if (this.contentType != "text/html" && this.contentType != "application/xhtml+xml") {
        !           424:      iframe.addEventListener("load", loadComplete, false);       
        !           425:   }
1.26      dom-ts-4  426:   document.getElementsByTagName("body").item(0).appendChild(iframe);
                    427:   return 0; 
1.17      dom-ts-4  428: }
1.9       dom-ts-4  429: 
1.17      dom-ts-4  430: IFrameBuilder.prototype.load = function(frame, varname, url) {
1.26      dom-ts-4  431:        if (this.contentType == "text/html") {
                    432:        return frame.document;
                    433:     }
                    434:     var name = url + getSuffix(this.contentType);
                    435:     var iframes = document.getElementsByTagName("iframe");
                    436:     for(var i = 0; i < iframes.length; i++) {
                    437:        if (iframes.item(i).getAttribute("name") == name) {
1.33      dom-ts-4  438:            var item = iframes.item(i);
                    439:            if (typeof(item.contentDocument) != 'undefined') {
                    440:                return item.contentDocument;
                    441:            }
                    442:            if (typeof(item.document) != 'undefined') {
                    443:                   return item.document;
                    444:            }
                    445:            return null;
1.26      dom-ts-4  446:        }
                    447:     }
                    448:     return null;
1.17      dom-ts-4  449: }
1.9       dom-ts-4  450: 
1.17      dom-ts-4  451: IFrameBuilder.prototype.getImplementationAttribute = function(attr) {
1.18      dom-ts-4  452:     for (var i = 0; i < this.fixedAttributeNames.length; i++) {
                    453:         if (this.fixedAttributeNames[i] == attr) {
                    454:             return this.fixedAttributeValues[i];
1.15      dom-ts-4  455:         }
1.9       dom-ts-4  456:     }
1.18      dom-ts-4  457:     throw "Unrecognized implementation attribute: " + attr;
1.17      dom-ts-4  458: }
1.9       dom-ts-4  459: 
1.5       dom-ts-4  460: 
1.1       dom-ts-4  461: 
1.18      dom-ts-4  462: IFrameBuilder.prototype.setImplementationAttribute = function(attribute, value) {
                    463:     var supported = this.getImplementationAttribute(attribute);
                    464:     if (supported != value) {
1.34      dom-ts-4  465:         this.initializationError = "IFrame loader does not support " + attribute + "=" + value;
1.18      dom-ts-4  466:     }
                    467: }
                    468: 
                    469: 
1.34      dom-ts-4  470: IFrameBuilder.prototype.canSetImplementationAttribute = function(attribute, value) {
                    471:     var supported = this.getImplementationAttribute(attribute);
                    472:     return (supported == value);
                    473: }
                    474: 
1.22      dom-ts-4  475: 
                    476: 
1.20      dom-ts-4  477: function SVGPluginBuilder() {
                    478:     this.contentType = "image/svg+xml";
                    479:     this.supportedContentTypes = [ "image/svg+xml" ];
                    480: 
                    481:     this.supportsAsyncChange = false;
                    482:     this.async = true;
                    483:     this.fixedAttributeNames = [
                    484:         "validating",  "expandEntityReferences", "coalescing", 
1.31      dom-ts-4  485:         "signed", "hasNullString", "ignoringElementContentWhitespace", "namespaceAware", "ignoringComments"];
1.20      dom-ts-4  486: 
1.34      dom-ts-4  487:     this.fixedAttributeValues = [false,  true, false, true, true , false, true, false ];
1.20      dom-ts-4  488:     this.configurableAttributeNames = [ ];
                    489:     this.configurableAttributeValues = [ ];
1.34      dom-ts-4  490:     this.initializationError = null;
                    491:     this.initializationFatalError = null;
                    492:     this.skipIncompatibleTests = false;
1.20      dom-ts-4  493: }
                    494: 
                    495: SVGPluginBuilder.prototype.hasFeature = function(feature, version) {
                    496:     if (feature == "XML") {
                    497:         if (version == null || version == "1.0" || version == "2.0") {
                    498:             return true;
                    499:         }
                    500:     }
1.33      dom-ts-4  501:     return false;
1.20      dom-ts-4  502: }
                    503: 
1.31      dom-ts-4  504: SVGPluginBuilder.prototype.setContentType = function(contentType) {
                    505:     this.contentType = contentType;
                    506: }
                    507: 
1.23      dom-ts-4  508: SVGPluginBuilder.prototype.getImplementation = function() {
                    509:   var embed = document.createElement("embed");
                    510:   embed.src = fileBase + url + getSuffix(this.contentType);
                    511:   embed.height = 100;
                    512:   embed.width = 100;
                    513:   embed.type = "image/svg+xml";
                    514:   embed.id = varname;
                    515:   var child = document.documentElement.firstChild;
                    516:   while(child != null) {
                    517:       if (child.nodeName != null && child.nodeName.toUpperCase() == "BODY") {
                    518:           child.appendChild(embed);
                    519:           return child.getSVGDocument.implementation;
                    520:       }
                    521:       child = child.nextSibling;
                    522:   }
                    523:   return null;
                    524: }
                    525: 
1.20      dom-ts-4  526: var svgloadcount = 0;
                    527: function SVGPluginBuilder_pollreadystate() {
                    528:   var newCount = 0;
                    529:   var child = document.documentElement.firstChild;
                    530:   while(child != null) {
                    531:       if (child.nodeName != null && child.nodeName.toUpperCase() == "BODY") {
                    532:           var grand = child.firstChild;
                    533:           while (grand != null) {
                    534:              if (grand.nodeName.toUpperCase() == 'EMBED' && grand.readystate == 4) {
                    535:                 newCount++;
                    536:              }
                    537:              grand = grand.nextSibling;
                    538:           }
                    539:           break;
                    540:       }
                    541:       child = child.nextSibling;
                    542:   }
                    543:   if (newCount > svgloadcount) {
                    544:     svgloadcount++;
                    545:     loadComplete();
                    546:     if (setUpPageStatus == 'complete') {
                    547:         return;
                    548:     }
                    549:   }
                    550:   setTimeout(SVGPluginBuilder_pollreadystate, 100);
                    551: }
                    552: 
                    553: SVGPluginBuilder.prototype.preload = function(frame, varname, url) {
                    554:   var embed = document.createElement("embed");
                    555:   embed.src = fileBase + url + getSuffix(this.contentType);
                    556:   embed.height = 100;
                    557:   embed.width = 100;
                    558:   embed.type = "image/svg+xml";
                    559:   embed.id = varname;
                    560:   var child = document.documentElement.firstChild;
                    561:   while(child != null) {
                    562:       if (child.nodeName != null && child.nodeName.toUpperCase() == "BODY") {
                    563:           child.appendChild(embed);
                    564:           break;
                    565:       }
                    566:       child = child.nextSibling;
                    567:   }
                    568:   //
                    569:   //   if unable to monitor ready state change then
                    570:   //     check if load is complete every in 0.1 second
                    571:   setTimeout(SVGPluginBuilder_pollreadystate , 100);
                    572:   return 0;
                    573: }
                    574: 
                    575: SVGPluginBuilder.prototype.load = function(frame, varname, url) {
                    576:   var child = document.documentElement.firstChild;
                    577:   while(child != null) {
                    578:       if (child.nodeName != null && child.nodeName.toUpperCase() == "BODY") {
                    579:                  var grand = child.firstChild;
                    580:                  while (grand != null) {
                    581:                        if (grand.id == varname) {
                    582:                                return grand.getSVGDocument();
                    583:                        }
                    584:                        grand = grand.nextSibling;
                    585:                  }
                    586:          }
                    587:       child = child.nextSibling;
                    588:    }
                    589:    return null;
                    590: }
                    591: 
                    592: SVGPluginBuilder.prototype.getImplementationAttribute = function(attr) {
                    593:     for (var i = 0; i < this.fixedAttributeNames.length; i++) {
                    594:         if (this.fixedAttributeNames[i] == attr) {
                    595:             return this.fixedAttributeValues[i];
                    596:         }
                    597:     }
                    598:     throw "Unrecognized implementation attribute: " + attr;
                    599: }
                    600: 
                    601: 
                    602: SVGPluginBuilder.prototype.setImplementationAttribute = function(attribute, value) {
                    603:     var supported = this.getImplementationAttribute(attribute);
                    604:     if (supported != value) {
1.34      dom-ts-4  605:         this.initializationError = "SVG Plugin loader does not support " + attribute + "=" + value;
1.20      dom-ts-4  606:     }
                    607: }
                    608: 
1.34      dom-ts-4  609: SVGPluginBuilder.prototype.canSetImplementationAttribute = function(attribute, value) {
                    610:     var supported = this.getImplementationAttribute(attribute);
                    611:     return (supported == value);
                    612: }
1.20      dom-ts-4  613: 
                    614: 
1.22      dom-ts-4  615: 
                    616: 
1.18      dom-ts-4  617: function MSXMLBuilder(progID) {
                    618:     this.progID = progID;
                    619:     this.configurableAttributeNames = [
                    620:         "validating", "ignoringElementContentWhitespace"];
                    621:     this.configurableAttributeValues = [ false, false ];
                    622:     this.fixedAttributeNames = [ "signed", "hasNullString", 
1.31      dom-ts-4  623:         "expandEntityReferences", "coalescing", "namespaceAware", "ignoringComments" ];
                    624:     this.fixedAttributeValues = [ true, true, false, false, false, false ];
1.18      dom-ts-4  625: 
                    626:     this.contentType = "text/xml";
                    627:     this.supportedContentTypes = [ 
                    628:         "text/xml", 
                    629:         "image/svg+xml", 
                    630:         "application/xhtml+xml",
                    631:         "text/mathml" ];
                    632: 
                    633:     this.async = false;
                    634:     this.supportsAsyncChange = true;
                    635:     this.parser = null;
1.34      dom-ts-4  636:     this.initializationError = null;
                    637:     this.initializationFatalError = null;
                    638:     this.skipIncompatibleTests = false;
1.18      dom-ts-4  639: }
                    640: 
                    641: MSXMLBuilder.prototype.createMSXML = function() {
1.19      dom-ts-4  642:     var parser = new ActiveXObject(this.progID);
1.18      dom-ts-4  643:     parser.async = this.async;
                    644:     parser.preserveWhiteSpace = !this.configurableAttributeValues[1];
                    645:     parser.validateOnParse = this.configurableAttributeValues[0];
                    646:     return parser;
                    647:   }
1.31      dom-ts-4  648:   
                    649: MSXMLBuilder.prototype.setContentType = function(contentType) {
                    650:     this.contentType = contentType;
                    651: }
                    652:   
1.18      dom-ts-4  653: 
                    654: MSXMLBuilder.prototype.preload = function(frame, varname, url) {
                    655:   if (this.async) {
                    656:      this.parser = this.createMSXML();
                    657:      parser.async = true;
                    658:      parser.onreadystatechange = MSXMLBuilder_onreadystatechange;
                    659:      parser.load(fileBase + url + getSuffix(this.contentType));
                    660:      if (parser.readystate != 4) {
                    661:         return 0;
                    662:      }
                    663:   }
                    664:   return 1;
                    665: }
                    666: 
                    667: MSXMLBuilder.prototype.load = function(frame, varname, url) {
1.19      dom-ts-4  668:     var parser = this.createMSXML();
1.18      dom-ts-4  669:        if(!parser.load(fileBase + url + getSuffix(this.contentType))) {
                    670:                throw parser.parseError.reason;
                    671:        }
                    672:     //
                    673:     //   if the first child of the document is a PI representing
                    674:     //      the XML Declaration, remove it from the tree.
                    675:     //
                    676:     //   According to the DOM FAQ, this behavior is not wrong,
                    677:     //      but the tests are written assuming that it is not there.
                    678:     //
                    679:     var xmlDecl = parser.firstChild;
                    680:     if(xmlDecl != null && xmlDecl.nodeType == 7 && xmlDecl.target.toLowerCase() == "xml") {
                    681:         parser.removeChild(xmlDecl);
                    682:     }
                    683:        return parser;
                    684: }
                    685: 
                    686: MSXMLBuilder.prototype.getImplementationAttribute = function(attr) {
                    687:     var i;
                    688:     for (i = 0; i < this.fixedAttributeNames.length; i++) {
                    689:         if (this.fixedAttributeNames[i] == attr) {
                    690:             return this.fixedAttributeValues[i];
                    691:         }
                    692:     }
                    693: 
                    694:     for (i = 0; i < this.configurableAttributeNames.length; i++) {
                    695:         if (this.configurableAttributeNames[i] == attr) {
                    696:             return this.configurableAttributeValues[i];
                    697:         }
                    698:     }
                    699: 
                    700:     throw "Unrecognized implementation attribute: " + attr;
                    701: }
                    702: 
                    703: 
                    704: MSXMLBuilder.prototype.setImplementationAttribute = function(attribute, value) {
                    705:     var i;
                    706:     for (i = 0; i < this.fixedAttributeNames.length; i++) {
1.19      dom-ts-4  707:         if (this.fixedAttributeNames[i] == attribute) {
1.18      dom-ts-4  708:             if (this.fixedAttributeValues[i] != value) {
1.34      dom-ts-4  709:                 this.initializationError = "MSXML does not support " + attribute + "=" + value;
1.18      dom-ts-4  710:             }
                    711:             return;
                    712:         }
                    713:     }
                    714:     for (i = 0; i < this.configurableAttributeNames.length; i++) {
                    715:         if (this.configurableAttributeNames[i] == attribute) {
                    716:             this.configurableAttributeValues[i] = value;
                    717:             return;
                    718:         }
                    719:     }
1.34      dom-ts-4  720:     this.initializationError = "Unrecognized implementation attribute: " + attr;
1.18      dom-ts-4  721: }
                    722:             
                    723: 
1.34      dom-ts-4  724: MSXMLBuilder.prototype.canSetImplementationAttribute = function(attribute, value) {
                    725:     var i;
                    726:     for (i = 0; i < this.fixedAttributeNames.length; i++) {
                    727:         if (this.fixedAttributeNames[i] == attribute) {
                    728:             return (this.fixedAttributeValues[i] == value);
                    729:         }
                    730:     }
                    731:     for (i = 0; i < this.configurableAttributeNames.length; i++) {
                    732:         if (this.configurableAttributeNames[i] == attribute) {
                    733:                return true;
                    734:         }
                    735:     }
                    736:     return false;
                    737: }
                    738: 
                    739: 
1.23      dom-ts-4  740: MSXMLBuilder.prototype.getImplementation = function() {
                    741:     var doc = this.CreateMSXML();
                    742:     return doc.implementation;
                    743: }
1.18      dom-ts-4  744: 
                    745: //
                    746: //   Only used to select tests compatible with implementation
                    747: //      not used on tests that actually test hasFeature()
                    748: //
                    749: MSXMLBuilder.prototype.hasFeature = function(feature, version) {
                    750:     //
                    751:     //   MSXML will take null, unfortunately 
                    752:     //      there is no way to get it to there from script
                    753:     //      without a type mismatch error
                    754:     if(version == null) {
                    755:                switch(feature.toUpperCase()) {
                    756:                   case "XML":
                    757:                   case "CORE":
                    758:                   return true;
                    759:                   
                    760:                   case "HTML":
                    761:                   case "ORG.W3C.DOM":
                    762:                   return false;
                    763:                }
                    764:                if(this.getDOMImplementation().hasFeature(feature,"1.0")) {
                    765:                   return true;
                    766:                }
                    767:                if(this.getDOMImplementation().hasFeature(feature,"2.0")) {
                    768:                   return true;
                    769:                }
                    770:                if(this.getDOMImplementation().hasFeature(feature,"3.0")) {
                    771:                   return true;
                    772:                }
                    773:     }
                    774:        return this.getDOMImplementation().hasFeature(feature,version);
                    775:   }
                    776: 
                    777: 
1.9       dom-ts-4  778: 
1.17      dom-ts-4  779: function MozillaXMLBuilder() {
1.18      dom-ts-4  780:     this.contentType = "text/xml";
                    781: 
                    782:     this.configurableAttributeNames = [ ];
                    783:     this.configurableAttributeValues = [ ];
                    784:     this.fixedAttributeNames = [ "validating", "ignoringElementContentWhitespace", "signed", 
1.31      dom-ts-4  785:         "hasNullString", "expandEntityReferences", "coalescing", "namespaceAware", "ignoringComments" ];
                    786:     this.fixedAttributeValues = [ false, false, true, true, false, false, false, false ];
1.18      dom-ts-4  787: 
                    788:     this.contentType = "text/xml";
                    789:     this.supportedContentTypes = [ 
                    790:         "text/xml", 
                    791:         "image/svg+xml", 
                    792:         "application/xhtml+xml",
                    793:         "text/mathml" ];
                    794: 
                    795:     this.async = true;
                    796:     this.supportsAsyncChange = false;
                    797: 
1.17      dom-ts-4  798:     this.docs = new Array();
                    799:     this.docnames = new Array();
1.34      dom-ts-4  800:     this.initializationError = null;
                    801:     this.initializationFatalError = null;
                    802:     this.skipIncompatibleTests = false;
1.17      dom-ts-4  803: }
1.1       dom-ts-4  804: 
1.23      dom-ts-4  805: MozillaXMLBuilder.prototype.getImplementation = function() {
                    806:     return document.implementation;
                    807: }
                    808: 
1.31      dom-ts-4  809: MozillaXMLBuilder.prototype.setContentType = function(contentType) {
                    810:     this.contentType = contentType;
                    811: }
                    812: 
                    813: 
1.23      dom-ts-4  814: 
1.17      dom-ts-4  815: MozillaXMLBuilder.prototype.preload = function(frame, varname, url) {
                    816:   var domimpl = document.implementation;
                    817:   var doc = domimpl.createDocument("", "temp", null);
                    818:   doc.addEventListener("load", loadComplete, false);
1.18      dom-ts-4  819:   doc.load(fileBase + url + getSuffix(this.contentType));
1.17      dom-ts-4  820:   this.docs[this.docs.length] = doc;
                    821:   this.docnames[this.docnames.length] = varname;
                    822:   return 0;
                    823: }
1.1       dom-ts-4  824: 
1.17      dom-ts-4  825: MozillaXMLBuilder.prototype.load = function(frame, varname, url) {
                    826:     for(i = 0; i < this.docnames.length; i++) {
                    827:         if (this.docnames[i] == varname) {
                    828:             return this.docs[i];
1.9       dom-ts-4  829:         }
                    830:     }
1.17      dom-ts-4  831:     return null;
                    832: }
1.1       dom-ts-4  833: 
1.9       dom-ts-4  834: 
1.17      dom-ts-4  835: MozillaXMLBuilder.prototype.getImplementationAttribute = function(attr) {
1.22      dom-ts-4  836:     for (var i = 0; i < this.fixedAttributeNames.length; i++) {
                    837:         if (this.fixedAttributeNames[i] == attr) {
                    838:             return this.fixedAttributeValues[i];
                    839:         }
                    840:     }
1.17      dom-ts-4  841:     return false;
                    842: }
1.1       dom-ts-4  843: 
                    844: 
1.33      dom-ts-4  845: MozillaXMLBuilder.prototype.hasFeature = function(feature, version)
                    846: {
                    847:   return this.getImplementation().hasFeature(feature, version);
                    848: }
                    849: 
                    850: MozillaXMLBuilder.prototype.setImplementationAttribute = function(attribute, value) {
                    851:     var supported = this.getImplementationAttribute(attribute);
                    852:     if (supported != value) {
1.34      dom-ts-4  853:         this.initializationError = "Mozilla XML loader does not support " + attribute + "=" + value;
1.33      dom-ts-4  854:     }
                    855: }
1.22      dom-ts-4  856: 
1.34      dom-ts-4  857: 
                    858: MozillaXMLBuilder.prototype.canSetImplementationAttribute = function(attribute, value) {
                    859:     var supported = this.getImplementationAttribute(attribute);
                    860:     return (supported == value);
                    861: }
                    862: 
1.22      dom-ts-4  863: function DOM3LSBuilder() {
                    864:     this.contentType = "text/xml";
                    865: 
1.34      dom-ts-4  866:     this.fixedAttributeNames = [ signed, "hasNullString" ];
                    867:     this.fixedAttributeValues = [ true, true ];
                    868:     this.configurableAttributeNames = [ "validating", "ignoringElementContentWhitespace", 
                    869:         "expandEntityReferences", "coalescing", "namespaceAware", "ignoringComments" ];
                    870:     this.configurableAttributeValues = [ false, false, true, true, false, false, true, false ];
                    871:     this.domConfigNames = [ "validate", "element-content-whitespace", 
                    872:         "entities", "cdata-sections", "namespaces", "comments" ];
                    873:     this.domConfigSense = [ true, false, false, false, true, false ];
1.22      dom-ts-4  874: 
                    875:     this.contentType = "text/xml";
                    876:     this.supportedContentTypes = [ 
                    877:         "text/xml", 
                    878:         "image/svg+xml", 
                    879:         "application/xhtml+xml",
                    880:         "text/mathml" ];
                    881: 
1.34      dom-ts-4  882:     this.async = false;
1.22      dom-ts-4  883:     this.supportsAsyncChange = true;
                    884: 
                    885:     this.docs = new Array();
                    886:     this.docnames = new Array();
1.34      dom-ts-4  887:     this.lsparser = null;
                    888:     this.initializationError = null;
                    889:     this.initializationFatalError = null;
                    890:     this.skipIncompatibleTests = false;    
1.22      dom-ts-4  891: }
                    892: 
1.23      dom-ts-4  893: DOM3LSBuilder.prototype.getImplementation = function() {
                    894:     return document.implementation;
                    895: }
                    896: 
                    897: 
1.31      dom-ts-4  898: DOM3LSBuilder.prototype.setContentType = function(contentType) {
                    899:     this.contentType = contentType;
                    900: }
                    901: 
1.22      dom-ts-4  902: DOM3LSBuilder.prototype.preload = function(frame, varname, url) {
1.34      dom-ts-4  903:   if (!this.async) {
                    904:         return 1;
                    905:   }
                    906:   var domimpl = document.implementation;
                    907:   this.lsparser = domimpl.createLSParser(2, null);
                    908:   this.lsparser.addEventListener("load", loadComplete, false);
                    909:   var uri = fileBase + url + getSuffix(this.contentType);
                    910:   var doc = this.lsparser.parseURI(uri);
                    911:   this.docs[this.docs.length] = doc;
                    912:   this.docnames[this.docnames.length] = varname;
                    913:   return 0;
1.22      dom-ts-4  914: }
                    915: 
                    916: DOM3LSBuilder.prototype.load = function(frame, varname, url) {
                    917:     if (this.async) {
                    918:         for(i = 0; i < this.docnames.length; i++) {
                    919:             if (this.docnames[i] == varname) {
                    920:                 return this.docs[i];
                    921:             }
                    922:         }
                    923:         return null;
                    924:     }
1.34      dom-ts-4  925:     this.lsparser = document.implementation.createLSParser(1, null);
1.22      dom-ts-4  926:     var uri = fileBase + url + getSuffix(this.contentType);
1.34      dom-ts-4  927:     return this.lsparser.parseURI(uri);
1.22      dom-ts-4  928: }
                    929: 
                    930: 
                    931: DOM3LSBuilder.prototype.getImplementationAttribute = function(attr) {
1.34      dom-ts-4  932:     var i;
                    933:     for (i = 0; i < this.fixedAttributeNames.length; i++) {
                    934:        if (this.fixedAttributeNames[i] == attr) {
                    935:            return this.fixedAttributeValues[i];
                    936:         }
                    937:     }
                    938:     for (i = 0; i < this.configurableAttributeNames.length; i++) {
                    939:         if (this.configurableAttributeNames[i] == attr) {
                    940:                if(this.lsparser.domConfig.getParameter(this.domConfigNames[i])) {
                    941:                        return this.domConfigSense[i];
                    942:                } else {
                    943:                        return !this.domConfigSense[i];
                    944:                }
1.22      dom-ts-4  945:         }
                    946:     }
1.34      dom-ts-4  947:     throw "unrecognized implementation attribute " + att;
1.22      dom-ts-4  948: }
                    949: 
1.28      dom-ts-4  950: DOM3LSBuilder.prototype.hasFeature = function(feature, version) {
                    951:     return document.implementation.hasFeature(feature, version);
                    952: }
                    953: 
                    954: 
1.34      dom-ts-4  955: 
1.18      dom-ts-4  956: function createBuilder(implementation) {
1.34      dom-ts-4  957:   if (implementation == null) {
                    958:        return new IFrameBuilder();
                    959:   }
1.18      dom-ts-4  960:   switch(implementation) {
                    961:     case "msxml3":
1.27      dom-ts-4  962:     return new MSXMLBuilder("Msxml2.DOMDocument.3.0");
1.18      dom-ts-4  963:     
                    964:     case "msxml4":
                    965:     return new MSXMLBuilder("Msxml2.DOMDocument.4.0");
                    966: 
1.33      dom-ts-4  967:     case "mozillaXML":
1.18      dom-ts-4  968:     return new MozillaXMLBuilder();
                    969: 
1.20      dom-ts-4  970:     case "svgplugin":
                    971:     return new SVGPluginBuilder();
1.18      dom-ts-4  972: 
                    973:     case "dom3ls":
1.22      dom-ts-4  974:     return new DOM3LSBuilder();
1.33      dom-ts-4  975:     
                    976:     case "iframe":
                    977:     return new IFrameBuilder();
1.34      dom-ts-4  978:     
                    979:     default:
                    980:     alert ("unrecognized implementation " + implementation);
1.18      dom-ts-4  981:   }
1.34      dom-ts-4  982:   return new IFrameBuilder();
1.18      dom-ts-4  983: }
                    984: 
1.30      dom-ts-4  985: function checkFeature(feature, version)
                    986: {
                    987:   if (!builder.hasFeature(feature, version))
                    988:   {
1.34      dom-ts-4  989:     //
                    990:     //   don't throw exception so that users can select to ignore the precondition
                    991:     //
                    992:     builder.initializationError = "builder does not support feature " + feature + " version " + version;
1.30      dom-ts-4  993:   }
                    994: }
                    995: 
1.34      dom-ts-4  996: function createConfiguredBuilder() {
                    997:        var builder = null;
                    998:        var contentType = null;
                    999:        var i;
                   1000:        var contentTypeSet = false;
                   1001:        var parm = null;
                   1002:        if (top && typeof(top.jsUnitParmHash) != 'undefined') {
                   1003:        builder = createBuilder(top.jsUnitGetParm('implementation'));
                   1004:        
                   1005:        parm = top.jsUnitGetParm("skipincompatibletests");
                   1006:        if (parm) {
                   1007:                if (parm == 'true') {
                   1008:                    builder.skipIncompatibleTests = true;
                   1009:                } else {
                   1010:                    builder.skipIncompatibleTests = false;
                   1011:                }
                   1012:        }
                   1013:        
                   1014:        if (top.jsUnitGetParm('asynchronous') == 'true' && builder.supportAsync) {
                   1015:                builder.async = true;
                   1016:        }
                   1017:        if (top.jsUnitGetParm('expandentityreferences')) {
                   1018:                if (top.jsUnitGetParm('expandEntityReferences') == 'true') {
                   1019:                builder.setImplementationAttribute('expandEntityReferences', true);
                   1020:                } else {
                   1021:                builder.setImplementationAttribute('expandEntityReferences', false);
                   1022:                }
                   1023:        }
                   1024:        if (top.jsUnitGetParm('ignoringelementcontentwhitespace')) {
                   1025:                if (top.jsUnitGetParm('ignoringElementContentWhitespace') == 'true') {
                   1026:                builder.setImplementationAttribute('ignoringElementContentWhitespace', true);
                   1027:                } else {
                   1028:                builder.setImplementationAttribute('ignoringElementContentWhitespace', false);
1.19      dom-ts-4 1029:             }
                   1030:         }
1.34      dom-ts-4 1031:        if (top.jsUnitGetParm('validating')) {
                   1032:                if (top.jsUnitGetParm('validating') == 'true') {
                   1033:                builder.setImplementationAttribute('validating', true);
                   1034:                } else {
                   1035:                builder.setImplementationAttribute('validating', false);
                   1036:                }
                   1037:        }
                   1038:        if (top.jsUnitGetParm('coalescing')) {
                   1039:                if (top.jsUnitGetParm('coalescing') == 'true') {
                   1040:                builder.setImplementationAttribute('coalescing', true);
                   1041:                } else {
                   1042:                builder.setImplementationAttribute('coalescing', false);
                   1043:                }
                   1044:        }
                   1045:        if (top.jsUnitGetParm('namespaceaware')) {
                   1046:                if (top.jsUnitGetParm('namespaceaware') == 'true') {
                   1047:                builder.setImplementationAttribute('namespaceAware', true);
                   1048:                } else {
                   1049:                builder.setImplementationAttribute('namespaceAware', false);
                   1050:                }
                   1051:        }
                   1052:        contentType = top.jsUnitGetParm('contenttype');
                   1053:        if (contentType != null) {
                   1054:                contentTypeSet = false;
                   1055:                for (i = 0; i < builder.supportedContentTypes.length; i++) {
                   1056:                if (builder.supportedContentTypes[i] == contentType) {
                   1057:                        builder.setContentType(contentType);
                   1058:                        contentTypeSet = true;
                   1059:                        break;
                   1060:                }
                   1061:                }
                   1062:                if (!contentTypeSet) {
                   1063:                this.exception = "Builder does not support content type " + contentType;
                   1064:                }
                   1065:        }
                   1066:        if (top.jsUnitGetParm('ignoringcomments')) {
                   1067:                if (top.jsUnitGetParm('ignoringcomments') == 'true') {
                   1068:                builder.setImplementationAttribute('ignoringComments', true);
                   1069:                } else {
                   1070:                builder.setImplementationAttribute('ignoringComments', false);
                   1071:                }
                   1072:        }
                   1073:        } else {
                   1074:        builder = new IFrameBuilder();
                   1075:        }
                   1076:        return builder;
1.18      dom-ts-4 1077: }
1.16      dom-ts-4 1078: 
                   1079: 
1.17      dom-ts-4 1080: function preload(frame, varname, url) {
                   1081:   return builder.preload(frame, varname, url);
1.15      dom-ts-4 1082: }
                   1083: 
1.17      dom-ts-4 1084: function load(frame, varname, url) {
                   1085:     return builder.load(frame, varname, url);
1.16      dom-ts-4 1086: }
1.15      dom-ts-4 1087: 
1.17      dom-ts-4 1088: function getImplementationAttribute(attr) {
                   1089:     return builder.getImplementationAttribute(attr);
1.15      dom-ts-4 1090: }
1.16      dom-ts-4 1091: 
1.9       dom-ts-4 1092: 
1.18      dom-ts-4 1093: function setImplementationAttribute(attribute, value) {
                   1094:     builder.setImplementationAttribute(attribute, value);
                   1095: }
                   1096: 
1.21      dom-ts-4 1097: function createXPathEvaluator(doc) {
                   1098:     try {
                   1099:         return doc.getFeature("XPath", null);
                   1100:     }
                   1101:     catch(ex) {
                   1102:     }
                   1103:     return doc;
                   1104: }
                   1105: 
1.38      dom-ts-4 1106: function toLowerArray(src) {
                   1107:    var newArray = new Array();
                   1108:    var i;
                   1109:    for (i = 0; i < src.length; i++) {
                   1110:       newArray[i] = src[i].toLowerCase();
                   1111:    }
                   1112:    return newArray;
                   1113: }
1.10      dom-ts-4 1114: 
1.18      dom-ts-4 1115: function MSXMLBuilder_onreadystatechange() {
                   1116:     if (builder.parser.readyState == 4) {
                   1117:         loadComplete();
                   1118:     }
1.19      dom-ts-4 1119: }
                   1120: 
                   1121: 
                   1122: var fileBase = location.href;
                   1123: if (fileBase.indexOf('?') != -1) {
                   1124:    fileBase = fileBase.substring(0, fileBase.indexOf('?'));
                   1125: }
1.20      dom-ts-4 1126: fileBase = fileBase.substring(0, fileBase.lastIndexOf('/') + 1) + "files/";
                   1127: 
1.23      dom-ts-4 1128: function getImplementation() {
                   1129:     return builder.getImplementation();
                   1130: }
1.19      dom-ts-4 1131: 

Webmaster