From d3461c28de79baf051797309f05f25ec9a04cfbf Mon Sep 17 00:00:00 2001 From: "axel%pike.org" Date: Fri, 19 Apr 2002 14:05:47 +0000 Subject: [PATCH] NOT PART OF BUILD, testcase harnish. This is a big overhaul of buster, moving to rdf controlled trees. The index is now part of the testcases, which makes it easier to keep them up-to-date. I also started improving the support for HTML testcases. Another new feature is the support for saving and loading results. Plus alot of internal cleanup, though there's still more to come. git-svn-id: svn://10.0.0.236/trunk@119398 18797224-902f-48f8-a5cc-f745e15eee43 --- .../transformiix/resources/buster/DiffDOM.js | 24 +- .../transformiix/resources/buster/ReadMe | 12 +- .../resources/buster/buster-files.js | 127 + .../resources/buster/buster-handlers.js | 79 + .../resources/buster/buster-statics.js | 117 + .../resources/buster/buster-test.js | 314 ++ .../resources/buster/buster-view.js | 164 + .../buster/{txTools.css => buster.css} | 24 +- .../transformiix/resources/buster/buster.xul | 177 +- .../resources/buster/complete-xalanindex.xml | 4602 ----------------- .../resources/buster/helper/conf_sheets.xml | 1483 ------ .../resources/buster/helper/generate-rdf.pl | 69 + .../resources/buster/helper/sheet2index.xsl | 38 - .../resources/buster/result-view.css | 12 + .../resources/buster/result-view.js | 77 + .../resources/buster/result-view.xul | 53 + .../transformiix/resources/buster/txTools.js | 146 - .../resources/buster/xalanindex.xml | 48 - .../resources/buster/xulTxTools.js | 303 -- 19 files changed, 1188 insertions(+), 6681 deletions(-) create mode 100644 mozilla/extensions/transformiix/resources/buster/buster-files.js create mode 100644 mozilla/extensions/transformiix/resources/buster/buster-handlers.js create mode 100644 mozilla/extensions/transformiix/resources/buster/buster-statics.js create mode 100644 mozilla/extensions/transformiix/resources/buster/buster-test.js create mode 100644 mozilla/extensions/transformiix/resources/buster/buster-view.js rename mozilla/extensions/transformiix/resources/buster/{txTools.css => buster.css} (70%) delete mode 100644 mozilla/extensions/transformiix/resources/buster/complete-xalanindex.xml delete mode 100644 mozilla/extensions/transformiix/resources/buster/helper/conf_sheets.xml create mode 100644 mozilla/extensions/transformiix/resources/buster/helper/generate-rdf.pl delete mode 100644 mozilla/extensions/transformiix/resources/buster/helper/sheet2index.xsl create mode 100644 mozilla/extensions/transformiix/resources/buster/result-view.css create mode 100644 mozilla/extensions/transformiix/resources/buster/result-view.js create mode 100644 mozilla/extensions/transformiix/resources/buster/result-view.xul delete mode 100644 mozilla/extensions/transformiix/resources/buster/txTools.js delete mode 100644 mozilla/extensions/transformiix/resources/buster/xalanindex.xml delete mode 100644 mozilla/extensions/transformiix/resources/buster/xulTxTools.js diff --git a/mozilla/extensions/transformiix/resources/buster/DiffDOM.js b/mozilla/extensions/transformiix/resources/buster/DiffDOM.js index 8a29463caa4..caa3fe4daa8 100644 --- a/mozilla/extensions/transformiix/resources/buster/DiffDOM.js +++ b/mozilla/extensions/transformiix/resources/buster/DiffDOM.js @@ -24,8 +24,11 @@ // DiffDOM(node1,node2) // ---------------------- -function DiffDOM(node1,node2) +var isHTML = false; + +function DiffDOM(node1, node2, aIsHTML) { + isHTML = aIsHTML; return DiffNodeAndChildren(node1, node2); } @@ -68,12 +71,19 @@ function DiffNodeAndChildren(node1, node2) return ErrorUp("Different number of attributes", node1, node2); } - if (node1.nodeName!=node2.nodeName) - return ErrorUp("Different node names", node1, node2); + if (isHTML) { + if (node1.nodeName.toLowerCase()!=node2.nodeName.toLowerCase()) + return ErrorUp("Different node names", node1, node2); + } + else { + if (node1.nodeName!=node2.nodeName) + return ErrorUp("Different node names", node1, node2); + } if (node1.nodeValue!=node2.nodeValue) return ErrorUp("Different node values", node1, node2); - if (node1.namespaceURI!=node2.namespaceURI) - return ErrorUp("Different namespace", node1, node2); + if (!isHTML) + if (node1.namespaceURI!=node2.namespaceURI) + return ErrorUp("Different namespace", node1, node2); if (node1.hasChildNodes() != node2.hasChildNodes()) return ErrorUp("Different children", node1, node2); if (node1.childNodes) { @@ -97,14 +107,14 @@ function ErrorUp(errMsg, node1, node2) if (node1.nodeType == Node.TEXT_NODE) dump("nodeValue: "+node1.nodeValue+"\n"); else - dump("nodeName: "+node1.nodeName+"\n"); + dump("nodeName: "+node1.namespaceURI+":"+node1.nodeName+"\n"); } if (node2) { dump("Node 2: "+node2+", "); if (node2.nodeType == Node.TEXT_NODE) dump("nodeValue: "+node2.nodeValue+"\n"); else - dump("nodeName: "+node2.nodeName+"\n"); + dump("nodeName: "+node2.namespaceURI+":"+node2.nodeName+"\n"); } return false; } diff --git a/mozilla/extensions/transformiix/resources/buster/ReadMe b/mozilla/extensions/transformiix/resources/buster/ReadMe index 0f03e514b52..2bdd899e14e 100644 --- a/mozilla/extensions/transformiix/resources/buster/ReadMe +++ b/mozilla/extensions/transformiix/resources/buster/ReadMe @@ -5,20 +5,18 @@ in http://www.axel.pike.org/mozilla/xalan.tar.gz. Please see the included LICENSE.txt or http://xml.apache.org/dist/LICENSE.txt for terms of distributing those files. -To use the buster, open buster.xul with a XSLT enabled Mozilla. Warning, -it takes quite a while until that page is fully loaded, and due to bug -http://bugzilla.mozilla.org/show_bug.cgi?id=70324, we don't have scrolling. -You can use regular expressions to narrow the set of tests to run. +To use the buster, open buster.xul with a XSLT enabled Mozilla. +Open the rdf index file shipped with the test package into the +"Xalan index", and the available tests will show up as a tree. Once you have selected the tests you're interested in, press the button "run checked tests", and all the tests will be run. +You can save the results into an rdf, and load it for comparison and +regression hunting. DiffDOM tries to find out, which tests failed, and will DumpDOM both the result and the reference solution. Not all reference solutions load properly, those need manual love. -All of the code was done sleeping, and is not intended as example of good -code. It's for debugging only! - Good luck and fun Axel Hecht \ No newline at end of file diff --git a/mozilla/extensions/transformiix/resources/buster/buster-files.js b/mozilla/extensions/transformiix/resources/buster/buster-files.js new file mode 100644 index 00000000000..d62f5511d1a --- /dev/null +++ b/mozilla/extensions/transformiix/resources/buster/buster-files.js @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is TransforMiiX XSLT Processor. + * + * The Initial Developer of the Original Code is + * Axel Hecht. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Axel Hecht + * Peter Van der Beken + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +enablePrivilege('UniversalXPConnect'); +const kFTSCID = "@mozilla.org/network/file-transport-service;1"; +const nsIFileTransportService = Components.interfaces.nsIFileTransportService; +const kFileTransportService = doCreate(kFTSCID, nsIFileTransportService); + +var cmdFileController = +{ + supportsCommand: function(aCommand) + { + switch(aCommand) { + case 'cmd_fl_save': + case 'cmd_fl_import': + return true; + default: + } + return false; + }, + isCommandEnabled: function(aCommand) + { + return this.supportsCommand(aCommand); + }, + doCommand: function(aCommand) + { + enablePrivilege('UniversalXPConnect'); + switch(aCommand) { + case 'cmd_fl_save': + var serial = doCreate(kRDFXMLSerializerID, + nsIRDFXMLSerializer); + var sink = new Object; + sink.content = ''; + sink.write = function(aContent, aCount) + { + this.content += aContent; + return aCount; + }; + serial.init(view.memoryDataSource); + serial.QueryInterface(nsIRDFXMLSource); + serial.Serialize(sink); + if (!sink.content.length) { + return; + } + // replace NC:succ with NC:orig_succ, so the rdf stuff differs + var content = sink.content.replace(/NC:succ/g,"NC:orig_succ"); + var fp = doCreateRDFFP('Xalan results', + nsIFilePicker.modeSave); + var res = fp.show(); + + if (res == nsIFilePicker.returnOK || + res == nsIFilePicker.returnReplace) { + var fl = fp.file; + var trans = kFileTransportService.createTransport + (fl, 26, // NS_WRONLY + NS_CREATE_FILE + NS_TRUNCATE + 'w', true); + var out = trans.openOutputStream(0, -1, 0); + out.write(content, content.length); + out.close(); + delete out; + delete trans; + fp.file.permissions = 420; + } + break; + case 'cmd_fl_import': + var fp = doCreateRDFFP('Previous Xalan results', + nsIFilePicker.modeLoad); + var res = fp.show(); + + if (res == nsIFilePicker.returnOK) { + var fl = fp.file; + if (view.previousResults) { + view.database.RemoveDataSource(view.previousResults); + view.previousResults = null; + } + view.database.RemoveDataSource(view.memoryDataSource); + view.previousResults = kRDFSvc.GetDataSource(fp.fileURL.spec); + view.database.AddDataSource(view.previousResults); + view.database.AddDataSource(view.memoryDataSource); + } + + document.getElementById('obs_orig_success') + .setAttribute('hidden','false'); + break; + default: + alert('Unknown Command'+aCommand); + } + } +}; + +registerController(cmdFileController); diff --git a/mozilla/extensions/transformiix/resources/buster/buster-handlers.js b/mozilla/extensions/transformiix/resources/buster/buster-handlers.js new file mode 100644 index 00000000000..cec72977e64 --- /dev/null +++ b/mozilla/extensions/transformiix/resources/buster/buster-handlers.js @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is TransforMiiX XSLT Processor. + * + * The Initial Developer of the Original Code is + * Axel Hecht. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Axel Hecht + * Peter Van der Beken + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var xalan_field; + +function onLoad() +{ + view.tests_run = document.getElementById("tests_run"); + view.tests_passed = document.getElementById("tests_passed"); + view.tests_failed = document.getElementById("tests_failed"); + view.tests_selected = document.getElementById("tests_selected"); + view.tree = document.getElementById('out'); + view.boxObject = view.tree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject); + enablePrivilege('UniversalXPConnect'); + // prune the spurious children of the iframe doc + { + var iframe = document.getElementById('hiddenHtml').contentDocument; + var children = iframe.childNodes; + var cn = children.length; + for (var i = cn-1; i >=0 ; i--) { + if (children[i] != iframe.documentElement) + iframe.removeChild(children[i]); + } + } + view.database = view.tree.database; + view.builder = view.tree.builder.QueryInterface(nsIXULTemplateBuilder); + view.builder.QueryInterface(nsIXULTreeBuilder); + runItem.prototype.kDatabase = view.database; + xalan_field = document.getElementById("xalan_rdf"); + var persistedUrl = xalan_field.getAttribute('url'); + if (persistedUrl) { + view.xalan_url = persistedUrl; + xalan_field.value = persistedUrl; + } + view.setDataSource(); + return true; +} + +function onUnload() +{ + if (xalan_field) + xalan_field.setAttribute('url', xalan_field.value); +} diff --git a/mozilla/extensions/transformiix/resources/buster/buster-statics.js b/mozilla/extensions/transformiix/resources/buster/buster-statics.js new file mode 100644 index 00000000000..a1ece49c59e --- /dev/null +++ b/mozilla/extensions/transformiix/resources/buster/buster-statics.js @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is TransforMiiX XSLT Processor. + * + * The Initial Developer of the Original Code is + * Axel Hecht. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Axel Hecht + * Peter Van der Beken + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +// priviledge shortcut +enablePrivilege = netscape.security.PrivilegeManager.enablePrivilege; + +// helper function to shortcut component creation +function doCreate(aContract, aInterface) +{ + enablePrivilege('UniversalXPConnect'); + return Components.classes[aContract].createInstance(aInterface); +} + +// for the items, loading a text file +const IOSERVICE_CTRID = "@mozilla.org/network/io-service;1"; +const nsIIOService = Components.interfaces.nsIIOService; +const SIS_CTRID = "@mozilla.org/scriptableinputstream;1" +const nsISIS = Components.interfaces.nsIScriptableInputStream; + +// rdf foo, onload handler +enablePrivilege('UniversalXPConnect'); +const kRDFSvcContractID = "@mozilla.org/rdf/rdf-service;1"; +const kRDFInMemContractID = + "@mozilla.org/rdf/datasource;1?name=in-memory-datasource"; +const kRDFContUtilsID = "@mozilla.org/rdf/container-utils;1"; +const kRDFXMLSerializerID = "@mozilla.org/rdf/xml-serializer;1"; +const kIOSvcContractID = "@mozilla.org/network/io-service;1"; +const kStandardURL = Components.classes["@mozilla.org/network/standard-url;1"]; +const nsIURL = Components.interfaces.nsIURL; +const nsIStandardURL = Components.interfaces.nsIStandardURL; +const nsIFilePicker = Components.interfaces.nsIFilePicker; +const nsIXULTreeBuilder = Components.interfaces.nsIXULTreeBuilder; +const nsIXULTemplateBuilder = Components.interfaces.nsIXULTemplateBuilder; +const kIOSvc = Components.classes[kIOSvcContractID] + .getService(Components.interfaces.nsIIOService); +const nsIRDFService = Components.interfaces.nsIRDFService; +const nsIRDFDataSource = Components.interfaces.nsIRDFDataSource; +const nsIRDFResource = Components.interfaces.nsIRDFResource; +const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral; +const nsIRDFContainerUtils = Components.interfaces.nsIRDFContainerUtils; +const nsIRDFXMLSerializer = Components.interfaces.nsIRDFXMLSerializer; +const nsIRDFXMLSource = Components.interfaces.nsIRDFXMLSource; +const kRDFSvc = + Components.classes[kRDFSvcContractID].getService(nsIRDFService); +const krTypeCat = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#category"); +const krTypeName = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#name"); +const krTypeSucc = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#succ"); +const krTypePath = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#path"); +const kGood = kRDFSvc.GetLiteral("yes"); +const kBad = kRDFSvc.GetLiteral("no"); +const kMixed = kRDFSvc.GetLiteral("+-"); +const kContUtils = doCreate(kRDFContUtilsID, nsIRDFContainerUtils); + +function doCreateRDFFP(aTitle, aMode) +{ + enablePrivilege('UniversalXPConnect'); + var fp = doCreate("@mozilla.org/filepicker;1", nsIFilePicker); + fp.init(window, aTitle, aMode); + fp.appendFilter('*.rdf', '*.rdf'); + fp.appendFilters(nsIFilePicker.filterAll); + return fp; +} + +function goDoCommand(aCommand) +{ + try { + enablePrivilege('UniversalXPConnect'); + var controller = + top.document.commandDispatcher.getControllerForCommand(aCommand); + if (controller && controller.isCommandEnabled(aCommand)) + controller.doCommand(aCommand); + } + catch(e) { + dump("An error "+e+" occurred executing the "+aCommand+" command\n"); + } +} + +function registerController(aController) +{ + top.controllers.appendController(aController); +} diff --git a/mozilla/extensions/transformiix/resources/buster/buster-test.js b/mozilla/extensions/transformiix/resources/buster/buster-test.js new file mode 100644 index 00000000000..c1d8e5f27b3 --- /dev/null +++ b/mozilla/extensions/transformiix/resources/buster/buster-test.js @@ -0,0 +1,314 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is TransforMiiX XSLT Processor. + * + * The Initial Developer of the Original Code is + * Axel Hecht. + * Portions created by the Initial Developer are Copyright (C) 2002 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Axel Hecht + * Peter Van der Beken + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var parser = new DOMParser(); + +var runQueue = +{ + mArray : new Array(), + push : function(aRunItem) + { + this.mArray.push(aRunItem); + }, + observe : function(aSubject, aTopic, aData) + { + item = this.mArray.shift(); + if (item) { + item.run(this); + } + }, + run : function() + { + this.observe(null,'',''); + } +} + +var itemCache = +{ + mArray : new Array(), + getItem : function(aResource) + { + enablePrivilege('UniversalXPConnect'); + // Directory selected + if (kContUtils.IsSeq(runItem.prototype.kDatabase, aResource)) { + var aSeq = kContUtils.MakeSeq(runItem.prototype.kDatabase, aResource); + dump("sequence: "+aSeq+" with "+aSeq.GetCount()+" elements\n"); + var child, children = aSeq.GetElements(); + var m = 0, first; + while (children.hasMoreElements()) { + m += 1; + child = children.getNext(); + child.QueryInterface(nsIRDFResource); + if (!first) + first = itemCache.getItem(child); + else + itemCache.getItem(child); + } + return first; + } + var retItem = this.mArray[aResource.Value]; + if (retItem) { + return retItem; + } + retItem = new runItem(aResource); + this.mArray[aResource.Value] = retItem; + runQueue.push(retItem); + return retItem; + }, + rerunItem : function(aResource, aObserver) + { + var anItem = new runItem(aResource); + this.mArray[aResource.Value] = anItem; + anItem.run(aObserver); + }, + observe : function(aSubject, aTopic, aData) + { + this.mRun += 1; + if (aTopic == "success") { + if (aData == "yes") { + this.mGood += 1; + } + else { + this.mFalse +=1; + } + } + } +} + +function runItem(aResource) +{ + enablePrivilege('UniversalXPConnect'); + this.mResource = aResource; + // Directory selected + if (kContUtils.IsSeq(this.kDatabase,this.mResource)) { + var aSeq = kContUtils.MakeSeq(this.kDatabase,this.mResource); + dump("THIS SHOULDN'T HAPPEN\n"); + var child, children = aSeq.GetElements(); + var m = 0; + while (children.hasMoreElements()) { + m += 1; + child = children.getNext(); + child.QueryInterface(nsIRDFResource); + itemCache.getItem(child); + } + } +} + +enablePrivilege('UniversalXPConnect'); +runItem.prototype = +{ + // RDF resource associated with this test + mResource : null, + // XML documents for the XSLT transformation + mSourceDoc : null, + mStyleDoc : null, + mResDoc : null, + // XML or plaintext document for the reference + mRefDoc : null, + // bitfield signaling the loaded documents + mLoaded : 0, + kSource : 1, + kStyle : 2, + kReference : 4, + // a observer, potential argument to run() + mObserver : null, + mSuccess : null, + mMethod : 'xml', + // XSLTProcessor, shared by the instances + kProcessor : new XSLTProcessor(), + kXalan : kStandardURL.createInstance(nsIURL), + kDatabase : null, + kObservers : new Array(), + + run : function(aObserver) + { + if (aObserver && typeof(aObserver)=='function' || + (typeof(aObserver)=='object' && + typeof(aObserver.observe)=='function')) { + this.mObserver=aObserver; + } + var name = this.kDatabase.GetTarget(this.mResource, krTypeName, true); + if (name) { + var cat = this.kDatabase.GetTarget(this.mResource, krTypeCat, true); + var path = this.kDatabase.GetTarget(this.mResource, krTypePath, true); + cat = cat.QueryInterface(nsIRDFLiteral); + name = name.QueryInterface(nsIRDFLiteral); + path = path.QueryInterface(nsIRDFLiteral); + xalan_fl = this.kXalan.resolve(cat.Value+"/"+path.Value); + xalan_ref = this.kXalan.resolve(cat.Value+"-gold/"+path.Value); + dump(name.Value+" links to "+xalan_fl+"\n"); + } + // Directory selected + if (kContUtils.IsSeq(this.kDatabase,this.mResource)) { + return; + var aSeq = kContUtils.MakeSeq(this.kDatabase,this.mResource); + dump("sequence: "+aSeq+" with "+aSeq.GetCount()+" elements\n"); + var child, children = aSeq.GetElements(); + var m = 0; + while (children.hasMoreElements()) { + m += 1; + child = children.getNext(); + child.QueryInterface(nsIRDFResource); + //var aFoo = new runItem(child); + } + } + var refContent = this.loadTextFile(xalan_ref+".out"); + if (refContent.match(/^<\?xml/)) { + this.mRefDoc = parser.parseFromString(refContent, 'text/xml'); + } + else if (refContent.match(/^\s* + * Peter Van der Beken + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var view = +{ + onRun : function() + { + var sels = this.boxObject.selection,a=new Object(),b=new Object(),k; + var rowResource, name, path; + enablePrivilege('UniversalXPConnect'); + for (k=0;k (Original Author) */ -text.head { + +label.head { padding: 5px; font-size: medium; font-weight: bold; } -treechildren:-moz-tree-row(success) +treechildren:-moz-tree-cell(success yes) { - background-color: green; + background-color: green ; } -treechildren:-moz-tree-row(fail) +treechildren:-moz-tree-cell(success no) { - background-color: red; -} - -treechildren:-moz-tree-row(selected) -{ - border: 1px solid blue; - background-color: white ; -} - -treechildren:-moz-tree-cell-text(selected) -{ - color: black; + background-color: red ; } diff --git a/mozilla/extensions/transformiix/resources/buster/buster.xul b/mozilla/extensions/transformiix/resources/buster/buster.xul index fd83136462d..807a29167fa 100644 --- a/mozilla/extensions/transformiix/resources/buster/buster.xul +++ b/mozilla/extensions/transformiix/resources/buster/buster.xul @@ -22,34 +22,79 @@ --> - + - + +