Merge autoland to mozilla-central r=merge a=merge
authorNoemi Erli <nerli@mozilla.com>
Thu, 04 Jan 2018 11:44:30 +0200
changeset 397717 f78a83244fbebe8a469ae3512fce7f638cab7e1f
parent 397678 5afa32a16a2f7ebbd8bf19e49efc50832110980d (current diff)
parent 397716 3ede11fe526eed5f34040399dfaed3af8f1e7c71 (diff)
child 397718 a0a92beb14a08dbce68718573242fb7ac8de0167
child 397771 43d4a4750c0e730789f74a7516430b93b9b97ba6
push id33189
push usernerli@mozilla.com
push dateThu, 04 Jan 2018 09:45:12 +0000
treeherdermozilla-central@f78a83244fbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge, merge
milestone59.0a1
first release with
nightly linux32
f78a83244fbe / 59.0a1 / 20180104100157 / files
nightly linux64
f78a83244fbe / 59.0a1 / 20180104100157 / files
nightly mac
f78a83244fbe / 59.0a1 / 20180104100157 / files
nightly win32
f78a83244fbe / 59.0a1 / 20180104100157 / files
nightly win64
f78a83244fbe / 59.0a1 / 20180104100157 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge autoland to mozilla-central r=merge a=merge
dom/tests/mochitest/general/test_interfaces.js
dom/webidl/XULTemplateBuilder.webidl
dom/xslt/tests/buster/DiffDOM.js
dom/xslt/tests/buster/DumpDOM.js
dom/xslt/tests/buster/ReadMe
dom/xslt/tests/buster/buster-files.js
dom/xslt/tests/buster/buster-handlers.js
dom/xslt/tests/buster/buster-statics.js
dom/xslt/tests/buster/buster-test.js
dom/xslt/tests/buster/buster-view.js
dom/xslt/tests/buster/buster.css
dom/xslt/tests/buster/buster.xul
dom/xslt/tests/buster/helper/generate-rdf.pl
dom/xslt/tests/buster/install.js
dom/xslt/tests/buster/jar.mn
dom/xslt/tests/buster/result-inspector.xul
dom/xslt/tests/buster/result-view.css
dom/xslt/tests/buster/result-view.js
dom/xslt/tests/buster/result-view.xul
dom/xslt/tests/buster/xslt-qa-overlay.js
dom/xslt/tests/buster/xslt-qa-overlay.xul
dom/xul/crashtests/583230.xul
dom/xul/templates/crashtests/257752-1-recursion.rdf
dom/xul/templates/crashtests/257752-1-recursion.xul
dom/xul/templates/crashtests/329884-1.xul
dom/xul/templates/crashtests/330012-1.rdf
dom/xul/templates/crashtests/330012-1.xul
dom/xul/templates/crashtests/404346-1.xul
dom/xul/templates/crashtests/415019-1.xul
dom/xul/templates/crashtests/417840-1.xul
dom/xul/templates/crashtests/424418-1.xul
dom/xul/templates/crashtests/crashtests.list
dom/xul/templates/moz.build
dom/xul/templates/nsContentSupportMap.cpp
dom/xul/templates/nsContentSupportMap.h
dom/xul/templates/nsContentTestNode.cpp
dom/xul/templates/nsContentTestNode.h
dom/xul/templates/nsIXULBuilderListener.idl
dom/xul/templates/nsIXULSortService.idl
dom/xul/templates/nsIXULTemplateBuilder.idl
dom/xul/templates/nsIXULTemplateQueryProcessor.idl
dom/xul/templates/nsIXULTemplateResult.idl
dom/xul/templates/nsIXULTemplateRuleFilter.idl
dom/xul/templates/nsInstantiationNode.cpp
dom/xul/templates/nsInstantiationNode.h
dom/xul/templates/nsRDFBinding.cpp
dom/xul/templates/nsRDFBinding.h
dom/xul/templates/nsRDFConInstanceTestNode.cpp
dom/xul/templates/nsRDFConInstanceTestNode.h
dom/xul/templates/nsRDFConMemberTestNode.cpp
dom/xul/templates/nsRDFConMemberTestNode.h
dom/xul/templates/nsRDFPropertyTestNode.cpp
dom/xul/templates/nsRDFPropertyTestNode.h
dom/xul/templates/nsRDFQuery.cpp
dom/xul/templates/nsRDFQuery.h
dom/xul/templates/nsRDFTestNode.h
dom/xul/templates/nsResourceSet.cpp
dom/xul/templates/nsResourceSet.h
dom/xul/templates/nsRuleNetwork.cpp
dom/xul/templates/nsRuleNetwork.h
dom/xul/templates/nsTemplateMap.h
dom/xul/templates/nsTemplateMatch.cpp
dom/xul/templates/nsTemplateMatch.h
dom/xul/templates/nsTemplateRule.cpp
dom/xul/templates/nsTemplateRule.h
dom/xul/templates/nsTreeRows.cpp
dom/xul/templates/nsTreeRows.h
dom/xul/templates/nsXMLBinding.cpp
dom/xul/templates/nsXMLBinding.h
dom/xul/templates/nsXULContentBuilder.cpp
dom/xul/templates/nsXULContentUtils.cpp
dom/xul/templates/nsXULContentUtils.h
dom/xul/templates/nsXULResourceList.h
dom/xul/templates/nsXULSortService.cpp
dom/xul/templates/nsXULSortService.h
dom/xul/templates/nsXULTemplateBuilder.cpp
dom/xul/templates/nsXULTemplateBuilder.h
dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
dom/xul/templates/nsXULTemplateQueryProcessorRDF.h
dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp
dom/xul/templates/nsXULTemplateQueryProcessorStorage.h
dom/xul/templates/nsXULTemplateQueryProcessorXML.cpp
dom/xul/templates/nsXULTemplateQueryProcessorXML.h
dom/xul/templates/nsXULTemplateResultRDF.cpp
dom/xul/templates/nsXULTemplateResultRDF.h
dom/xul/templates/nsXULTemplateResultSetRDF.cpp
dom/xul/templates/nsXULTemplateResultSetRDF.h
dom/xul/templates/nsXULTemplateResultStorage.cpp
dom/xul/templates/nsXULTemplateResultStorage.h
dom/xul/templates/nsXULTemplateResultXML.cpp
dom/xul/templates/nsXULTemplateResultXML.h
dom/xul/templates/nsXULTreeBuilder.cpp
dom/xul/templates/nsXULTreeBuilder.h
dom/xul/templates/tests/chrome/animals.rdf
dom/xul/templates/tests/chrome/animals.sqlite
dom/xul/templates/tests/chrome/animals.xml
dom/xul/templates/tests/chrome/bug441785-1.rdf
dom/xul/templates/tests/chrome/bug441785-2.rdf
dom/xul/templates/tests/chrome/chrome.ini
dom/xul/templates/tests/chrome/file_bug330010.rdf
dom/xul/templates/tests/chrome/templates_shared.js
dom/xul/templates/tests/chrome/test_bug329335.xul
dom/xul/templates/tests/chrome/test_bug330010.xul
dom/xul/templates/tests/chrome/test_bug397148.xul
dom/xul/templates/tests/chrome/test_bug441785.xul
dom/xul/templates/tests/chrome/test_bug476634.xul
dom/xul/templates/tests/chrome/test_sortservice.xul
dom/xul/templates/tests/chrome/test_tmpl_bindingsextendedsyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_bindingsmultiple.xul
dom/xul/templates/tests/chrome/test_tmpl_bindingsquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_bindingsreversed.xul
dom/xul/templates/tests/chrome/test_tmpl_bindingssameastriple.xul
dom/xul/templates/tests/chrome/test_tmpl_containerandmembervariablechanged.xul
dom/xul/templates/tests/chrome/test_tmpl_containervariablechanged.xul
dom/xul/templates/tests/chrome/test_tmpl_containmentattribute.xul
dom/xul/templates/tests/chrome/test_tmpl_defaultcontainervariableisuri.xul
dom/xul/templates/tests/chrome/test_tmpl_errors.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxemptyconditions.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxotherrefvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxremoveunmatched.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxsimplevariablesubstitution.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxtworulesrecurse.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxusinganinterveningcontainer.xul
dom/xul/templates/tests/chrome/test_tmpl_extendedvariablesubstitution.xul
dom/xul/templates/tests/chrome/test_tmpl_gridelement.xul
dom/xul/templates/tests/chrome/test_tmpl_htmlelementextendedsyntaxwithbinding.xul
dom/xul/templates/tests/chrome/test_tmpl_htmlelementquerysyntaxrecursive.xul
dom/xul/templates/tests/chrome/test_tmpl_htmlelementquerysyntaxwithmultiplerules.xul
dom/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntaxusingatextnode.xul
dom/xul/templates/tests/chrome/test_tmpl_invalidqp.xul
dom/xul/templates/tests/chrome/test_tmpl_listboxelement.xul
dom/xul/templates/tests/chrome/test_tmpl_literalasmember.xul
dom/xul/templates/tests/chrome/test_tmpl_membervariablechanged.xul
dom/xul/templates/tests/chrome/test_tmpl_membervariablesubstitution.xul
dom/xul/templates/tests/chrome/test_tmpl_menuelement.xul
dom/xul/templates/tests/chrome/test_tmpl_menuelementrecursive.xul
dom/xul/templates/tests/chrome/test_tmpl_menulistelement.xul
dom/xul/templates/tests/chrome/test_tmpl_mixedsyntaxiscontainer.xul
dom/xul/templates/tests/chrome/test_tmpl_mixedsyntaxiscontainerisempty.xul
dom/xul/templates/tests/chrome/test_tmpl_mixedsyntaxisempty.xul
dom/xul/templates/tests/chrome/test_tmpl_noaction.xul
dom/xul/templates/tests/chrome/test_tmpl_noactionuriattribute.xul
dom/xul/templates/tests/chrome/test_tmpl_parentconditions.xul
dom/xul/templates/tests/chrome/test_tmpl_parentcontenttag.xul
dom/xul/templates/tests/chrome/test_tmpl_parentsimplesyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_query3triples.xul
dom/xul/templates/tests/chrome/test_tmpl_query3tripleswherecontains.xul
dom/xul/templates/tests/chrome/test_tmpl_querymember3tripleswhereequals.xul
dom/xul/templates/tests/chrome/test_tmpl_querymemberandtwotriples.xul
dom/xul/templates/tests/chrome/test_tmpl_querymembertriplemembertriple.xul
dom/xul/templates/tests/chrome/test_tmpl_queryresourcematch.xul
dom/xul/templates/tests/chrome/test_tmpl_queryreversetriple.xul
dom/xul/templates/tests/chrome/test_tmpl_queryselfwithtriple.xul
dom/xul/templates/tests/chrome/test_tmpl_querysetone.xul
dom/xul/templates/tests/chrome/test_tmpl_querysettwo.xul
dom/xul/templates/tests/chrome/test_tmpl_querysettwowithcondition.xul
dom/xul/templates/tests/chrome/test_tmpl_querysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerules.xul
dom/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerulesfirstconditionall.xul
dom/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerulestwoconditions.xul
dom/xul/templates/tests/chrome/test_tmpl_querytripleandmembermerge.xul
dom/xul/templates/tests/chrome/test_tmpl_querytripleobjecttosubject.xul
dom/xul/templates/tests/chrome/test_tmpl_querytwomembers.xul
dom/xul/templates/tests/chrome/test_tmpl_querytwomembersfiltered.xul
dom/xul/templates/tests/chrome/test_tmpl_querytwotriples.xul
dom/xul/templates/tests/chrome/test_tmpl_queryupwardsmember.xul
dom/xul/templates/tests/chrome/test_tmpl_queryupwardsmembertripleandfilteringtriple.xul
dom/xul/templates/tests/chrome/test_tmpl_querywithemptyconditions.xul
dom/xul/templates/tests/chrome/test_tmpl_referenceasmember.xul
dom/xul/templates/tests/chrome/test_tmpl_regenerate.xul
dom/xul/templates/tests/chrome/test_tmpl_selfgenerationextendedsyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_selfgenerationsimplesyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxenclosedinacontainer.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxenclosedinacontainerwitharule.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilter.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilterwithmultiplerules.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilterwithrule.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxiteratingoverasinglevalue.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusinganinterveningcontainer.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingatextnode.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingcontainerasthegenerationelement.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingdontrecurse.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingrecursivegeneration.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingrecursivegenerationagain.xul
dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxwithtwovariablesused.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutioncaretsatbeginningandend.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutioncaretsubstitution.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionnovariable.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionquestionmarkaspartofvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionquestionmarksubstitution.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutiontextandvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionvariableandtextconcatenated.xul
dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionvariablesconcatenated.xul
dom/xul/templates/tests/chrome/test_tmpl_sortascendinginteger.xul
dom/xul/templates/tests/chrome/test_tmpl_sortascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortascendingtworulesquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortascendingtworuleswithcontainerquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortascendingtworuleswithdifferentcontainerquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortdescendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortquerymemberandtwotriples.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresource2descendingsimplesyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresource2settopredicateascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresource2settopredicatedescendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresourceascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresourcedescendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresourcesettopredicateascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortresourcesettopredicatedescendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sorttworesourcesasstringsettopredicatedescendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sorttworesourcessettopredicateascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sorttwovariablesascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sorttwovariablesascendingsimplesyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sorttwovariablesdescendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_sortunknownascendingquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_2.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_3.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_baddatasource.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_badquery.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_dynamicparameters.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_listbox.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_rule.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_simple.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_sortintegerasc.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_sortintegerdesc.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_sortstringasc.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_sortstringdesc.xul
dom/xul/templates/tests/chrome/test_tmpl_storage_tree.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntax.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxnotrecursive.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxnotrecursivetreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursive.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivemultiplerules.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivemultiplerulestreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivetreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxtreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxnotrecursive.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxnotrecursivetreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxrecursive.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxrecursivetreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecell.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecellsortascending.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecellsortascendingtreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecelltreebuilder.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementtreeitemonly.xul
dom/xul/templates/tests/chrome/test_tmpl_treeelementtreeitemsortascending.xul
dom/xul/templates/tests/chrome/test_tmpl_twogenerationnodes.xul
dom/xul/templates/tests/chrome/test_tmpl_whereafterignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereafterlowercase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereafternegation.xul
dom/xul/templates/tests/chrome/test_tmpl_whereafteruppercase.xul
dom/xul/templates/tests/chrome/test_tmpl_wherebeforeignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_wherebeforelowercase.xul
dom/xul/templates/tests/chrome/test_tmpl_wherebeforenegation.xul
dom/xul/templates/tests/chrome/test_tmpl_wherebeforeuppercase.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontains.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontainsignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontainsnegation.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontainsnumber.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontainsnumberstring.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontainsresource.xul
dom/xul/templates/tests/chrome/test_tmpl_wherecontainstwo.xul
dom/xul/templates/tests/chrome/test_tmpl_whereendswith.xul
dom/xul/templates/tests/chrome/test_tmpl_whereendswithignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereendswithnegation.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequals.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsmultiple.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsmultiplenegation.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsmultiplenegationignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsnegation.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsnegationignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsnegationwrongcase.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsnumber.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsothervariable.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalsresource.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalssamevariable.xul
dom/xul/templates/tests/chrome/test_tmpl_whereequalswrongcase.xul
dom/xul/templates/tests/chrome/test_tmpl_wheregreater.xul
dom/xul/templates/tests/chrome/test_tmpl_wheregreaternegation.xul
dom/xul/templates/tests/chrome/test_tmpl_wheregreaternegationstring.xul
dom/xul/templates/tests/chrome/test_tmpl_wheregreaterstring.xul
dom/xul/templates/tests/chrome/test_tmpl_whereless.xul
dom/xul/templates/tests/chrome/test_tmpl_wherelessnegation.xul
dom/xul/templates/tests/chrome/test_tmpl_wherelessnegationstring.xul
dom/xul/templates/tests/chrome/test_tmpl_wherelessstring.xul
dom/xul/templates/tests/chrome/test_tmpl_wherenorel.xul
dom/xul/templates/tests/chrome/test_tmpl_wherenosubject.xul
dom/xul/templates/tests/chrome/test_tmpl_wherenovalue.xul
dom/xul/templates/tests/chrome/test_tmpl_wherestartswith.xul
dom/xul/templates/tests/chrome/test_tmpl_wherestartswithignorecase.xul
dom/xul/templates/tests/chrome/test_tmpl_wherestartswithmultiple.xul
dom/xul/templates/tests/chrome/test_tmpl_wherestartswithnegation.xul
dom/xul/templates/tests/chrome/test_tmpl_wherestartswithunknownvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_wherestartswithvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_wheresubjectequalsvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_wheresubjectstartswithvariable.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerysimple.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithassign.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithassignmentandcondition.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithassignmentandconditiondontrecurse.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginbindings.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginrule.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithdifferentmember.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithinlinedata.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithinlinedatawithmultiplequeries.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithmultiplequeries.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithothertypes.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithsort.xul
dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithsortotherfield.xul
dom/xul/test/test_bug236853.xul
layout/base/tests/chrome/test_bug495648.xul
toolkit/content/tests/chrome/test_sorttemplate.xul
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -675,19 +675,18 @@ NotificationController::WillRefresh(mozi
   for (auto iter = mTextHash.Iter(); !iter.Done(); iter.Next()) {
     nsCOMPtrHashKey<nsIContent>* entry = iter.Get();
     nsIContent* textNode = entry->GetKey();
     Accessible* textAcc = mDocument->GetAccessible(textNode);
 
     // If the text node is not in tree or doesn't have a frame, or placed in
     // another document, then this case should have been handled already by
     // content removal notifications.
-    nsINode* containerNode = textNode->GetParentNode();
-    if (!containerNode ||
-        textNode->GetOwnerDocument() != mDocument->DocumentNode()) {
+    nsINode* containerNode = textNode->GetFlattenedTreeParentNode();
+    if (!containerNode || textNode->OwnerDoc() != mDocument->DocumentNode()) {
       MOZ_ASSERT(!textAcc,
                  "Text node was removed but accessible is kept alive!");
       continue;
     }
 
     nsIFrame* textFrame = textNode->GetPrimaryFrame();
     if (!textFrame) {
       MOZ_ASSERT(!textAcc,
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1246,36 +1246,24 @@ DocAccessible::GetAccessibleByUniqueIDIn
 }
 
 Accessible*
 DocAccessible::GetAccessibleOrContainer(nsINode* aNode) const
 {
   if (!aNode || !aNode->GetComposedDoc())
     return nullptr;
 
-  nsINode* currNode = aNode;
-  Accessible* accessible = nullptr;
-  while (!(accessible = GetAccessible(currNode))) {
-    nsINode* parent = nullptr;
-
-    // If this is a content node, try to get a flattened parent content node.
-    // This will smartly skip from the shadow root to the host element,
-    // over parentless document fragment
-    if (currNode->IsContent())
-      parent = currNode->AsContent()->GetFlattenedTreeParent();
-
-    // Fallback to just get parent node, in case there is no parent content
-    // node. Or current node is not a content node.
-    if (!parent)
-      parent = currNode->GetParentNode();
-
-    if (!(currNode = parent)) break;
+  for (nsINode* currNode = aNode; currNode;
+       currNode = currNode->GetFlattenedTreeParentNode()) {
+    if (Accessible* accessible = GetAccessible(currNode)) {
+      return accessible;
+    }
   }
 
-  return accessible;
+  return nullptr;
 }
 
 Accessible*
 DocAccessible::GetAccessibleOrDescendant(nsINode* aNode) const
 {
   Accessible* acc = GetAccessible(aNode);
   if (acc)
     return acc;
@@ -2211,17 +2199,18 @@ DocAccessible::PutChildrenBack(nsTArray<
                       "old parent", owner, "child", child, nullptr);
 #endif
 
     // Unset relocated flag to find an insertion point for the child.
     child->SetRelocated(false);
 
     nsIContent* content = child->GetContent();
     int32_t idxInParent = -1;
-    Accessible* origContainer = AccessibleOrTrueContainer(content->GetParentNode());
+    Accessible* origContainer =
+      AccessibleOrTrueContainer(content->GetFlattenedTreeParentNode());
     if (origContainer) {
       TreeWalker walker(origContainer);
       if (walker.Seek(content)) {
         Accessible* prevChild = walker.Prev();
         if (prevChild) {
           idxInParent = prevChild->IndexInParent() + 1;
           MOZ_DIAGNOSTIC_ASSERT(origContainer == prevChild->Parent(), "Broken tree");
           origContainer = prevChild->Parent();
--- a/browser/base/content/pageinfo/pageInfo.xul
+++ b/browser/base/content/pageinfo/pageInfo.xul
@@ -163,33 +163,33 @@
       </hbox>
     </vbox>
 
     <!-- Media information -->
     <vbox id="mediaPanel">
       <tree id="imagetree" onselect="onImageSelect();" contextmenu="picontext"
             ondragstart="onBeginLinkDrag(event,'image-address','image-alt')">
         <treecols>
-          <treecol sortSeparators="true" primary="true" persist="width" flex="10"
+          <treecol primary="true" persist="width" flex="10"
                         width="10" id="image-address" label="&mediaAddress;"
                         onclick="gImageView.onPageMediaSort('image-address');"/>
           <splitter class="tree-splitter"/>
-          <treecol sortSeparators="true" persist="hidden width" flex="2"
+          <treecol persist="hidden width" flex="2"
                         width="2"  id="image-type"    label="&mediaType;"
                         onclick="gImageView.onPageMediaSort('image-type');"/>
           <splitter class="tree-splitter"/>
-          <treecol sortSeparators="true" hidden="true" persist="hidden width" flex="2"
+          <treecol hidden="true" persist="hidden width" flex="2"
                         width="2"  id="image-size"  label="&mediaSize;" value="size"
                         onclick="gImageView.onPageMediaSort('image-size');"/>
           <splitter class="tree-splitter"/>
-          <treecol sortSeparators="true" hidden="true" persist="hidden width" flex="4"
+          <treecol hidden="true" persist="hidden width" flex="4"
                         width="4"  id="image-alt"    label="&mediaAltHeader;"
                         onclick="gImageView.onPageMediaSort('image-alt');"/>
           <splitter class="tree-splitter"/>
-          <treecol sortSeparators="true" hidden="true" persist="hidden width" flex="1"
+          <treecol hidden="true" persist="hidden width" flex="1"
                         width="1"  id="image-count"    label="&mediaCount;"
                         onclick="gImageView.onPageMediaSort('image-count');"/>
         </treecols>
         <treechildren id="imagetreechildren" flex="1"/>
       </tree>
       <splitter orient="vertical" id="mediaSplitter"/>
       <vbox flex="1" id="mediaPreviewBox" collapsed="true">
         <grid id="mediaGrid">
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -168,23 +168,17 @@ var whitelist = [
 
 whitelist = new Set(whitelist.filter(item =>
   ("isFromDevTools" in item) == isDevtools &&
   (!item.skipNightly || !AppConstants.NIGHTLY_BUILD) &&
   (!item.platforms || item.platforms.includes(AppConstants.platform))
 ).map(item => item.file));
 
 const ignorableWhitelist = new Set([
-  // chrome://xslt-qa/ isn't referenced, but isn't included in packaged builds,
-  // so it's fine to just ignore it and ignore if the exceptions are unused.
-  "chrome://xslt-qa/content/buster/result-view.xul",
-  "chrome://xslt-qa/content/xslt-qa-overlay.xul",
-  // The communicator.css file is kept for add-on backward compat, but it is
-  // referenced by something in xslt-qa, so the exception won't be used when
-  // running the test on a local non-packaged build.
+  // The communicator.css file is kept for add-on backward compat.
   "chrome://communicator/skin/communicator.css",
 
   // These 2 files are unreferenced only when building without the crash
   // reporter (eg. Linux x64 asan builds on treeherder)
   "chrome://global/locale/crashes.dtd",
   "chrome://global/locale/crashes.properties",
 
   // The following files are outside of the omni.ja file, so we only catch them
--- a/browser/components/preferences/in-content/main.xul
+++ b/browser/components/preferences/in-content/main.xul
@@ -1,17 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <!-- General panel -->
 
-<link rel="localization" href="browser/preferences/main.ftl"/>
-<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
-
 <script type="application/javascript"
         src="chrome://browser/content/preferences/in-content/main.js"/>
 
 #ifdef MOZ_UPDATER
   <script type="application/javascript" src="chrome://browser/content/aboutDialog-appUpdater.js"/>
 #endif
 
 <script type="application/javascript"
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -90,16 +90,20 @@
       xmlns:html="http://www.w3.org/1999/xhtml"
       disablefastfind="true"
 #ifdef USE_WIN_TITLE_STYLE
       title="&prefWindow.titleWin;">
 #else
       title="&prefWindow.title;">
 #endif
 
+  <link rel="localization" href="browser/preferences/main.ftl"/>
+  <link rel="localization" href="browser/preferences/preferences.ftl"/>
+  <script type="text/javascript" src="chrome://global/content/l10n.js"></script>
+
   <html:link rel="shortcut icon"
               href="chrome://browser/skin/settings.svg"/>
 
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/preferences/in-content/preferences.js"/>
   <script src="chrome://browser/content/preferences/in-content/findInPage.js"/>
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -539,22 +539,22 @@
                   label="&changeBlockList2.label;"
                   accesskey="&changeBlockList2.accesskey;"
                   preference="pref.privacy.disable_button.change_blocklist"
                   searchkeywords="&button.cancel.label; &button.ok.label;"/>
         </hbox>
       </vbox>
     </hbox>
     <vbox id="doNotTrackLearnMoreBox">
-      <label><label class="tail-with-learn-more">&doNotTrack.description;</label><label
+      <label><label class="tail-with-learn-more" data-l10n-id="do-not-track-description"></label><label
       class="learnMore text-link" href="https://www.mozilla.org/dnt"
-      >&doNotTrack.learnMore.label;</label></label>
+      data-l10n-id="do-not-track-learn-more"></label></label>
       <radiogroup id="doNotTrackRadioGroup" aria-labelledby="doNotTrackDesc" preference="privacy.donottrackheader.enabled">
-        <radio value="false" label="&doNotTrack.default.label;"/>
-        <radio value="true" label="&doNotTrack.always.label;"/>
+        <radio value="false" data-l10n-id="do-not-track-option-default"/>
+        <radio value="true" data-l10n-id="do-not-track-option-always"/>
       </radiogroup>
     </vbox>
   </vbox>
 </groupbox>
 
 <hbox id="permissionsCategory"
       class="subcategory"
       hidden="true"
--- a/browser/config/mozconfigs/win32/mingw32
+++ b/browser/config/mozconfigs/win32/mingw32
@@ -50,17 +50,17 @@ ac_add_options --disable-maintenance-ser
 CC="$TOOLTOOL_DIR/mingw32/bin/i686-w64-mingw32-gcc"
 CXX="$TOOLTOOL_DIR/mingw32/bin/i686-w64-mingw32-g++"
 
 HOST_CC="$TOOLTOOL_DIR/gcc/bin/gcc"
 HOST_CXX="$TOOLTOOL_DIR/gcc/bin/g++"
 
 # We want to make sure we use binutils and other binaries in the tooltool
 # package.
-mk_add_options PATH="$TOOLTOOL_DIR/gcc/bin:$TOOLTOOL_DIR/mingw32/bin:$TOOLTOOL_DIR/wine/bin:$TOOLTOOL_DIR/upx/bin:$TOOLTOOL_DIR/fxc2/bin:$PATH"
+mk_add_options "export PATH=$TOOLTOOL_DIR/gcc/bin:$TOOLTOOL_DIR/mingw32/bin:$TOOLTOOL_DIR/wine/bin:$TOOLTOOL_DIR/upx/bin:$TOOLTOOL_DIR/fxc2/bin:$PATH"
 
 LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/mingw32/lib64
 mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
 
 # Do not include the visual studio related mozconfigs of course
 
 ac_add_options --with-branding=browser/branding/nightly
 
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -335,17 +335,16 @@
 @RESPATH@/components/xpcom_components.xpt
 @RESPATH@/components/xpcom_ds.xpt
 @RESPATH@/components/xpcom_io.xpt
 @RESPATH@/components/xpcom_threads.xpt
 @RESPATH@/components/xpcom_xpti.xpt
 @RESPATH@/components/xpconnect.xpt
 @RESPATH@/components/xulapp.xpt
 @RESPATH@/components/xul.xpt
-@RESPATH@/components/xultmpl.xpt
 @RESPATH@/components/zipwriter.xpt
 @RESPATH@/components/telemetry.xpt
 
 ; JavaScript components
 @RESPATH@/components/ConsoleAPI.manifest
 @RESPATH@/components/ConsoleAPIStorage.js
 @RESPATH@/components/BrowserElementParent.manifest
 @RESPATH@/components/BrowserElementParent.js
new file mode 100644
--- /dev/null
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -0,0 +1,10 @@
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+do-not-track-description = Send websites a “Do Not Track” signal that you don’t want to be tracked
+do-not-track-learn-more = Learn more
+do-not-track-option-default
+    .label = Only when using Tracking Protection
+do-not-track-option-always
+    .label = Always
--- a/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -17,21 +17,16 @@
 
 <!-- LOCALIZATION NOTE (trackingProtectionPBM6.label): This string is displayed if privacy.trackingprotection.ui.enabled is set to false. This currently happens on the release and beta channel. -->
 <!ENTITY trackingProtectionPBM6.label         "Use Tracking Protection in Private Browsing to block known trackers">
 <!ENTITY trackingProtectionPBM6.accesskey     "v">
 <!ENTITY trackingProtectionPBMLearnMore.label "Learn more">
 <!ENTITY changeBlockList2.label               "Change Block List…">
 <!ENTITY changeBlockList2.accesskey           "C">
 
-<!ENTITY  doNotTrack.description        "Send websites a “Do Not Track” signal that you don’t want to be tracked">
-<!ENTITY  doNotTrack.learnMore.label    "Learn more">
-<!ENTITY  doNotTrack.default.label      "Only when using Tracking Protection">
-<!ENTITY  doNotTrack.always.label       "Always">
-
 <!ENTITY  history.label                 "History">
 <!ENTITY  permissions.label             "Permissions">
 
 <!ENTITY  addressBar.label              "Address Bar">
 <!ENTITY  addressBar.suggest.label      "When using the address bar, suggest">
 <!ENTITY  locbar.history2.label         "Browsing history">
 <!ENTITY  locbar.history2.accesskey     "H">
 <!ENTITY  locbar.bookmarks.label        "Bookmarks">
@@ -109,9 +104,9 @@
 <!ENTITY  browserContainersEnabled.label        "Enable Container Tabs">
 <!ENTITY  browserContainersEnabled.accesskey    "n">
 <!ENTITY  browserContainersSettings.label        "Settings…">
 <!ENTITY  browserContainersSettings.accesskey    "i">
 
 <!ENTITY  a11yPrivacy.checkbox.label     "Prevent accessibility services from accessing your browser">
 <!ENTITY  a11yPrivacy.checkbox.accesskey "a">
 <!ENTITY  a11yPrivacy.learnmore.label    "Learn more">
-<!ENTITY enableSafeBrowsingLearnMore.label "Learn more">
\ No newline at end of file
+<!ENTITY enableSafeBrowsingLearnMore.label "Learn more">
--- a/build/unix/mozconfig.linux
+++ b/build/unix/mozconfig.linux
@@ -13,17 +13,17 @@ TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
 # all yet.
 if [ -z "$no_tooltool" ]
 then
   CC="$TOOLTOOL_DIR/gcc/bin/gcc"
   CXX="$TOOLTOOL_DIR/gcc/bin/g++"
 
   # We want to make sure we use binutils and other binaries in the tooltool
   # package.
-  mk_add_options PATH="$TOOLTOOL_DIR/gcc/bin:$PATH"
+  mk_add_options "export PATH=$TOOLTOOL_DIR/gcc/bin:$PATH"
 else
   CC="/tools/gcc-4.7.3-0moz1/bin/gcc"
   CXX="/tools/gcc-4.7.3-0moz1/bin/g++"
 fi
 
 . "$topsrcdir/build/unix/mozconfig.stdcxx"
 
 # PKG_CONFIG_LIBDIR is appropriately overridden in mozconfig.linux32
--- a/build/virtualenv_packages.txt
+++ b/build/virtualenv_packages.txt
@@ -1,14 +1,15 @@
 mozilla.pth:python/mach
 mozilla.pth:python/mozboot
 mozilla.pth:python/mozbuild
 mozilla.pth:python/mozlint
 mozilla.pth:python/mozterm
 mozilla.pth:python/mozversioncontrol
+mozilla.pth:python/l10n
 mozilla.pth:third_party/python/blessings
 mozilla.pth:third_party/python/compare-locales
 mozilla.pth:third_party/python/configobj
 mozilla.pth:third_party/python/cram
 mozilla.pth:third_party/python/dlmanager
 mozilla.pth:third_party/python/fluent
 mozilla.pth:third_party/python/futures
 mozilla.pth:third_party/python/hglib
--- a/config/baseconfig.mk
+++ b/config/baseconfig.mk
@@ -1,13 +1,13 @@
 # This file is normally included by autoconf.mk, but it is also used
 # directly in python/mozbuild/mozbuild/base.py for gmake validation.
 # We thus use INCLUDED_AUTOCONF_MK to enable/disable some parts depending
 # whether a normal build is happening or whether the check is running.
-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+installdir = $(libdir)/$(MOZ_APP_NAME)
 ifeq (.,$(DEPTH))
 DIST = dist
 else
 DIST = $(DEPTH)/dist
 endif
 ABS_DIST = $(topobjdir)/dist
 
 # We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
--- a/devtools/client/jsonview/test/browser.ini
+++ b/devtools/client/jsonview/test/browser.ini
@@ -49,9 +49,10 @@ skip-if = (os == 'linux' && bits == 32 &
 [browser_jsonview_object-type.js]
 [browser_jsonview_row_selection.js]
 [browser_jsonview_save_json.js]
 support-files =
   !/toolkit/content/tests/browser/common/mockTransfer.js
 [browser_jsonview_serviceworker.js]
 [browser_jsonview_slash.js]
 [browser_jsonview_theme.js]
+[browser_jsonview_url_linkification.js]
 [browser_jsonview_valid_json.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/jsonview/test/browser_jsonview_url_linkification.js
@@ -0,0 +1,51 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const {ELLIPSIS} = require("devtools/shared/l10n");
+
+add_task(async function () {
+  info("Test short URL linkification JSON started");
+
+  let url = "http://example.com/";
+  let tab = await addJsonViewTab("data:application/json," + JSON.stringify([url]));
+
+  // eslint-disable-next-line no-shadow
+  await ContentTask.spawn(tab.linkedBrowser, {url}, function ({url}) {
+    let {document} = content;
+
+    let link = document.querySelector(".jsonPanelBox .treeTable .treeValueCell a");
+    is(link.href, url, "The URL was linkified.");
+    is(link.textContent, url, "The full URL is displayed.");
+
+    // Click the label
+    document.querySelector(".jsonPanelBox .treeTable .treeLabel").click();
+    is(link.href, url, "The link target didn't change.");
+    is(link.textContent, url, "The link text didn't change.");
+  });
+});
+
+add_task(async function () {
+  info("Test long URL linkification JSON started");
+
+  let url = "http://example.com/" + "a".repeat(100);
+  let tab = await addJsonViewTab("data:application/json," + JSON.stringify([url]));
+
+  // eslint-disable-next-line no-shadow
+  await ContentTask.spawn(tab.linkedBrowser, {url, ELLIPSIS}, function ({url, ELLIPSIS}) {
+    let croppedUrl = url.slice(0, 24) + ELLIPSIS + url.slice(-24);
+    let {document} = content;
+
+    let link = document.querySelector(".jsonPanelBox .treeTable .treeValueCell a");
+    is(link.href, url, "The URL was linkified.");
+    is(link.textContent, url, "The full URL is displayed.");
+
+    // Click the label, this crops the value.
+    document.querySelector(".jsonPanelBox .treeTable .treeLabel").click();
+    is(link.href, url, "The link target didn't change.");
+    is(link.textContent, croppedUrl, "The link text was cropped.");
+  });
+});
--- a/devtools/client/shared/node-attribute-parser.js
+++ b/devtools/client/shared/node-attribute-parser.js
@@ -107,18 +107,16 @@ const ATTRIBUTE_TYPES = [
   {namespaceURI: XUL_NS, attributeName: "datasources", tagName: "*", type: TYPE_URI_LIST},
   {namespaceURI: XUL_NS, attributeName: "insertafter", tagName: "*", type: TYPE_IDREF},
   {namespaceURI: XUL_NS, attributeName: "insertbefore", tagName: "*", type: TYPE_IDREF},
   {namespaceURI: XUL_NS, attributeName: "menu", tagName: "*", type: TYPE_IDREF},
   {namespaceURI: XUL_NS, attributeName: "observes", tagName: "*", type: TYPE_IDREF},
   {namespaceURI: XUL_NS, attributeName: "popup", tagName: "*", type: TYPE_IDREF},
   {namespaceURI: XUL_NS, attributeName: "ref", tagName: "*", type: TYPE_URI},
   {namespaceURI: XUL_NS, attributeName: "removeelement", tagName: "*", type: TYPE_IDREF},
-  {namespaceURI: XUL_NS, attributeName: "sortResource", tagName: "*", type: TYPE_URI},
-  {namespaceURI: XUL_NS, attributeName: "sortResource2", tagName: "*", type: TYPE_URI},
   {namespaceURI: XUL_NS, attributeName: "src", tagName: "stringbundle", type: TYPE_URI},
   {namespaceURI: XUL_NS, attributeName: "template", tagName: "*", type: TYPE_IDREF},
   {namespaceURI: XUL_NS, attributeName: "tooltip", tagName: "*", type: TYPE_IDREF},
   /* eslint-enable */
   // SVG links aren't handled yet, see bug 1158831.
   // {namespaceURI: SVG_NS, attributeName: "fill", tagName: "*", type: },
   // {namespaceURI: SVG_NS, attributeName: "stroke", tagName: "*", type: },
   // {namespaceURI: SVG_NS, attributeName: "markerstart", tagName: "*", type: },
--- a/dom/animation/test/mozilla/file_restyles.html
+++ b/dom/animation/test/mozilla/file_restyles.html
@@ -96,17 +96,17 @@ function waitForWheelEvent(aTarget) {
 // refresh rate) then we won't end up restyling in that frame.
 function startsRightNow(aAnimation) {
   return aAnimation.startTime === aAnimation.timeline.currentTime &&
          aAnimation.currentTime === 0;
 }
 
 function tweakExpectedRestyleCount(aAnimation, aExpectedRestyleCount) {
   // Normally we expect one restyling for each requestAnimationFrame (as
-  // called by observeRestyling) PLUS one for the last frame becasue of bug
+  // called by observeRestyling) PLUS one for the last frame because of bug
   // 1193394.  However, we won't observe that initial restyling unless BOTH of
   // the following two conditions hold:
   //
   // 1. We are running *before* restyling happens.
   // 2. The animation actually needs a restyle because it started prior to
   //    this frame.  Even if (1) is true, in some cases due to aligning with
   //    the refresh driver, the animation fame in which the ready promise is
   //    resolved happens to coincide perfectly with the start time of the
@@ -936,16 +936,21 @@ waitForAllPaints(() => {
     var div = addDiv(null);
     var animation = div.animate({ marginLeft: [ '0px', '100px' ] },
                                 100 * MS_PER_SEC);
 
     await animation.ready;
 
     div.remove();
 
+    // It's possible that the animation begins at this moment.  If this is the
+    // case, an additional superfluous restyle request that we will check later
+    // can't be observed.
+    const expectedRestyleCount = tweakExpectedRestyleCount(animation, 1);
+
     var markers = await observeStyling(5);
     is(markers.length, 0,
        'Animation on orphaned element should not cause restyles');
 
     document.body.appendChild(div);
 
     markers = await observeStyling(1);
     if (isServo) {
@@ -956,20 +961,20 @@ waitForAllPaints(() => {
       // result, the animation is restyled during a second animation restyle in
       // the first frame. If we fix the behavior when we attach an orphaned
       // element with script animations to a document so that it requests a
       // layer restyle (bug 1388557) before fixing important_rules_change in
       // compute_style() so that it no longer dispatches a needless standard
       // restyle (bug 1388560), we should add a test case that fails if we
       // continue to unnecessarily request a standard restyle.
       //
-      // Bug 1417354: There will be an additional superfluos restyle request
-      // whichi results when we detach an element from the document between
+      // Bug 1417354: There will be an additional superfluous restyle request
+      // which results when we detach an element from the document between
       // the Animation tick and styling, and then re-attach it.
-      is(markers.length, 2,
+      is(markers.length, expectedRestyleCount,
          'We should observe one restyle in the first frame right after ' +
          're-attaching to the document');
     } else {
       // Bug 1388557: We should call RequestRestyle(Layer) when an element which
       // has running script animations is attached to a document.
       todo_is(markers.length, 1,
               'Bug 1388557 We should observe one restyle in the first frame ' +
               'right after re-attaching to the document');
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -1172,17 +1172,16 @@ GK_ATOM(replace, "replace")
 GK_ATOM(requestcontextid, "requestcontextid")
 GK_ATOM(required, "required")
 GK_ATOM(reserved, "reserved")
 GK_ATOM(reset, "reset")
 GK_ATOM(resizeafter, "resizeafter")
 GK_ATOM(resizebefore, "resizebefore")
 GK_ATOM(resizer, "resizer")
 GK_ATOM(resolution, "resolution")
-GK_ATOM(resource, "resource")
 GK_ATOM(resources, "resources")
 GK_ATOM(result, "result")
 GK_ATOM(resultPrefix, "result-prefix")
 GK_ATOM(retargetdocumentfocus, "retargetdocumentfocus")
 GK_ATOM(rev, "rev")
 GK_ATOM(reverse, "reverse")
 GK_ATOM(reversed, "reversed")
 GK_ATOM(richlistbox, "richlistbox")
@@ -1259,20 +1258,16 @@ GK_ATOM(small, "small")
 GK_ATOM(smooth, "smooth")
 GK_ATOM(snap, "snap")
 GK_ATOM(sort, "sort")
 GK_ATOM(sortActive, "sortActive")
 GK_ATOM(sortDirection, "sortDirection")
 GK_ATOM(sorted, "sorted")
 GK_ATOM(sorthints, "sorthints")
 GK_ATOM(sortLocked, "sortLocked")
-GK_ATOM(sortResource, "sortResource")
-GK_ATOM(sortResource2, "sortResource2")
-GK_ATOM(sortSeparators, "sortSeparators")
-GK_ATOM(sortStaticsLast, "sortStaticsLast")
 GK_ATOM(source, "source")
 GK_ATOM(space, "space")
 GK_ATOM(spacer, "spacer")
 GK_ATOM(span, "span")
 GK_ATOM(spellcheck, "spellcheck")
 GK_ATOM(spinner, "spinner")
 GK_ATOM(split, "split")
 GK_ATOM(splitter, "splitter")
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -1270,22 +1270,16 @@ var interfaceNamesInGlobalScope =
     {name: "XULControlElement", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULDocument", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULElement", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "XULLabeledControlElement", xbl: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "XULTemplateBuilder", xbl: true},
-// IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "XULTreeBuilder", xbl: true},
-// IMPORTANT: Do not change this list without review from a DOM peer!
-    {name: "XULTreeBuilderObserver", xbl: true},
-// IMPORTANT: Do not change this list without review from a DOM peer!
   ];
 // IMPORTANT: Do not change the list above without review from a DOM peer!
 
 function createInterfaceMap(isXBLScope) {
   var version = SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(SpecialPowers.Ci.nsIXULAppInfo).version;
   var isNightly = version.endsWith("a1");
   var isRelease = !version.includes("a");
   var isDesktop = !/Mobile|Tablet/.test(navigator.userAgent);
--- a/dom/webidl/LegacyQueryInterface.webidl
+++ b/dom/webidl/LegacyQueryInterface.webidl
@@ -87,9 +87,8 @@ TreeContentView implements LegacyQueryIn
 TreeWalker implements LegacyQueryInterface;
 ValidityState implements LegacyQueryInterface;
 WebSocket implements LegacyQueryInterface;
 Window implements LegacyQueryInterface;
 XMLHttpRequest implements LegacyQueryInterface;
 XMLHttpRequestUpload implements LegacyQueryInterface;
 XMLSerializer implements LegacyQueryInterface;
 XPathEvaluator implements LegacyQueryInterface;
-XULTemplateBuilder implements LegacyQueryInterface;
--- a/dom/webidl/XULElement.webidl
+++ b/dom/webidl/XULElement.webidl
@@ -1,17 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 interface XULControllers;
-interface MozRDFCompositeDataSource;
-interface MozRDFResource;
 
 [HTMLConstructor, Func="IsChromeOrXBL"]
 interface XULElement : Element {
   // Layout properties
   [SetterThrows]
   attribute DOMString align;
   [SetterThrows]
   attribute DOMString dir;
@@ -63,38 +61,28 @@ interface XULElement : Element {
   // Position properties for
   // * popups - these are screen coordinates
   // * other elements - these are client coordinates relative to parent stack.
   [SetterThrows]
   attribute DOMString left;
   [SetterThrows]
   attribute DOMString top;
 
-  // XUL Template Builder
-  [SetterThrows]
-  attribute DOMString datasources;
-  [SetterThrows]
-  attribute DOMString ref;
-
   // Tooltip and status info
   [SetterThrows]
   attribute DOMString tooltipText;
   [SetterThrows]
   attribute DOMString statusText;
 
   // Properties for images
   [SetterThrows]
   attribute DOMString src;
 
   attribute boolean allowEvents;
 
-  readonly attribute MozRDFCompositeDataSource? database;
-  readonly attribute XULTemplateBuilder?        builder;
-  [Throws]
-  readonly attribute MozRDFResource?            resource;
   [Throws, ChromeOnly]
   readonly attribute XULControllers             controllers;
   [Throws]
   readonly attribute BoxObject?                 boxObject;
 
   [Throws]
   void                      focus();
   [Throws]
deleted file mode 100644
--- a/dom/webidl/XULTemplateBuilder.webidl
+++ /dev/null
@@ -1,398 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-interface MozRDFCompositeDataSource;
-interface MozRDFResource;
-interface nsISupports;
-interface XULTemplateResult;
-interface XULTemplateRuleFilter;
-
-callback interface XULBuilderListener
-{
-    void willRebuild(XULTemplateBuilder aBuilder);
-    void didRebuild(XULTemplateBuilder aBuilder);
-};
-
-/**
- * A template builder, given an input source of data, a template, and a
- * reference point, generates a list of results from the input, and copies
- * part of the template for each result. Templates may generate content
- * recursively, using the same template, but with the previous iteration's
- * results as the reference point. As an example, for an XML datasource the
- * initial reference point would be a specific node in the DOM tree and a
- * template might generate a list of all child nodes. For the next iteration,
- * those children would be used to generate output for their child nodes and
- * so forth.
- *
- * A template builder is attached to a single DOM node; this node is called
- * the root node and is expected to contain a XUL template element as a direct
- * child. Different template builders may be specialized in the manner in
- * which they generate and display the resulting content from the template.
- *
- * The structure of a template is as follows:
- *
- * <rootnode datasources="" ref="">
- *   <template>
- *     <queryset>
- *       <query>
- *       </query>
- *       <rule>
- *         <conditions>...</conditions>
- *         <bindings>...</bindings>
- *         <action>...</action>
- *       </rule>
- *     </queryset>
- *   </template>
- * </rootnode>
- *
- * The datasources attribute on the root node is used to identify the source
- * of data to be used. The ref attribute is used to specify the reference
- * point for the query. Currently, the datasource will either be an
- * nsIRDFDataSource or a DOM node. In the future, other datasource types may
- * be used.
- *
- * The <queryset> element contains a single query and one or more <rule>
- * elements. There may be more than one <queryset> if multiple queries are
- * desired, and this element is optional if only one query is needed -- in
- * that case the <query> and <rule>s are allowed to be children of the
- * <template> node
- *
- * The contents of the query are processed by a separate component called a
- * query processor. This query processor is expected to use this query to
- * generate results when asked by the template builder. The template builder
- * then generates output for each result based on the <rule> elements.
- *
- * This allows the query processor to be specific to a particular kind of
- * input data or query syntax, while the template builder remains independent
- * of the kind of data being used. Due to this, the query processor will be
- * supplied with the datasource and query which the template builder handles
- * in an opaque way, while the query processor handles these more
- * specifically.
- *
- * Results implement the nsIXULTemplateResult interface and may be identified
- * by an id which must be unique within a given set of query results.
- *
- * Each query may be accompanied by one or more <rule> elements. These rules
- * are evaluated by the template builder for each result produced by the
- * query. A rule consists of conditions that cause a rule to be either
- * accepted or rejected. The condition syntax allows for common conditional
- * handling; additional filtering may be applied by adding a custom filter
- * to a rule with the builder's addRuleFilter method.
- *
- * If a result passes a rule's conditions, this is considered a match, and the
- * content within the rule's <action> body is inserted as a sibling of the
- * <template>, assuming the template builder creates real DOM content. Only
- * one rule will match a result. For a tree builder, for example, the content
- * within the action body is used to create the tree rows instead. A matching
- * result must have its ruleMatched method called. When a result no longer
- * matches, the result's hasBeenRemoved method must be called.
- *
- * Optionally, the rule may have a <bindings> section which may be used to
- * define additional variables to be used within an action body. Each of these
- * declared bindings must be supplied to the query processor via its
- * addBinding method. The bindings are evaluated after a rule has matched.
- *
- * Templates may generate content recursively, using the previous iteration's
- * results as reference point to invoke the same queries. Since the reference
- * point is different, different output will typically be generated.
- *
- * The reference point nsIXULTemplateResult object for the first iteration is
- * determined by calling the query processor's translateRef method using the
- * value of the root node's ref attribute. This object may be retrieved later
- * via the builder's rootResult property.
- *
- * For convenience, each reference point as well as all results implement the
- * nsIXULTemplateResult interface, allowing the result objects from each
- * iteration to be used directly as the reference points for the next
- * iteration.
- *
- * When using multiple queries, each may generate results with the same id.
- * More than one of these results may match one of the rules in their
- * respective queries, however only the result for the earliest matching query
- * in the template becomes the active match and generates output. The
- * addResult, removeResult, replaceResult and resultBindingChanged methods may
- * be called by the query processor to indicate that the set of valid results
- * has changed, such that a different query may match. If a different match
- * would become active, the content for the existing match is removed and the
- * content for the new match is generated. A query processor is not required
- * to provide any support for updating results after they have been generated.
- *
- * See http://wiki.mozilla.org/XUL:Templates_Plan for details about templates.
- */
-[Func="IsChromeOrXBL"]
-interface XULTemplateBuilder
-{
-    /**
-     * The root node in the DOM to which this builder is attached.
-     */
-    readonly attribute Element? root;
-
-    /**
-     * The opaque datasource object that is used for the template. This object
-     * is created by the getDataSource method of the query processor. May be
-     * null if the datasource has not been loaded yet. Set this attribute to
-     * use a different datasource and rebuild the template.
-     *
-     * For an RDF datasource, this will be the same as the database. For XML
-     * this will be the nsIDOMNode for the datasource document or node for
-     * an inline reference (such as #name). Other query processors may use
-     * other types for the datasource.
-     */
-    [SetterThrows]
-    attribute nsISupports? datasource;
-
-    /**
-     * The composite datasource that the template builder observes
-     * and uses to create content. This is used only for RDF queries and is
-     * maintained for backwards compatibility. It will be the same object as
-     * the datasource property. For non-RDF queries, it will always be null.
-     */
-    readonly attribute MozRDFCompositeDataSource? database;
-
-    /**
-     * The virtual result representing the starting reference point,
-     * determined by calling the query processor's translateRef method
-     * with the root node's ref attribute as an argument.
-     */
-    readonly attribute XULTemplateResult? rootResult;
-
-    /**
-     * Force the template builder to rebuild its content. All existing content
-     * will be removed first. The query processor's done() method will be
-     * invoked during cleanup, followed by its initializeForBuilding method
-     * when the content is to be regenerated.
-     * 
-     */
-    [Throws]
-    void rebuild();
-
-    /**
-     * Reload any of our RDF datasources that support nsIRDFRemoteDatasource. 
-     *
-     * @note This is a temporary hack so that remote-XUL authors can
-     *       reload remote datasources. When RDF becomes remote-scriptable,
-     *       this will no longer be necessary.
-     */
-    [Throws]
-    void refresh();
-
-    /**
-     * Inform the template builder that a new result is available. The builder
-     * will add this result to the set of results. The query node that the
-     * new result applies to must be specified using the aQueryNode parameter.
-     *
-     * The builder will apply the rules associated with the query to the new
-     * result, unless a result with the same id from an earlier query
-     * supersedes it, and the result's RuleMatched method will be called if it
-     * matches.
-     *
-     * @param aResult the result to add
-     * @param aQueryNode the query that the result applies to
-     */
-    [Throws]
-    void addResult(XULTemplateResult aResult, Node aQueryNode);
-
-    /**
-     * Inform the template builder that a result no longer applies. The builder
-     * will call the remove content generated for the result, if any. If a
-     * different query would then match instead, it will become the active
-     * match. This method will have no effect if the result isn't known to the
-     * builder.
-     *
-     * @param aResult the result to remove
-     *
-     * @throws NS_ERROR_NULL_POINTER if aResult is null
-     */
-    [Throws]
-    void removeResult(XULTemplateResult aResult);
-
-    /**
-     * Inform the template builder that one result should be replaced with
-     * another. Both the old result (aOldResult) and the new result
-     * (aNewResult) must have the same id. The query node that the new result
-     * applies to must be specified using the aQueryNode parameter.
-     *
-     * This method is expected to have the same effect as calling both
-     * removeResult for the old result and addResult for the new result.
-     *
-     * @param aOldResult the old result
-     * @param aNewResult the new result
-     * @param aQueryNode the query that the new result applies to
-     *
-     * @throws NS_ERROR_NULL_POINTER if either argument is null, or
-     *         NS_ERROR_INVALID_ARG if the ids don't match
-     */
-    [Throws]
-    void replaceResult(XULTemplateResult aOldResult,
-                       XULTemplateResult aNewResult,
-                       Node aQueryNode);
-
-    /**
-     * Inform the template builder that one or more of the optional bindings
-     * for a result has changed. In this case, the rules are not reapplied as
-     * it is expected that the same rule will still apply. The builder will
-     * resynchronize any variables that are referenced in the action body.
-     *
-     * @param aResult the result to change
-     *
-     * @throws NS_ERROR_NULL_POINTER if aResult is null
-     */
-    [Throws]
-    void resultBindingChanged(XULTemplateResult aResult);
-
-    /**
-     * Return the result for a given id. Only one such result is returned and
-     * is always the result with that id associated with the active match.
-     * This method will return null is there is no result for the id.
-     *
-     * @param aId the id to return the result for
-     */
-    [Throws]
-    XULTemplateResult? getResultForId(DOMString aId);
-
-    /**
-     * Retrieve the result corresponding to a generated element, or null is
-     * there isn't one.
-     *
-     * @param aContent element to result the result of
-     */
-    XULTemplateResult? getResultForContent(Element aElement);
-
-    /**
-     * Returns true if the node has content generated for it. This method is
-     * intended to be called only by the RDF query processor. If aTag is set,
-     * the content must have a tag name that matches aTag. aTag may be ignored
-     * for builders that don't generate real DOM content.
-     *
-     * @param aNode node to check
-     * @param aTag tag that must match
-     */
-    [Throws]
-    boolean hasGeneratedContent(MozRDFResource aNode, DOMString? aTag);
-
-    /**
-     * Adds a rule filter for a given rule, which may be used for specialized
-     * rule filtering. Any existing filter on the rule is removed. The default
-     * conditions specified inside the <rule> tag are applied before the
-     * rule filter is applied, meaning that the filter may be used to further
-     * filter out results but not reaccept results that have already been
-     * rejected.
-     *
-     * @param aRule the rule to apply the filter to
-     * @param aFilter the filter to add
-     */
-    [Throws]
-    void addRuleFilter(Node aRule, XULTemplateRuleFilter aFilter);
-
-    /**
-     * Add a listener to this template builder. The template builder
-     * holds a strong reference to the listener.
-     */
-    void addListener(XULBuilderListener aListener);
-
-    /**
-     * Remove a listener from this template builder.
-     */
-    void removeListener(XULBuilderListener aListener);
-};
-
-/**
- *  XULTreeBuilderObserver
- *  This interface allows clients of the XULTreeBuilder to define domain 
- *  specific handling of specific nsITreeView methods that 
- *  XULTreeBuilder does not implement.
- */
-[Func="IsChromeOrXBL"]
-callback interface XULTreeBuilderObserver
-{
-    const long DROP_BEFORE = -1;
-    const long DROP_ON = 0;
-    const long DROP_AFTER = 1;
-    /**
-     * Methods used by the drag feedback code to determine if a drag is
-     * allowable at the current location. To get the behavior where drops are
-     * only allowed on items, such as the mailNews folder pane, always return
-     * false when the orientation is not DROP_ON.
-     */
-    boolean canDrop(long index, long orientation, DataTransfer? dataTransfer);
-
-    /**
-     * Called when the user drops something on this view. The |orientation|
-     * param specifies before/on/after the given |row|.
-     */
-    void onDrop(long row, long orientation, DataTransfer? dataTransfer);
- 
-    /** 
-     * Called when an item is opened or closed. 
-     */
-    void onToggleOpenState(long index);
-
-    /** 
-	 * Called when a header is clicked.
-     */
-    void onCycleHeader(DOMString colID, Element? elt);
-
-    /**
-     * Called when a cell in a non-selectable cycling column (e.g. 
-     * unread/flag/etc.) is clicked.
-     */
-    void onCycleCell(long row, DOMString colID);
-
-    /** 
-     * Called when selection in the tree changes
-     */
-    void onSelectionChanged();
-
-    /**
-     * A command API that can be used to invoke commands on the selection.  
-     * The tree will automatically invoke this method when certain keys 
-     * are pressed.  For example, when the DEL key is pressed, performAction 
-     * will be called with the "delete" string. 
-     */
-    void onPerformAction(DOMString action);
-
-    /**
-     * A command API that can be used to invoke commands on a specific row.
-     */
-    void onPerformActionOnRow(DOMString action, long row);
-
-    /**
-     * A command API that can be used to invoke commands on a specific cell.
-     */
-    void onPerformActionOnCell(DOMString action, long row, DOMString colID);
-};
-
-[Func="IsChromeOrXBL"]
-interface XULTreeBuilder : XULTemplateBuilder
-{
-    /**
-     * Retrieve the RDF resource associated with the specified row.
-     */
-    [Throws]
-    MozRDFResource? getResourceAtIndex(long aRowIndex);
-
-    /**
-     * Retrieve the index associated with specified RDF resource.
-     */
-    [Throws]
-    long getIndexOfResource(MozRDFResource resource);
-
-    /** 
-     * Add a Tree Builder Observer to handle Tree View 
-     * methods that the base builder does not implement. 
-     */
-    void addObserver(XULTreeBuilderObserver aObserver);
-
-    /** 
-     * Remove an Tree Builder Observer.
-     */
-    void removeObserver(XULTreeBuilderObserver aObserver);
-
-    /** 
-     * Sort the contents of the tree using the specified column.
-     */
-    void sort(Element aColumnElement);
-};
-XULTreeBuilder implements TreeView;
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -966,17 +966,16 @@ WEBIDL_FILES = [
     'XPathEvaluator.webidl',
     'XPathExpression.webidl',
     'XPathNSResolver.webidl',
     'XPathResult.webidl',
     'XSLTProcessor.webidl',
     'XULCommandEvent.webidl',
     'XULDocument.webidl',
     'XULElement.webidl',
-    'XULTemplateBuilder.webidl',
 ]
 
 if CONFIG['MOZ_WEBRTC']:
     WEBIDL_FILES += [
         'DataChannel.webidl',
         'PeerConnectionImpl.webidl',
         'PeerConnectionImplEnums.webidl',
         'PeerConnectionObserver.webidl',
--- a/dom/xslt/moz.build
+++ b/dom/xslt/moz.build
@@ -25,10 +25,9 @@ EXPORTS += [
 DIRS += [
     'base',
     'xml',
     'xpath',
     'xslt',
 ]
 
 if CONFIG['ENABLE_TESTS']:
-    JAR_MANIFESTS += ['tests/buster/jar.mn']
     MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
deleted file mode 100644
--- a/dom/xslt/tests/buster/DiffDOM.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// ----------------------
-// DiffDOM(node1,node2)
-// ----------------------
-
-var isHTML = false;
-
-function DiffDOM(node1, node2, aIsHTML)
-{
-  isHTML = aIsHTML;
-  return DiffNodeAndChildren(node1, node2);
-}
-
-
-// namespace attributes in the second node are ignored
-const nsreg = /^xmlns[|:\w]/;
-
-// This function does the work of DiffDOM by recursively calling
-// itself to explore the tree
-function DiffNodeAndChildren(node1, node2)
-{
-  if (!node1 && !node2)
-    return true;
-  if (!node1 || !node2)
-    return ErrorUp("One of the nodes is null", node1, node2);
-  if (node1.type!=node2.type)
-    return ErrorUp("Different node types", node1, node2);
-
-  var attributes = node2.attributes;
-  if (attributes && attributes.length) {
-    var item, name, ns, value, otherValue;
-    for (var index = 0; index < attributes.length; index++) {
-      item = attributes.item(index);
-      ns = item.namespaceURI;
-      if (ns) {
-        name = item.localName;
-        otherValue = node2.getAttributeNS(ns, name);
-      }
-      else {
-        name = item.nodeName;
-        otherValue = node2.getAttribute(name);
-      }
-      value = item.nodeValue;
-      if (!nsreg.test(name) && otherValue!=value) {
-        return ErrorUp("Different values for attribute", node1, node2);
-      }
-    }
-  }
-  else if (node1.attributes && node1.attributes.length) {
-    return ErrorUp("Different number of attributes", 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 (!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) {
-    if (node1.childNodes.length != node2.childNodes.length)
-      return ErrorUp("Different number of children", node1, node2);
-    for (var child = 0; child < node1.childNodes.length; child++) {
-      if (!DiffNodeAndChildren(node1.childNodes[child],
-                               node2.childNodes[child])) {
-        return false;
-      }
-    }
-  }
-  return true;
-}
-
-function ErrorUp(errMsg, node1, node2)
-{
-  dump("Error: "+errMsg+"\n");
-  if (node1) {
-      dump("Node 1: "+node1+", ");
-      if (node1.nodeType == Node.TEXT_NODE)
-          dump("nodeValue: "+node1.nodeValue+"\n");
-      else
-          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.namespaceURI+":"+node2.nodeName+"\n");
-  }
-  return false;
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/DumpDOM.js
+++ /dev/null
@@ -1,85 +0,0 @@
-// ----------------------
-// DumpDOM(node)
-//
-// Call this function to dump the contents of the DOM starting at the specified node.
-// Use node = document.documentElement to dump every element of the current document.
-// Use node = top.window.document.documentElement to dump every element.
-//
-// 8-13-99 Updated to dump almost all attributes of every node.  There are still some attributes
-//         that are purposely skipped to make it more readable.
-// ----------------------
-function DumpDOM(node)
-{
-	dump("--------------------- DumpDOM ---------------------\n");
-	
-	DumpNodeAndChildren(node, "");
-	
-	dump("------------------- End DumpDOM -------------------\n");
-}
-
-
-// This function does the work of DumpDOM by recursively calling itself to explore the tree
-function DumpNodeAndChildren(node, prefix)
-{
-	dump(prefix + "<" + node.nodeName);
-
-	var attributes = node.attributes;
-	
-	if ( attributes && attributes.length )
-	{
-		var item, name, value;
-		
-		for ( var index = 0; index < attributes.length; index++ )
-		{
-			item = attributes.item(index);
-			name = item.nodeName;
-			value = item.nodeValue;
-			
-			if ( (name == 'lazycontent' && value == 'true') ||
-				 (name == 'xulcontentsgenerated' && value == 'true') ||
-				 (name == 'id') ||
-				 (name == 'instanceOf') )
-			{
-				// ignore these
-			}
-			else
-			{
-				dump(" " + name + "=\"" + value + "\"");
-			}
-		}
-	}
-	
-	if ( node.nodeType == 1 )
-	{
-		// id
-		var text = node.getAttribute('id');
-		if ( text && text[0] != '$' )
-			dump(" id=\"" + text + "\"");
-	}
-	
-	if ( node.nodeType == Node.TEXT_NODE )
-		dump(" = \"" + node.data + "\"");
-	
-	dump(">\n");
-	
-	// dump IFRAME && FRAME DOM
-	if ( node.nodeName == "IFRAME" || node.nodeName == "FRAME" )
-	{
-		if ( node.name )
-		{
-			var wind = top.frames[node.name];
-			if ( wind && wind.document && wind.document.documentElement )
-			{
-				dump(prefix + "----------- " + node.nodeName + " -----------\n");
-				DumpNodeAndChildren(wind.document.documentElement, prefix + "  ");
-				dump(prefix + "--------- End " + node.nodeName + " ---------\n");
-			}
-		}
-	}
-	// children of nodes (other than frames)
-	else if ( node.childNodes )
-	{
-		for ( var child = 0; child < node.childNodes.length; child++ )
-			DumpNodeAndChildren(node.childNodes[child], prefix + "  ");
-	} 
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/ReadMe
+++ /dev/null
@@ -1,22 +0,0 @@
-The buster is a XUL interface to the conformance tests shipped as part of
-Xalan. For information about Xalan, please see http://xml.apache.org/.
-For your convenience we provide a packed distribution of all needed files
-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 an 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.
-
-Good luck and fun
-
-Axel Hecht <axel@pike.org>
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster-files.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const kFileOutStreamCID = "@mozilla.org/network/file-output-stream;1";
-const nsIFileOutputStream = Components.interfaces.nsIFileOutputStream;
-
-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)
-    {
-        switch(aCommand) {
-            case 'cmd_fl_save':
-                var sink = new Object;
-                sink.write = function(aContent, aCount)
-                {
-                    // replace NC:succ with NC:orig_succ,
-                    //  so the rdf stuff differs
-                    var content = aContent.replace(/NC:succ/g,"NC:orig_succ");
-                    content = content.replace(/NC:failCount/g,"NC:orig_failCount");
-                    this.mSink.write(content, content.length);
-                    return aCount;
-                };
-                var fp = doCreateRDFFP('Xalan results',
-                                       nsIFilePicker.modeSave);
-                var res = fp.show();
-
-                if (res == nsIFilePicker.returnOK ||
-                    res == nsIFilePicker.returnReplace) {
-                    var serial = doCreate(kRDFXMLSerializerID,
-                                          nsIRDFXMLSerializer);
-                    serial.init(view.mResultDS);
-                    serial.QueryInterface(nsIRDFXMLSource);
-                    var fl = fp.file;
-                    var fstream = doCreate(kFileOutStreamCID,
-                                           nsIFileOutputStream);
-                    fstream.init(fl, 26, 420, 0);
-                    sink.mSink = fstream;
-                    serial.Serialize(sink);
-                }
-                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.mPreviousResultDS) {
-                        view.database.RemoveDataSource(view.mPreviousResultDS);
-                        view.mPreviousResultDS = null;
-                    }
-                    view.mPreviousResultDS = kRDFSvc.GetDataSource(fp.fileURL.spec);
-                    view.database.AddDataSource(view.mPreviousResultDS);
-                }
-
-                document.getElementById('obs_orig_success')
-                    .setAttribute('hidden','false');
-                break;
-            default:
-                alert('Unknown Command'+aCommand);
-        }
-    }
-};
-
-registerController(cmdFileController);
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster-handlers.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var xalan_field;
-
-function onLoad()
-{
-    view.tree = document.getElementById('out');
-    view.boxObject = view.tree.boxObject;
-    {  
-        view.mIframe = document.getElementById('hiddenHtml');
-        view.mIframe.webNavigation.allowPlugins = false;
-        view.mIframe.webNavigation.allowJavascript = false;
-        view.mIframe.webNavigation.allowMetaRedirects = false;
-        view.mIframe.webNavigation.allowImages = false;
-    }
-    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);
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster-statics.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// helper function to shortcut component creation
-function doCreate(aContract, aInterface)
-{
-    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
-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 nsIRDFRemoteDataSource = Components.interfaces.nsIRDFRemoteDataSource;
-const nsIRDFPurgeableDataSource =
-    Components.interfaces.nsIRDFPurgeableDataSource;
-const nsIRDFResource = Components.interfaces.nsIRDFResource;
-const nsIRDFLiteral = Components.interfaces.nsIRDFLiteral;
-const nsIRDFInt = Components.interfaces.nsIRDFInt;
-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 krTypeFailCount = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#failCount");
-const krTypeName = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#name");
-const krTypeSucc = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#succ");
-const krTypeOrigSucc = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#orig_succ");
-const krTypeOrigFailCount = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#orig_failCount");
-const krTypeOrigSuccCount = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#orig_succCount");
-const krTypePath = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#path");
-const krTypeParent = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#parent");
-const krTypePurp = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#purp");
-const krTypeSuccCount = kRDFSvc.GetResource("http://home.netscape.com/NC-rdf#succCount");
-const kGood  = kRDFSvc.GetLiteral("yes");
-const kBad   = kRDFSvc.GetLiteral("no");
-const kMixed = kRDFSvc.GetLiteral("+-");
-const kContUtils = doCreate(kRDFContUtilsID, nsIRDFContainerUtils);
-
-function doCreateRDFFP(aTitle, aMode)
-{
-    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 {
-        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);
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster-test.js
+++ /dev/null
@@ -1,356 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-
-var parser = new DOMParser();
-var methodExpr = (new XPathEvaluator).createExpression("xsl:output/@method",
-    {
-    lookupNamespaceURI: function(aPrefix)
-        {
-            if (aPrefix == "xsl")
-                return "http://www.w3.org/1999/XSL/Transform";
-            return "";
-        }
-    });
-
-const nsIWebProgListener = Components.interfaces.nsIWebProgressListener;
-
-var runQueue = 
-{
-    mArray : new Array(),
-    push : function(aRunItem)
-    {
-        this.mArray.push(aRunItem);
-    },
-    observe : function(aSubject, aTopic, aData)
-    {
-        var item = this.mArray.shift();
-        if (item) {
-            item.run(this);
-        }
-    },
-    run : function()
-    {
-        this.observe(null,'','');
-    }
-}
-
-var itemCache = 
-{
-    mArray : new Array(),
-    getItem : function(aResource)
-    {
-        // 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;
-        }
-        if (aResource.Value in this.mArray) {
-            return this.mArray[aResource.Value];
-        }
-        var 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)
-{
-  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);
-      }
-  }
-}
-
-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);
-            var xalan_fl  = this.kXalan.resolve(cat.Value+"/"+path.Value);
-            var xalan_ref  = this.kXalan.resolve(cat.Value+"-gold/"+path.Value);
-            this.mRefURL =
-                this.kXalan.resolve(cat.Value + "-gold/" + path.Value + ".out");
-            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);
-            }
-        }
-        this.mSourceDoc = document.implementation.createDocument('', '', null);
-        this.mSourceDoc.addEventListener("load",this.onload(1));
-        this.mSourceDoc.load(xalan_fl+".xml");
-        this.mStyleDoc = document.implementation.createDocument('', '', null);
-        this.mStyleDoc.addEventListener("load",this.styleLoaded());
-        this.mStyleDoc.load(xalan_fl+".xsl");
-    },
-
-    // nsIWebProgressListener
-    QueryInterface: function(aIID)
-    {
-        return this;
-    },
-    onStateChange: function(aProg, aRequest, aFlags, aStatus)
-    {
-        if ((aFlags & nsIWebProgListener.STATE_STOP) &&
-            (aFlags & nsIWebProgListener.STATE_IS_DOCUMENT)) {
-            aProg.removeProgressListener(this);
-            this.mRefDoc = document.getElementById('hiddenHtml').contentDocument;
-            this.fileLoaded(4);
-        }
-    },
-    onProgressChange: function(aProg, b,c,d,e,f)
-    {
-    },
-    onLocationChange: function(aProg, aRequest, aURI, aFlags)
-    {
-    },
-    onStatusChange: function(aProg, aRequest, aStatus, aMessage)
-    {
-    },
-    onSecurityChange: function(aWebProgress, aRequest, aState)
-    {
-    },
-
-    // onload handler helper
-    onload : function(file)
-    {
-        var self = this;
-        return function(e)
-        {
-            return self.fileLoaded(file);
-        };
-    },
-
-    styleLoaded : function()
-    {
-        var self = this;
-        return function(e)
-        {
-            return self.styleLoadedHelper();
-        };
-    },
-    styleLoadedHelper : function()
-    {
-        var method = methodExpr.evaluate(this.mStyleDoc.documentElement, 2,
-                                         null).stringValue;
-        var refContent;
-        if (!method) {
-            // implicit method, guess from result
-            refContent = this.loadTextFile(this.mRefURL);
-            if (refContent.match(/^\s*<html/gi)) {
-                method = 'html';
-            }
-            else {
-                method = 'xml';
-            }
-        }
-        this.mMethod = method;
-
-        switch (method) {
-        case 'xml':
-            if (!refContent) {
-                refContent = this.loadTextFile(this.mRefURL);
-            }
-            this.mRefDoc = parser.parseFromString(refContent, 'application/xml');
-            this.mLoaded += 4;
-            break;
-        case 'html':
-            view.loadHtml(this.mRefURL, this);
-            break;
-        case 'text':
-            if (!refContent) {
-                refContent = this.loadTextFile(this.mRefURL);
-            }
-            const ns = 'http://www.mozilla.org/TransforMiix';
-            const qn = 'transformiix:result';
-            this.mRefDoc =
-                document.implementation.createDocument(ns, qn, null);
-            var txt = this.mRefDoc.createTextNode(refContent);
-            this.mRefDoc.documentElement.appendChild(txt);
-            this.mLoaded += 4;
-            break;
-        default:
-            throw "unkown XSLT output method";
-        }
-        this.fileLoaded(2)
-    },
-
-    fileLoaded : function(mask)
-    {
-        this.mLoaded += mask;
-        if (this.mLoaded < 7) {
-            return;
-        }
-        this.doTransform();
-    },
-
-    doTransform : function()
-    {
-        this.kProcessor.reset();
-        try {
-            this.kProcessor.importStylesheet(this.mStyleDoc);
-            this.mResDoc =
-                this.kProcessor.transformToDocument(this.mSourceDoc);
-            this.mRefDoc.normalize();
-            isGood = DiffDOM(this.mResDoc.documentElement,
-                             this.mRefDoc.documentElement,
-                             this.mMethod == 'html');
-        } catch (e) {
-            isGood = false;
-        };
-        dump("This succeeded. "+isGood+"\n");
-        isGood = isGood.toString();
-        for (var i=0; i<this.kObservers.length; i++) {
-            var aObs = this.kObservers[i];
-            if (typeof(aObs)=='object' && typeof(aObs.observe)=='function') {
-                aObs.observe(this.mResource, 'success', isGood);
-            }
-            else if (typeof(aObs)=='function') {
-                aObs(this.mResource, 'success', isGood);
-            }
-        }
-        if (this.mObserver) {
-            if (typeof(this.mObserver)=='object') {
-                this.mObserver.observe(this.mResource, 'success', isGood);
-            }
-            else {
-                this.mObserver(this.mResource, 'success', isGood);
-            }
-        }
-    },
-
-    loadTextFile : function(url)
-    {
-        var chan = NetUtil.newChannel({
-            uri: url,
-            loadUsingSystemPrincipal: true
-        });
-        var instream = doCreate(SIS_CTRID, nsISIS);
-        instream.init(chan.open2());
-
-        return instream.read(instream.available());
-    }
-}
-
-runItem.prototype.kXalan.QueryInterface(nsIStandardURL);
-
-var cmdTestController = 
-{
-    supportsCommand: function(aCommand)
-    {
-        switch(aCommand) {
-            case 'cmd_tst_run':
-            case 'cmd_tst_runall':
-                return true;
-            default:
-        }
-        return false;
-    },
-    isCommandEnabled: function(aCommand)
-    {
-        return this.supportsCommand(aCommand);
-    },
-    doCommand: function(aCommand)
-    {
-        switch(aCommand) {
-            case 'cmd_tst_run':
-                dump("cmd_tst_run\n");
-                break;
-            case 'cmd_tst_runall':
-                dump("cmd_tst_runall\n");
-                var tst_run = document.getElementById('cmd_tst_run');
-                tst_run.doCommand();
-            default:
-        }
-    }
-};
-
-registerController(cmdTestController);
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster-view.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var view = 
-{
-    onRun : function()
-    {
-        runQueue.mArray = new Array();
-        var sels = this.boxObject.view.selection,a=new Object(),b=new Object(),k;
-        var rowResource, name, path;
-        for (k=0;k<sels.getRangeCount();k++){
-            sels.getRangeAt(k,a,b);
-            for (var l=a.value;l<=b.value;l++) {
-                rowResource = this.builder.getResourceAtIndex(l);
-                itemCache.getItem(rowResource);
-            }
-        }
-        runQueue.run();
-    },
-    displayTest : function()
-    {
-        var current = this.boxObject.view.selection.currentIndex;
-        var rowResource = this.builder.getResourceAtIndex(current);
-        var item = itemCache.getItem(rowResource);
-    },
-    browseForRDF : function()
-    {
-        var fp = doCreateRDFFP('Xalan Description File',
-                               nsIFilePicker.modeOpen);
-        var res = fp.show();
-
-        if (res == nsIFilePicker.returnOK) {
-            var furl = fp.fileURL;
-            this.setDataSource(fp.fileURL.spec);
-        }
-    },
-    dump_Good : function()
-    {
-        var enumi = this.mResultDS.GetSources(krTypeSucc, kGood, true);
-        var k = 0;
-        while (enumi.hasMoreElements()) {
-            k += 1;
-            dump(enumi.getNext().QueryInterface(nsIRDFResource).Value+"\n");
-        }
-        dump("found "+k+" good tests\n");
-    },
-    prune_ds : function()
-    {
-        if (this.mResultDS) {
-            this.mResultDS.QueryInterface(nsIRDFPurgeableDataSource).Sweep();
-        }
-        regressionStats.init()
-        itemCache.mArray = new Array();
-    },
-    setDataSource : function(aSpec)
-    {
-        var baseSpec;
-        if (aSpec) {
-            baseSpec = aSpec;
-        }
-        else {
-            baseSpec = document.getElementById("xalan_rdf").value;
-        }
-        if (this.mXalanDS && this.mXalanDS.URI == baseSpec) {
-            this.mXalanDS.QueryInterface(nsIRDFRemoteDataSource);
-            this.mXalanDS.Refresh(true);
-        }
-        else {
-            if (this.mXalanDS) {
-                this.database.RemoveDataSource(view.mXalanDS);
-            }
-            this.mXalanDS = kRDFSvc.GetDataSourceBlocking(baseSpec);
-            if (!this.mXalanDS) {
-                alert("Unable do load DataSource: "+baseSpec);
-                return;
-            }
-            this.database.AddDataSource(this.mXalanDS);
-        }
-        regressionStats.init();
-        if (!this.mResultDS) {
-            this.mResultDS = doCreate(kRDFInMemContractID,
-                                      nsIRDFDataSource);
-            this.database.AddDataSource(view.mResultDS);
-            if (!this.mResultDS) {
-                alert("Unable to create result InMemDatasource");
-                return;
-            }
-        }
-
-        this.builder.rebuild();
-        document.getElementById("xalan_rdf").value = baseSpec;
-        runItem.prototype.kXalan.init(runItem.prototype.kXalan.URLTYPE_STANDARD,
-                                      0, baseSpec, null, null);
-    },
-    loadHtml : function(aUrl, aListener)
-    {
-        const nsIIRequestor = Components.interfaces.nsIInterfaceRequestor;
-        const nsIWebProgress = Components.interfaces.nsIWebProgress;
-        var req = this.mIframe.webNavigation.QueryInterface(nsIIRequestor);
-        var prog = req.getInterface(nsIWebProgress);
-        prog.addProgressListener(aListener, nsIWebProgress.NOTIFY_ALL);
-        this.mIframe.webNavigation.loadURI(aUrl, 0,null,null,null,
-                                           Services.scriptSecurityManager.getSystemPrincipal());
-    },
-    fillItemContext : function()
-    {
-        var index = view.boxObject.view.selection.currentIndex;
-        var res = view.builder.getResourceAtIndex(index);
-        var purp = view.mXalanDS.GetTarget(res, krTypePurp, true);
-        return (purp != null);
-    }
-}
-
-regressionStats =
-{
-    observe: function(aSubject, aTopic, aData)
-    {
-        if (aTopic != 'success') {
-            return;
-        }
-        var arc = (aData == "true") ? krTypeSuccCount : krTypeFailCount;
-        this.assertNewCount(aSubject, arc, 1);
-    },
-    init: function()
-    {
-        if (this.mRegressionDS) {
-            this.mRegressionDS.QueryInterface(nsIRDFPurgeableDataSource).Sweep();
-        }
-        else {
-            this.mRegressionDS = 
-                doCreate(kRDFInMemContractID, nsIRDFDataSource);
-            view.database.AddDataSource(this.mRegressionDS);
-        }
-    },
-    getParent: function(aDS, aSource)
-    {
-        // parent chached?
-        var parent = this.mRegressionDS.GetTarget(aSource, krTypeParent, true);
-        if (!parent) {
-            var labels = view.mXalanDS.ArcLabelsIn(aSource);
-            while (labels.hasMoreElements()) {
-                var arc = labels.getNext().QueryInterface(nsIRDFResource);
-                if (arc.Value.match(this.mChildRE)) {
-                    parent = view.mXalanDS.GetSource(arc, aSource, true);
-                    // cache the parent
-                    this.mRegressionDS.Assert(aSource, krTypeParent,
-                                              parent, true);
-                }
-            }
-        }
-        return parent;
-    },
-    assertNewCount: function(aSource, aArc, aIncrement)
-    {
-        var root = kRDFSvc.GetResource('urn:root');
-        var count = 0;
-        // parent chached?
-        var parent = this.getParent(view.XalanDS, aSource);
-        while (parent && !parent.EqualsNode(root)) {
-            var countRes = view.mResultDS.GetTarget(parent, aArc, true);
-            if (countRes) {
-                count = countRes.QueryInterface(nsIRDFInt).Value;
-            }
-            var newCountRes = kRDFSvc.GetIntLiteral(count + aIncrement);
-            if (!newCountRes) {
-                return;
-            }
-
-            if (countRes) {
-                view.mResultDS.Change(parent, aArc, countRes, newCountRes);
-            }
-            else {
-                view.mResultDS.Assert(parent, aArc, newCountRes, true);
-            }
-            parent = this.getParent(view.XalanDS, parent);
-        }
-    },
-    mRegressionDS: 0,
-    mChildRE: /http:\/\/www\.w3\.org\/1999\/02\/22-rdf-syntax-ns#_/
-}
-
-function rdfObserve(aSubject, aTopic, aData)
-{
-    if (aTopic == "success") {
-        var target = (aData == "true") ? kGood : kBad;
-        view.mResultDS.Assert(aSubject, krTypeSucc, target, true);
-
-        regressionStats.observe(aSubject, aTopic, aData);
-    }
-}
-
-runItem.prototype.kObservers.push(rdfObserve);
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-label.head {
-  padding:     5px;
-  font-size:   medium;
-  font-weight: bold;
-}
-
-treechildren::-moz-tree-cell(success yes)
-{
-  background-color: green ;
-}
-
-treechildren::-moz-tree-cell(success no)
-{
-  background-color: red ;
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/buster.xul
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0"?><!-- -*- Mode: xml; tab-width: 2; indent-tabs-mode: nil -*- -->
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
-<?xml-stylesheet href="buster.css" type="text/css"?>
-
-<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
-<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
-
-<window id="XalanBuster"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="onLoad()" onunload="onUnload()"
-        title="Xalan testcase harness"
-        persist="width,height"
-        width="800"
-        height="600"
-        orient="vertical">
-<script type="application/x-javascript" src="buster-statics.js" />
-<script type="application/x-javascript" src="buster-test.js" />
-<script type="application/x-javascript" src="buster-view.js" />
-<script type="application/x-javascript" src="buster-handlers.js" />
-<script type="application/x-javascript" src="result-view.js" />
-<script type="application/x-javascript" src="buster-files.js" />
-<script type="application/x-javascript" src="DumpDOM.js" />
-<script type="application/x-javascript" src="DiffDOM.js" />
-
-<commands id="busterKing">
-  <commandset id="buster_file_cmds">
-    <command id="cmd_fl_save" oncommand="goDoCommand('cmd_fl_save')" />
-    <command id="cmd_fl_import" oncommand="goDoCommand('cmd_fl_import')"/>
-  </commandset>
-  <commandset id="buster_test_cmds">
-    <command id="cmd_tst_run" oncommand="goDoCommand('cmd_tst_run')" />
-    <command id="cmd_tst_runall" oncommand="goDoCommand('cmd_tst_runall')" />
-  </commandset>
-  <commandset id="commands">
-    <command id="cmd_quit"/>
-    <command id="cmd_close" oncommand="window.close();"/>
-  </commandset>
-</commands>
-
-<keyset>
-  <key id="key_quit"/>
-  <key id="key_close"/>
-</keyset>
-
-<broadcasterset>
-  <broadcaster id="obs_orig_success" hidden="true"/>
-  <broadcaster id="not_yet" disabled="true"/>
-</broadcasterset>
-
-
-<menubar>
-  <menu id="menu_File" label="File" accesskey="f">
-    <menupopup id="menu_FilePopup">
-      <menuitem label="Save results ..." accesskey="s"
-                observes="cmd_fl_save"/>
-      <menuitem label="Import results ..." accesskey="i"
-                observes="cmd_fl_import"/>
-      <menuitem id="menu_close"/>
-    </menupopup>
-  </menu>
-  <menu id="busterTests" label="Tests" accesskey="t">
-    <menupopup id="tests-popup">
-      <menuitem label="run a test" accesskey="r"
-                observes="cmd_tst_run"/>
-      <menuitem label="run all tests" accesskey="a"
-                observes="cmd_tst_runall"/>
-    </menupopup>
-  </menu>
-</menubar>
-
-<popupset>
-  <popup id="itemcontext" onpopupshowing="return view.fillItemContext();">
-    <menuitem label="View Test" oncommand="onNewResultView(event)"/>
-  </popup>
-</popupset>
-
-<hbox>
-  <button label="check all" oncommand="check(true)" observes="not_yet"/>
-  <button label="uncheck all" oncommand="check(false)" observes="not_yet"/>
-  <button label="reset success" oncommand="view.prune_ds()" />
-  <button label="run checked tests" oncommand="view.onRun()" />
-</hbox>
-<hbox>
-  <label value="Xalan index: " class="head"/>
-  <textbox id="xalan_rdf" persist="url" crop="end" size="40"/>
-  <button label="browse..." oncommand="view.browseForRDF()" />
-</hbox>
-<hbox>
-<groupbox orient="horizontal"><caption label="search" />
-  <button label="Search for " oncommand="select()" observes="not_yet"/>
-  <textbox style="width: 10em;" id="search-name" persist="value" /><label value=" in " />
-  <menulist id="search-field" persist="data" observes="not_yet">
-    <menupopup>
-      <menuitem value="1" label="Name" />
-      <menuitem value="2" label="Purpose" />
-      <menuitem value="3" label="Comment" />
-    </menupopup>
-  </menulist>
-</groupbox>
-<spacer flex="1" /></hbox>
-
-<tree id="out" flex="1" flags="dont-build-content" hidecolumnpicker="true"
-      datasources="rdf:null" ref="urn:root" context="itemcontext">
-  <treecols>
-    <treecol id="NameColumn" flex="1" label="Name" sort="?name"
-             primary="true" />
-    <splitter class="tree-splitter" />
-    <treecol id="PurpsColumn" flex="2" label="Purpose" sort="?purp" />
-    <splitter class="tree-splitter" />
-    <treecol id="SuccessColumn" flex="0" label="Success"  />
-    <splitter class="tree-splitter" observes="obs_orig_success" />
-    <treecol id="OrigSuccessColumn" flex="0" label="Previously" 
-             observes="obs_orig_success" />
-  </treecols>
-  <template>
-    <rule>
-      <conditions>
-        <content uri="?uri" />
-        <member container="?uri" child="?subheading" />
-        <triple subject="?subheading"
-                predicate="http://home.netscape.com/NC-rdf#purp"
-                object="?purp" />
-      </conditions>
-
-      <bindings>
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#name"
-                 object="?name" />
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#succ"
-                 object="?succ" />
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#orig_succ"
-                 object="?orig_succ" />
-      </bindings>
-
-      <action>
-        <treechildren>
-          <treeitem uri="?subheading">
-            <treerow>
-              <treecell ref="NameColumn"    label="?name" />
-              <treecell ref="PurpsColumn"   label="?purp" />
-              <treecell ref="SuccessColumn" label="?succ"
-                        properties="success ?succ"/>
-              <treecell ref="OrigSuccessColumn" label="?orig_succ"
-                        properties="success ?orig_succ" />
-            </treerow>
-          </treeitem>
-        </treechildren>
-      </action>
-    </rule>
-    <rule>
-      <conditions>
-        <content uri="?uri" />
-        <member container="?uri" child="?subheading" />
-      </conditions>
-
-      <bindings>
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#dir"
-                 object="?dir" />
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#succCount"
-                 object="?succ" />
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#failCount"
-                 object="?fail" />
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#orig_succCount"
-                 object="?orig_succ" />
-        <binding subject="?subheading"
-                 predicate="http://home.netscape.com/NC-rdf#orig_failCount"
-                 object="?orig_fail" />
-      </bindings>
-
-      <action>
-        <treechildren>
-          <treeitem uri="?subheading">
-            <treerow>
-              <treecell ref="NameColumn"    label="?dir" />
-              <treecell ref="PurpsColumn"   label="" />
-              <treecell ref="SuccessColumn" label="?succ / ?fail" />
-              <treecell ref="OrigSuccessColumn" label="?orig_succ / ?orig_fail" />
-            </treerow>
-          </treeitem>
-        </treechildren>
-      </action>
-    </rule>
-  </template>
-</tree>
-<iframe style="visibility:hidden; height:0px;" id="hiddenHtml" />
-</window>
deleted file mode 100644
--- a/dom/xslt/tests/buster/helper/generate-rdf.pl
+++ /dev/null
@@ -1,95 +0,0 @@
-use File::Spec;
-
-my(@chunks, @list, $entry, $main_cats, $spacing);
-@list = ('conf', 'perf');
-foreach $entry (@list) {
-    $main_cats .= "     <rdf:li><rdf:Description about=\"urn:x-buster:$entry\" nc:dir=\"$entry\" /></rdf:li>\n";
-    go_in($entry, '', $entry);
-}
-if ($ARGV[0]) {
-    open OUTPUT, ">$ARGV[0]";
-}
-else {
-    open OUTPUT, ">xalan.rdf";
-};
-select(OUTPUT);
-print '<?xml version="1.0"?>
-
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:nc="http://home.netscape.com/NC-rdf#">
-  <rdf:Seq about="urn:root">
-' . $main_cats . '  </rdf:Seq>
-';
-print join('',@chunks);
-print '</rdf:RDF>
-';
-exit 0;
-
-sub go_in {
-    my($current, $about, $cat) = @_;
-    my (@list, $entry, @subdirs, @files, @purps, $rdf);
-    chdir $current;
-    @list = <*>;
-    
-    LOOP: foreach $entry (@list) {
-        next LOOP if $entry=~/^CVS$/;
-        if (! -d $entry) {
-            if ($entry=~/^($current.*)\.xsl$/) {
-		local $source = $entry;
-		$source=~s/xsl$/xml/;
-		next LOOP if ! -f $source;
-		$entry=~/^($current.*)\.xsl$/;
-                push(@files, $1);
-                local ($purp, $purp_open);
-                open STYLE, $entry;
-                $purp_open = 0;
-                while (<STYLE>) {
-                    if (/<!--\s+purpose: (.+)\s*-->/i) {
-                        $purp .= $1;
-                    }
-                    elsif (/<!--\s+purpose: (.+)\s*$/i) {
-                        $purp_open = 1;
-                        $purp .= $1;
-                    }
-                    elsif ($purp_open) {
-                        if (/\s*(\s.+)\s*-->/) {
-                            $purp_open = 0;
-                            $purp .= $1;
-                        }
-                        elsif (/\s*(\s.+)\s*$/) {
-                            $purp .= $1;
-                        }
-                    }
-                }
-                $purp=~s/"/'/g; $purp=~s/&/&amp;/g; $purp=~s/</&lt;/g;
-                $purp=~s/\r/ /g; $purp=~s/\s\s/ /g; $purp=~s/\s$//g;
-                push(@purps, $purp);
-            }
-        }
-        else {
-            push(@subdirs, $entry);
-        }
-    }
-
-    if (@subdirs > 0 || @files > 0) {
-        my $topic = $about.$current; $topic=~s/\///g;
-        $rdf = '  <rdf:Seq about="urn:x-buster:'.$topic."\">\n";
-        foreach $entry (@subdirs) {
-            if (go_in($entry, $about.$current.'/', $cat)) {
-                my $id = 'urn:x-buster:'.$about.$current.$entry; $id=~s/\///g;
-                $rdf .= "    <rdf:li><rdf:Description about=\"$id\" nc:dir=\"$entry\" /></rdf:li>\n";
-            }
-        }
-        for (my $i=0; $i < @files; $i++) {
-            my $uri = $about.$current.'/'.$files[$i];
-            $uri=~s/[^\/]+\///;
-            my $id = $uri; $id=~s/\///g;
-            $rdf .= "    <rdf:li><rdf:Description about=\"urn:x-buster:$files[$i]\" nc:name=\"$files[$i]\" nc:purp=\"$purps[$i]\" nc:path=\"$uri\" nc:category=\"$cat\" /></rdf:li>\n";
-        }
-        $rdf .= "  </rdf:Seq>\n";
-        push(@chunks, $rdf);
-    }
-
-    chdir File::Spec->updir;
-    return (@subdirs > 0 || @files > 0);
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/install.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const X_APP             = "Buster";
-const X_VER             = "2.0"
-const X_JAR_FILE        = "xslt-qa.jar";
-
-var err = initInstall("Install " + X_APP, X_APP, X_VER);
-logComment("initInstall: " + err);
-logComment( "Installation started ..." );
-addFile("We're on our way ...", X_JAR_FILE, getFolder("chrome"), "");
-registerChrome(CONTENT|DELAYED_CHROME, getFolder("chrome", X_JAR_FILE), "content/xslt-qa/");
-err = getLastError();
-if (err == SUCCESS)  {
-  performInstall();
-  alert("Please restart Mozilla");
-}
-else  {
-  cancelInstall();
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/jar.mn
+++ /dev/null
@@ -1,18 +0,0 @@
-xslt-qa.jar:
-% content xslt-qa %content/xslt-qa/
-% overlay chrome://communicator/content/tasksOverlay.xul chrome://xslt-qa/content/xslt-qa-overlay.xul
-  content/xslt-qa/xslt-qa-overlay.xul
-  content/xslt-qa/xslt-qa-overlay.js
-  content/xslt-qa/buster/buster.xul
-  content/xslt-qa/buster/buster.css
-  content/xslt-qa/buster/buster-statics.js
-  content/xslt-qa/buster/buster-handlers.js
-  content/xslt-qa/buster/buster-files.js
-  content/xslt-qa/buster/buster-test.js
-  content/xslt-qa/buster/buster-view.js
-  content/xslt-qa/buster/result-view.xul
-  content/xslt-qa/buster/result-inspector.xul
-  content/xslt-qa/buster/result-view.css
-  content/xslt-qa/buster/result-view.js
-  content/xslt-qa/buster/DumpDOM.js
-  content/xslt-qa/buster/DiffDOM.js
deleted file mode 100644
--- a/dom/xslt/tests/buster/result-inspector.xul
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?><!-- -*- Mode: xml; tab-width: 2; indent-tabs-mode: nil -*- -->
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!DOCTYPE window [
-  <!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
-  <!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
-]>
-
-<?xul-overlay href="chrome://inspector/content/commandOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/keysetOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/popupOverlay.xul"?>
-
-<?xml-stylesheet href="chrome://inspector/skin/inspectorWindow.css"?>
-
-<window class="color-dialog" 
-        title="&Inspector.title;"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  
-  <script type="application/x-javascript" src="chrome://inspector/content/ViewerRegistry.js"/>
-  <script type="application/x-javascript" src="chrome://inspector/content/utils.js"/>
-  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
-  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/rdf/RDFU.js"/>
-  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/rdf/RDFArray.js"/>
-  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
-  <script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/FrameExchange.js"/>
-      
-  <commandset id="cmdsGlobalCommands"/>
-  <keyset id="ksGlobalKeyset"/>
-  <popupset id="ppsViewerPopupset"/>
-  
-  <domi-panelset id="bxPanelSet" flex="1" viewercommandset="cmdsGlobalCommands">
-    <domi-panel title="&bxDocPanel.title;" flex="1"/>
-  </domi-panelset>
-
-</window>
deleted file mode 100644
--- a/dom/xslt/tests/buster/result-view.css
+++ /dev/null
@@ -1,16 +0,0 @@
-label.heading {
-  font-size:   medium;
-  font-weight: bold;
-}
-
-button.close {
-  font-size:   small;
-}
-
-iframe {
-  padding-left: 10px;
-}
-
-vbox.hidden {
-    display: none;
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/result-view.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-const SYSTEMPRINCIPAL = Services.scriptSecurityManager.getSystemPrincipal();
-
-function onNewResultView(event)
-{
-    dump("onNewResultView\n");
-    const db = runItem.prototype.kDatabase;
-    const kXalan = runItem.prototype.kXalan;
-    var index = view.boxObject.view.selection.currentIndex;
-    var res = view.builder.getResourceAtIndex(index);
-    var name = db.GetTarget(res, krTypeName, true);
-    if (!name) {
-        return false;
-    }
-    var cat = db.GetTarget(res, krTypeCat, true);
-    var path = db.GetTarget(res, krTypePath, true);
-    cat = cat.QueryInterface(nsIRDFLiteral);
-    name = name.QueryInterface(nsIRDFLiteral);
-    path = path.QueryInterface(nsIRDFLiteral);
-    xalan_fl  = kXalan.resolve(cat.Value+"/"+path.Value);
-    xalan_ref  = kXalan.resolve(cat.Value+"-gold/"+path.Value);
-    var currentResultItem = new Object();
-    currentResultItem.testpath = xalan_fl;
-    currentResultItem.refpath = xalan_ref;
-    var currentRunItem = itemCache.getItem(res);
-    // XXX todo, keep a list of these windows, so that we can close them.
-    resultWin = window.openDialog('result-view.xul','_blank',
-                                   'chrome,resizable,dialog=no',
-                                   currentResultItem, currentRunItem);
-    return true;
-}
-
-var refInspector;
-var resInspector;
-
-function onResultViewLoad(event)
-{
-    dump("onResultViewLoad\n");
-    aResultItem = window.arguments[0];
-    aRunItem = window.arguments[1];
-    var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
-    document.getElementById('src').webNavigation.loadURI('view-source:'+
-        aResultItem.testpath+'.xml', loadFlags, null, null, null,
-        SYSTEMPRINCIPAL);
-    document.getElementById('style').webNavigation.loadURI('view-source:'+
-        aResultItem.testpath+'.xsl', loadFlags, null, null, null,
-        SYSTEMPRINCIPAL);
-
-    if (aRunItem && aRunItem.mRefDoc && aRunItem.mResDoc) {
-        document.getElementById("refSourceBox").setAttribute("class", "hidden");
-        refInspector = new ObjectApp();
-        refInspector.initialize("refInsp", aRunItem.mRefDoc);
-        resInspector = new ObjectApp();
-        resInspector.initialize("resInsp", aRunItem.mResDoc);
-    }
-    else {
-        document.getElementById("inspectorBox").setAttribute("class", "hidden");
-        document.getElementById('ref').webNavigation.loadURI('view-source:'+
-            aResultItem.refpath+'.out', loadFlags, null, null, null,
-            SYSTEMPRINCIPAL);
-    }
-    return true;
-}
-
-function onResultViewUnload(event)
-{
-    dump("onResultUnload\n");
-}
-
-function ObjectApp()
-{
-}
-
-ObjectApp.prototype = 
-{
-    mDoc: null,
-    mPanelSet: null,
-
-    initialize: function(aId, aDoc)
-    {
-        this.mDoc = aDoc;
-        this.mPanelSet = document.getElementById(aId).contentDocument.getElementById("bxPanelSet");
-        this.mPanelSet.addObserver("panelsetready", this);
-        this.mPanelSet.initialize();
-    },
-
-    doViewerCommand: function(aCommand)
-    {
-        this.mPanelSet.execCommand(aCommand);
-    },
-
-    getViewer: function(aUID)
-    {
-        return this.mPanelSet.registry.getViewerByUID(aUID);
-    },
-
-    onEvent: function(aEvent)
-    {
-        switch (aEvent.type) {
-            case "panelsetready":
-            {
-                this.mPanelSet.getPanel(0).subject = this.mDoc;
-            }
-        }
-    }
-};
deleted file mode 100644
--- a/dom/xslt/tests/buster/result-view.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?><!-- -*- Mode: xml; tab-width: 2; indent-tabs-mode: nil -*- -->
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
-<?xml-stylesheet href="result-view.css" type="text/css"?>
-
-<window id="buster-result-view" title="Xalan testcase details"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        orient="vertical" persist="width height"
-	onload="onResultViewLoad()" onunload="onResultViewUnload()">
-  <script type="application/x-javascript" src="DumpDOM.js" />
-  <script type="application/x-javascript" src="buster-statics.js" />
-  <script type="application/x-javascript" src="buster-test.js" />
-  <script type="application/x-javascript" src="result-view.js" />
-
-  <hbox>
-    <button class="close" label="close this window"
-            oncommand="window.close()" />
-  </hbox>
-  <vbox flex="1">
-    <label class="heading" value="XML Source:" />
-    <iframe flex="1" id="src" />
-  </vbox>
-  <vbox flex="1">
-    <label class="heading" value="XSL Source:" />
-    <iframe flex="1" id="style" />
-  </vbox>
-  <vbox flex="1" id="refSourceBox">
-    <label class="heading" value="Reference Source:" />
-    <iframe flex="1" id="ref" />
-  </vbox>
-  <vbox flex="2" id="inspectorBox">
-    <hbox flex="1">  
-      <vbox flex="1">
-        <label class="heading" value="Reference" />
-        <iframe flex="1" id="refInsp" src="result-inspector.xul" />
-      </vbox>
-      <vbox flex="1">
-        <label class="heading" value="Result" />
-        <iframe flex="1" id="resInsp" src="result-inspector.xul" />
-      </vbox>
-    </hbox>
-  </vbox>
-</window>
deleted file mode 100644
--- a/dom/xslt/tests/buster/xslt-qa-overlay.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function onStartBuster()
-{
-    window.open('chrome://xslt-qa/content/buster/buster.xul',
-                'buster', 'chrome,resizable');
-}
deleted file mode 100644
--- a/dom/xslt/tests/buster/xslt-qa-overlay.xul
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?><!-- -*- Mode: xml; tab-width: 2; indent-tabs-mode: nil -*- -->
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<overlay id="xsltToolsMenuID"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <script src="xslt-qa-overlay.js" />
-  <menupopup id="toolsPopup">
-    <menuitem label="Xalan Tests" oncommand="onStartBuster()"/>
-  </menupopup>
-</overlay>
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -46,24 +46,24 @@
 #include "nsPIBoxObject.h"
 #include "mozilla/dom/BoxObject.h"
 #include "nsString.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIWindowRoot.h"
 #include "nsXULCommandDispatcher.h"
 #include "nsXULElement.h"
 #include "mozilla/Logging.h"
-#include "rdf.h"
 #include "nsIFrame.h"
 #include "nsXBLService.h"
 #include "nsCExternalHandlerService.h"
 #include "nsMimeTypes.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsContentList.h"
+#include "nsISimpleEnumerator.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "nsIParser.h"
 #include "nsCharsetSource.h"
 #include "mozilla/StyleSheetInlines.h"
@@ -90,18 +90,16 @@
 #include "nsTextNode.h"
 #include "nsJSUtils.h"
 #include "mozilla/dom/URL.h"
 #include "nsIContentPolicy.h"
 #include "mozAutoDocUpdate.h"
 #include "xpcpublic.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
-#include "nsXULTemplateBuilder.h"
-#include "nsXULTreeBuilder.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 //
 // CIDs
 //
@@ -192,17 +190,16 @@ namespace dom {
 XULDocument::XULDocument(void)
     : XMLDocument("application/vnd.mozilla.xul+xml"),
       mNextSrcLoadWaiter(nullptr),
       mApplyingPersistedAttrs(false),
       mIsWritingFastLoad(false),
       mDocumentLoaded(false),
       mStillWalking(false),
       mRestrictPersistence(false),
-      mTemplateBuilderTable(nullptr),
       mPendingSheets(0),
       mDocLWTheme(Doc_Theme_Uninitialized),
       mState(eState_Master),
       mCurrentScriptProto(nullptr),
       mOffThreadCompiling(false),
       mOffThreadCompileStringBuf(nullptr),
       mOffThreadCompileStringLength(0),
       mResolutionPhase(nsForwardReference::eStart),
@@ -232,18 +229,16 @@ XULDocument::~XULDocument()
     mForwardReferences.Clear();
     // Likewise for any references we have to IDs where we might
     // look for persisted data:
     mPersistenceIds.Clear();
 
     // Destroy our broadcaster map.
     delete mBroadcasterMap;
 
-    delete mTemplateBuilderTable;
-
     Preferences::UnregisterCallback(XULDocument::DirectionChanged,
                                     "intl.uidirection", this);
 
     if (mOffThreadCompileStringBuf) {
       js_free(mOffThreadCompileStringBuf);
     }
 }
 
@@ -280,29 +275,16 @@ namespace dom {
 NS_IMPL_CYCLE_COLLECTION_CLASS(XULDocument)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XULDocument, XMLDocument)
     NS_ASSERTION(!nsCCUncollectableMarker::InGeneration(cb, tmp->GetMarkedCCGeneration()),
                  "Shouldn't traverse XULDocument!");
     // XXX tmp->mForwardReferences?
     // XXX tmp->mContextStack?
 
-    // An element will only have a template builder as long as it's in the
-    // document, so we'll traverse the table here instead of from the element.
-    if (tmp->mTemplateBuilderTable) {
-        for (auto iter = tmp->mTemplateBuilderTable->Iter();
-             !iter.Done();
-             iter.Next()) {
-            NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mTemplateBuilderTable key");
-            cb.NoteXPCOMChild(iter.Key());
-            NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mTemplateBuilderTable value");
-            cb.NoteXPCOMChild(iter.UserData());
-        }
-    }
-
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCurrentPrototype)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMasterPrototype)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCommandDispatcher)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrototypes)
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocalStore)
 
     if (tmp->mOverlayLoadObservers) {
         for (auto iter = tmp->mOverlayLoadObservers->Iter();
@@ -318,19 +300,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
              iter.Next()) {
             NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mPendingOverlayLoadNotifications value");
             cb.NoteXPCOMChild(iter.Data());
         }
     }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(XULDocument, XMLDocument)
-    delete tmp->mTemplateBuilderTable;
-    tmp->mTemplateBuilderTable = nullptr;
-
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mCommandDispatcher)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mLocalStore)
     //XXX We should probably unlink all the objects we traverse.
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_IMPL_ISUPPORTS_CYCLE_COLLECTION_INHERITED(XULDocument,
                                              XMLDocument,
                                              nsIXULDocument,
@@ -1662,36 +1641,16 @@ XULDocument::AddElementToDocumentPost(El
     }
 
     // We need to pay special attention to the keyset tag to set up a listener
     if (aElement->NodeInfo()->Equals(nsGkAtoms::keyset, kNameSpaceID_XUL)) {
         // Create our XUL key listener and hook it up.
         nsXBLService::AttachGlobalKeyHandler(aElement);
     }
 
-    // See if we need to attach a XUL template to this node
-    bool needsHookup;
-    nsresult rv = CheckTemplateBuilderHookup(aElement, &needsHookup);
-    if (NS_FAILED(rv))
-        return rv;
-
-    if (needsHookup) {
-        if (mResolutionPhase == nsForwardReference::eDone) {
-            rv = CreateTemplateBuilder(aElement);
-            if (NS_FAILED(rv))
-                return rv;
-        }
-        else {
-            TemplateBuilderHookup* hookup = new TemplateBuilderHookup(aElement);
-            rv = AddForwardReference(hookup);
-            if (NS_FAILED(rv))
-                return rv;
-        }
-    }
-
     return NS_OK;
 }
 
 NS_IMETHODIMP
 XULDocument::AddSubtreeToDocument(nsIContent* aContent)
 {
     NS_ASSERTION(aContent->GetUncomposedDoc() == this, "Element not in doc!");
     // From here on we only care about elements.
@@ -1779,50 +1738,16 @@ XULDocument::RemoveSubtreeFromDocument(n
                          broadcasterID, attribute, getter_AddRefs(broadcaster));
     if (rv == NS_FINDBROADCASTER_FOUND) {
         RemoveBroadcastListenerFor(*broadcaster, *listener, attribute);
     }
 
     return NS_OK;
 }
 
-NS_IMETHODIMP
-XULDocument::SetTemplateBuilderFor(nsIContent* aContent,
-                                   nsIXULTemplateBuilder* aBuilder)
-{
-    if (! mTemplateBuilderTable) {
-        if (!aBuilder) {
-            return NS_OK;
-        }
-        mTemplateBuilderTable = new BuilderTable;
-    }
-
-    if (aBuilder) {
-        mTemplateBuilderTable->Put(aContent, aBuilder);
-    }
-    else {
-        mTemplateBuilderTable->Remove(aContent);
-    }
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-XULDocument::GetTemplateBuilderFor(nsIContent* aContent,
-                                   nsIXULTemplateBuilder** aResult)
-{
-    if (mTemplateBuilderTable) {
-        mTemplateBuilderTable->Get(aContent, aResult);
-    }
-    else
-        *aResult = nullptr;
-
-    return NS_OK;
-}
-
 static void
 GetRefMapAttribute(Element* aElement, nsAutoString* aValue)
 {
     aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::ref, *aValue);
 }
 
 nsresult
 XULDocument::AddElementToRefMap(Element* aElement)
@@ -3626,105 +3551,16 @@ XULDocument::AddAttributes(nsXULPrototyp
         if (NS_FAILED(rv)) return rv;
     }
 
     return NS_OK;
 }
 
 
 nsresult
-XULDocument::CheckTemplateBuilderHookup(Element* aElement,
-                                        bool* aNeedsHookup)
-{
-    // See if the element already has a `database' attribute. If it
-    // does, then the template builder has already been created.
-    //
-    // XXX This approach will crash and burn (well, maybe not _that_
-    // bad) if aElement is not a XUL element.
-    //
-    // XXXvarga Do we still want to support non XUL content?
-    RefPtr<nsXULElement> xulElement = nsXULElement::FromContent(aElement);
-    if (xulElement) {
-        nsCOMPtr<nsIRDFCompositeDataSource> ds = xulElement->GetDatabase();
-        if (ds) {
-            *aNeedsHookup = false;
-            return NS_OK;
-        }
-    }
-
-    // Check aElement for a 'datasources' attribute, if it has
-    // one a XUL template builder needs to be hooked up.
-    *aNeedsHookup = aElement->HasAttr(kNameSpaceID_None,
-                                      nsGkAtoms::datasources);
-    return NS_OK;
-}
-
-/* static */ nsresult
-XULDocument::CreateTemplateBuilder(Element* aElement)
-{
-    // Check if need to construct a tree builder or content builder.
-    bool isTreeBuilder = false;
-
-    // return successful if the element is not is a document, as an inline
-    // script could have removed it
-    nsIDocument* document = aElement->GetUncomposedDoc();
-    NS_ENSURE_TRUE(document, NS_OK);
-
-    int32_t nameSpaceID;
-    nsAtom* baseTag = document->BindingManager()->
-      ResolveTag(aElement, &nameSpaceID);
-
-    if ((nameSpaceID == kNameSpaceID_XUL) && (baseTag == nsGkAtoms::tree)) {
-        // By default, we build content for a tree and then we attach
-        // the tree content view. However, if the `dont-build-content'
-        // flag is set, then we we'll attach a tree builder which
-        // directly implements the tree view.
-
-        nsAutoString flags;
-        aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::flags, flags);
-        if (flags.Find(NS_LITERAL_STRING("dont-build-content")) >= 0) {
-            isTreeBuilder = true;
-        }
-    }
-
-    if (isTreeBuilder) {
-        // Create and initialize a tree builder.
-        RefPtr<nsXULTreeBuilder> builder = new nsXULTreeBuilder(aElement);
-        nsresult rv = builder->Init();
-        NS_ENSURE_SUCCESS(rv, rv);
-
-        // Create a <treechildren> if one isn't there already.
-        // XXXvarga what about attributes?
-        RefPtr<Element> bodyContent;
-        nsXULContentUtils::FindChildByTag(aElement, kNameSpaceID_XUL,
-                                          nsGkAtoms::treechildren,
-                                          getter_AddRefs(bodyContent));
-
-        if (!bodyContent) {
-            bodyContent =
-                document->CreateElem(nsDependentAtomString(nsGkAtoms::treechildren),
-                                     nullptr, kNameSpaceID_XUL);
-
-            aElement->AppendChildTo(bodyContent, false);
-        }
-    }
-    else {
-        // Create and initialize a content builder.
-        nsCOMPtr<nsIXULTemplateBuilder> builder;
-        nsresult rv = NS_NewXULContentBuilder(aElement, getter_AddRefs(builder));
-        NS_ENSURE_SUCCESS(rv, rv);
-
-        builder->CreateContents(aElement, false);
-    }
-
-    return NS_OK;
-}
-
-
-nsresult
 XULDocument::AddPrototypeSheets()
 {
     nsresult rv;
 
     const nsCOMArray<nsIURI>& sheets = mCurrentPrototype->GetStyleSheetReferences();
 
     for (int32_t i = 0; i < sheets.Count(); i++) {
         nsCOMPtr<nsIURI> uri = sheets[i];
@@ -4029,40 +3865,16 @@ XULDocument::BroadcasterHookup::~Broadca
         MOZ_LOG(gXULLog, LogLevel::Warning,
                ("xul: broadcaster hookup failed <%s attribute='%s'> to %s",
                 nsAtomCString(mObservesElement->NodeInfo()->NameAtom()).get(),
                 attributeC.get(),
                 broadcasteridC.get()));
     }
 }
 
-
-//----------------------------------------------------------------------
-//
-// XULDocument::TemplateBuilderHookup
-//
-
-nsForwardReference::Result
-XULDocument::TemplateBuilderHookup::Resolve()
-{
-    bool needsHookup;
-    nsresult rv = CheckTemplateBuilderHookup(mElement, &needsHookup);
-    if (NS_FAILED(rv))
-        return eResolve_Error;
-
-    if (needsHookup) {
-        rv = CreateTemplateBuilder(mElement);
-        if (NS_FAILED(rv))
-            return eResolve_Error;
-    }
-
-    return eResolve_Succeeded;
-}
-
-
 //----------------------------------------------------------------------
 
 nsresult
 XULDocument::BroadcastAttributeChangeFromOverlay(nsIContent* aNode,
                                                  int32_t aNameSpaceID,
                                                  nsAtom* aAttribute,
                                                  nsAtom* aPrefix,
                                                  const nsAString& aValue)
--- a/dom/xul/XULDocument.h
+++ b/dom/xul/XULDocument.h
@@ -125,20 +125,16 @@ public:
     NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE
 
     // nsIXULDocument interface
     virtual void GetElementsForID(const nsAString& aID,
                                   nsCOMArray<mozilla::dom::Element>& aElements) override;
 
     NS_IMETHOD AddSubtreeToDocument(nsIContent* aContent) override;
     NS_IMETHOD RemoveSubtreeFromDocument(nsIContent* aContent) override;
-    NS_IMETHOD SetTemplateBuilderFor(nsIContent* aContent,
-                                     nsIXULTemplateBuilder* aBuilder) override;
-    NS_IMETHOD GetTemplateBuilderFor(nsIContent* aContent,
-                                     nsIXULTemplateBuilder** aResult) override;
     NS_IMETHOD OnPrototypeLoadDone(bool aResumeWalk) override;
     bool OnDocumentParserError() override;
 
     // nsINode interface overrides
     virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                            bool aPreallocateChildren) const override;
 
     // nsIDOMNode interface
@@ -347,22 +343,16 @@ protected:
     /**
      * An array of style sheets, that will be added (preserving order) to the
      * document after all of them are loaded (in DoneWalking).
      */
     nsTArray<RefPtr<StyleSheet>> mOverlaySheets;
 
     nsCOMPtr<nsIDOMXULCommandDispatcher>     mCommandDispatcher; // [OWNER] of the focus tracker
 
-    // Maintains the template builders that have been attached to
-    // content elements
-    typedef nsInterfaceHashtable<nsISupportsHashKey, nsIXULTemplateBuilder>
-        BuilderTable;
-    BuilderTable* mTemplateBuilderTable;
-
     uint32_t mPendingSheets;
 
     /**
      * document lightweight theme for use with :-moz-lwtheme, :-moz-lwtheme-brighttext
      * and :-moz-lwtheme-darktext
      */
     DocumentTheme                         mDocLWTheme;
 
@@ -464,28 +454,16 @@ protected:
     /**
      * If the current transcluded script is being compiled off thread, the
      * source for that script.
      */
     char16_t* mOffThreadCompileStringBuf;
     size_t mOffThreadCompileStringLength;
 
     /**
-     * Check if a XUL template builder has already been hooked up.
-     */
-    static nsresult
-    CheckTemplateBuilderHookup(mozilla::dom::Element* aElement, bool* aNeedsHookup);
-
-    /**
-     * Create a XUL template builder on the specified node.
-     */
-    static nsresult
-    CreateTemplateBuilder(Element* aElement);
-
-    /**
      * Add the current prototype's style sheets (currently it's just
      * style overlays from the chrome registry) to the document.
      */
     nsresult AddPrototypeSheets();
 
 
 protected:
     /* Declarations related to forward references.
@@ -562,31 +540,16 @@ protected:
         virtual ~OverlayForwardReference();
 
         virtual Phase GetPhase() override { return eConstruction; }
         virtual Result Resolve() override;
     };
 
     friend class OverlayForwardReference;
 
-    class TemplateBuilderHookup : public nsForwardReference
-    {
-    protected:
-        nsCOMPtr<Element> mElement; // [OWNER]
-
-    public:
-        explicit TemplateBuilderHookup(Element* aElement)
-            : mElement(aElement) {}
-
-        virtual Phase GetPhase() override { return eHookup; }
-        virtual Result Resolve() override;
-    };
-
-    friend class TemplateBuilderHookup;
-
     // The out params of FindBroadcaster only have values that make sense when
     // the method returns NS_FINDBROADCASTER_FOUND.  In all other cases, the
     // values of the out params should not be relied on (though *aListener and
     // *aBroadcaster do need to be released if non-null, of course).
     nsresult
     FindBroadcaster(Element* aElement,
                     Element** aListener,
                     nsString& aBroadcasterID,
deleted file mode 100644
--- a/dom/xul/crashtests/583230.xul
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<richlistbox id="a" datasources="" template="d"/>
-<script><![CDATA[    
-function doe() {
-var node = document.getElementById('a');
-var b = node.builder;
-document.removeChild(document.documentElement);
-b.addResult({}, node);
-b.removeResult({});
-b.replaceResult({}, {}, node);
-b.resultBindingChanged({});
-try { b.addResult(null, null); } catch(ex) { }
-try { b.removeResult(null); } catch(ex) { }
-try { b.replaceResult(null, null, null); } catch(ex) { }
-try { b.resultBindingChanged(null); } catch(ex) { }
-try { b.getResultForId("empty"); } catch(ex) { }
-try { b.getResultForContent(node); } catch(ex) { }
-try { b.hasGeneratedContent(null, null); } catch(ex) { }
-}
-window.addEventListener("load", doe, false);
-]]></script>
-</window>
--- a/dom/xul/crashtests/crashtests.list
+++ b/dom/xul/crashtests/crashtests.list
@@ -25,9 +25,8 @@ load 431906-1.html
 load 451311-1.xul
 load 461917-1.xhtml
 load 468211-1.xul
 load 468211-2.xul
 load 468211-3.xul
 load 495635-1.xul
 load 509719-1.xul
 asserts(3) load 509719-2.xul # bug 909819
-load 583230.xul
--- a/dom/xul/moz.build
+++ b/dom/xul/moz.build
@@ -7,55 +7,55 @@
 with Files("**"):
     BUG_COMPONENT = ("Core", "XUL")
 
 MOCHITEST_MANIFESTS += ['test/mochitest.ini']
 
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 if CONFIG['MOZ_XUL']:
-    DIRS += ['templates']
-
     XPIDL_SOURCES += [
         'nsIXULOverlayProvider.idl',
     ]
 
     EXPORTS += [
         'nsIXULDocument.h',
         'nsXULElement.h',
     ]
 
     UNIFIED_SOURCES += [
         'nsXULCommandDispatcher.cpp',
         'nsXULContentSink.cpp',
+        'nsXULContentUtils.cpp',
         'nsXULElement.cpp',
         'nsXULPopupListener.cpp',
         'nsXULPrototypeCache.cpp',
         'nsXULPrototypeDocument.cpp',
+        'nsXULSortService.cpp',
         'XULDocument.cpp',
     ]
 
 XPIDL_SOURCES += [
     'nsIController.idl',
     'nsIControllers.idl',
+    'nsIXULSortService.idl',
 ]
 
 XPIDL_MODULE = 'xul'
 
 UNIFIED_SOURCES += [
     'nsXULControllers.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/docshell/base',
     '/dom/base',
     '/dom/html',
     '/dom/xbl',
     '/dom/xml',
-    '/dom/xul/templates',
     '/layout/base',
     '/layout/generic',
     '/layout/style',
     '/layout/xul',
 ]
 
 FINAL_LIBRARY = 'xul'
 
--- a/dom/xul/nsIXULDocument.h
+++ b/dom/xul/nsIXULDocument.h
@@ -49,29 +49,16 @@ public:
   NS_IMETHOD AddSubtreeToDocument(nsIContent* aElement) = 0;
 
   /**
    * Notify the XUL document that a subtree has been removed
    */
   NS_IMETHOD RemoveSubtreeFromDocument(nsIContent* aElement) = 0;
 
   /**
-   * Attach a XUL template builder to the specified content node.
-   * @param aBuilder the template builder to attach, or null if
-   *   the builder is to be removed.
-   */
-  NS_IMETHOD SetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder* aBuilder) = 0;
-
-  /**
-   * Retrieve the XUL template builder that's attached to a content
-   * node.
-   */
-  NS_IMETHOD GetTemplateBuilderFor(nsIContent* aContent, nsIXULTemplateBuilder** aResult) = 0;
-
-  /**
    * This is invoked whenever the prototype for this document is loaded
    * and should be walked, regardless of whether the XUL cache is
    * disabled, whether the protototype was loaded, whether the
    * prototype was loaded from the cache or created by parsing the
    * actual XUL source, etc.
    *
    * @param aResumeWalk whether this should also call ResumeWalk().
    * Sometimes the caller of OnPrototypeLoadDone resumes the walk itself
rename from dom/xul/templates/nsIXULSortService.idl
rename to dom/xul/nsIXULSortService.idl
rename from dom/xul/templates/nsXULContentUtils.cpp
rename to dom/xul/nsXULContentUtils.cpp
--- a/dom/xul/templates/nsXULContentUtils.cpp
+++ b/dom/xul/nsXULContentUtils.cpp
@@ -8,101 +8,60 @@
 /*
 
   A package of routines shared by the XUL content code.
 
  */
 
 #include "mozilla/ArrayUtils.h"
 
-#include "DateTimeFormat.h"
+#include "nsCollationCID.h"
 #include "nsCOMPtr.h"
 #include "nsIContent.h"
+#include "nsICollation.h"
 #include "nsIDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMXULCommandDispatcher.h"
 #include "nsIDOMXULDocument.h"
-#include "nsIRDFNode.h"
 #include "nsIRDFService.h"
 #include "nsIServiceManager.h"
-#include "nsIURL.h"
 #include "nsXULContentUtils.h"
 #include "nsLayoutCID.h"
-#include "nsNameSpaceManager.h"
 #include "nsRDFCID.h"
 #include "nsString.h"
 #include "nsGkAtoms.h"
-#include "mozilla/Logging.h"
-#include "prtime.h"
-#include "rdf.h"
-#include "nsContentUtils.h"
-#include "nsICollation.h"
-#include "nsCollationCID.h"
-#include "nsIConsoleService.h"
-#include "nsEscape.h"
 
 using namespace mozilla;
 
 //------------------------------------------------------------------------
 
 nsIRDFService* nsXULContentUtils::gRDF;
 nsICollation *nsXULContentUtils::gCollation;
 
-extern LazyLogModule gXULTemplateLog;
-
-#define XUL_RESOURCE(ident, uri) nsIRDFResource* nsXULContentUtils::ident
-#define XUL_LITERAL(ident, val) nsIRDFLiteral* nsXULContentUtils::ident
-#include "nsXULResourceList.h"
-#undef XUL_RESOURCE
-#undef XUL_LITERAL
-
 //------------------------------------------------------------------------
 // Constructors n' stuff
 //
 
 nsresult
 nsXULContentUtils::Init()
 {
     static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
     nsresult rv = CallGetService(kRDFServiceCID, &gRDF);
     if (NS_FAILED(rv)) {
         return rv;
     }
 
-#define XUL_RESOURCE(ident, uri)                              \
-  PR_BEGIN_MACRO                                              \
-   rv = gRDF->GetResource(NS_LITERAL_CSTRING(uri), &(ident)); \
-   if (NS_FAILED(rv)) return rv;                              \
-  PR_END_MACRO
-
-#define XUL_LITERAL(ident, val)                                   \
-  PR_BEGIN_MACRO                                                  \
-   rv = gRDF->GetLiteral(val, &(ident));                          \
-   if (NS_FAILED(rv)) return rv;                                  \
-  PR_END_MACRO
-
-#include "nsXULResourceList.h"
-#undef XUL_RESOURCE
-#undef XUL_LITERAL
-
     return NS_OK;
 }
 
 
 nsresult
 nsXULContentUtils::Finish()
 {
     NS_IF_RELEASE(gRDF);
-
-#define XUL_RESOURCE(ident, uri) NS_IF_RELEASE(ident)
-#define XUL_LITERAL(ident, val) NS_IF_RELEASE(ident)
-#include "nsXULResourceList.h"
-#undef XUL_RESOURCE
-#undef XUL_LITERAL
-
     NS_IF_RELEASE(gCollation);
 
     return NS_OK;
 }
 
 nsICollation*
 nsXULContentUtils::GetCollation()
 {
@@ -115,17 +74,19 @@ nsXULContentUtils::GetCollation()
                          "couldn't create collation instance");
         } else
             NS_ERROR("couldn't create instance of collation factory");
     }
 
     return gCollation;
 }
 
+
 //------------------------------------------------------------------------
+//
 
 nsresult
 nsXULContentUtils::FindChildByTag(nsIContent* aElement,
                                   int32_t aNameSpaceID,
                                   nsAtom* aTag,
                                   Element** aResult)
 {
     for (nsIContent* child = aElement->GetFirstChild();
@@ -138,133 +99,16 @@ nsXULContentUtils::FindChildByTag(nsICon
             return NS_OK;
         }
     }
 
     *aResult = nullptr;
     return NS_RDF_NO_VALUE; // not found
 }
 
-
-/*
-	Note: this routine is similar, yet distinctly different from, nsBookmarksService::GetTextForNode
-*/
-
-nsresult
-nsXULContentUtils::GetTextForNode(nsIRDFNode* aNode, nsAString& aResult)
-{
-    if (! aNode) {
-        aResult.Truncate();
-        return NS_OK;
-    }
-
-    nsresult rv;
-
-    // Literals are the most common, so try these first.
-    nsCOMPtr<nsIRDFLiteral> literal = do_QueryInterface(aNode);
-    if (literal) {
-        const char16_t* p;
-        rv = literal->GetValueConst(&p);
-        if (NS_FAILED(rv)) return rv;
-
-        aResult = p;
-        return NS_OK;
-    }
-
-    nsCOMPtr<nsIRDFDate> dateLiteral = do_QueryInterface(aNode);
-    if (dateLiteral) {
-        PRTime value;
-        rv = dateLiteral->GetValue(&value);
-        if (NS_FAILED(rv)) return rv;
-
-        nsAutoString str;
-        rv = DateTimeFormat::FormatPRTime(kDateFormatShort,
-                                          kTimeFormatSeconds,
-                                          value,
-                                          str);
-
-        aResult.Assign(str);
-
-        if (NS_FAILED(rv)) return rv;
-
-        return NS_OK;
-    }
-
-    nsCOMPtr<nsIRDFInt> intLiteral = do_QueryInterface(aNode);
-    if (intLiteral) {
-        int32_t	value;
-        rv = intLiteral->GetValue(&value);
-        if (NS_FAILED(rv)) return rv;
-
-        aResult.Truncate();
-        nsAutoString intStr;
-        intStr.AppendInt(value, 10);
-        aResult.Append(intStr);
-        return NS_OK;
-    }
-
-
-    nsCOMPtr<nsIRDFResource> resource = do_QueryInterface(aNode);
-    if (resource) {
-        const char* p;
-        rv = resource->GetValueConst(&p);
-        if (NS_FAILED(rv)) return rv;
-        CopyUTF8toUTF16(p, aResult);
-        return NS_OK;
-    }
-
-    NS_ERROR("not a resource or a literal");
-    return NS_ERROR_UNEXPECTED;
-}
-
-nsresult
-nsXULContentUtils::GetResource(int32_t aNameSpaceID, nsAtom* aAttribute, nsIRDFResource** aResult)
-{
-    // construct a fully-qualified URI from the namespace/tag pair.
-    NS_PRECONDITION(aAttribute != nullptr, "null ptr");
-    if (! aAttribute)
-        return NS_ERROR_NULL_POINTER;
-
-    return GetResource(aNameSpaceID, nsDependentAtomString(aAttribute),
-                       aResult);
-}
-
-
-nsresult
-nsXULContentUtils::GetResource(int32_t aNameSpaceID, const nsAString& aAttribute, nsIRDFResource** aResult)
-{
-    // construct a fully-qualified URI from the namespace/tag pair.
-
-    // XXX should we allow nodes with no namespace???
-    //NS_PRECONDITION(aNameSpaceID != kNameSpaceID_Unknown, "no namespace");
-    //if (aNameSpaceID == kNameSpaceID_Unknown)
-    //    return NS_ERROR_UNEXPECTED;
-
-    nsresult rv;
-
-    nsAutoStringN<256> uri;
-    if (aNameSpaceID != kNameSpaceID_Unknown && aNameSpaceID != kNameSpaceID_None) {
-        rv = nsContentUtils::NameSpaceManager()->GetNameSpaceURI(aNameSpaceID, uri);
-        // XXX ignore failure; treat as "no namespace"
-    }
-
-    // XXX check to see if we need to insert a '/' or a '#'. Oy.
-    if (!uri.IsEmpty()  && uri.Last() != '#' && uri.Last() != '/' && aAttribute.First() != '#')
-        uri.Append(char16_t('#'));
-
-    uri.Append(aAttribute);
-
-    rv = gRDF->GetUnicodeResource(uri, aResult);
-    NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get resource");
-    if (NS_FAILED(rv)) return rv;
-
-    return NS_OK;
-}
-
-
 nsresult
 nsXULContentUtils::SetCommandUpdater(nsIDocument* aDocument, Element* aElement)
 {
     // Deal with setting up a 'commandupdater'. Pulls the 'events' and
     // 'targets' attributes off of aElement, and adds it to the
     // document's command dispatcher.
     NS_PRECONDITION(aDocument != nullptr, "null ptr");
     if (! aDocument)
@@ -307,21 +151,8 @@ nsXULContentUtils::SetCommandUpdater(nsI
         return NS_ERROR_UNEXPECTED;
 
     rv = dispatcher->AddCommandUpdater(domelement, events, targets);
     if (NS_FAILED(rv)) return rv;
 
     return NS_OK;
 }
 
-void
-nsXULContentUtils::LogTemplateError(const char* aStr)
-{
-  nsAutoString message;
-  message.AssignLiteral("Error parsing template: ");
-  message.Append(NS_ConvertUTF8toUTF16(aStr).get());
-
-  nsCOMPtr<nsIConsoleService> cs = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
-  if (cs) {
-    cs->LogStringMessage(message.get());
-    MOZ_LOG(gXULTemplateLog, LogLevel::Info, ("Error parsing template: %s", aStr));
-  }
-}
rename from dom/xul/templates/nsXULContentUtils.h
rename to dom/xul/nsXULContentUtils.h
--- a/dom/xul/templates/nsXULContentUtils.h
+++ b/dom/xul/nsXULContentUtils.h
@@ -10,88 +10,27 @@
  */
 
 #ifndef nsXULContentUtils_h__
 #define nsXULContentUtils_h__
 
 #include "nsISupports.h"
 
 class nsAtom;
+class nsICollation;
 class nsIContent;
 class nsIDocument;
-class nsIRDFNode;
-class nsIRDFResource;
-class nsIRDFLiteral;
 class nsIRDFService;
-class nsICollation;
 
 namespace mozilla {
 namespace dom {
 class Element;
 }
 }
 
-// errors to pass to LogTemplateError
-#define ERROR_TEMPLATE_INVALID_QUERYPROCESSOR                           \
-        "querytype attribute doesn't specify a valid query processor"
-#define ERROR_TEMPLATE_INVALID_QUERYSET                                 \
-        "unexpected <queryset> element"
-#define ERROR_TEMPLATE_NO_MEMBERVAR                                     \
-        "no member variable found. Action body should have an element with uri attribute"
-#define ERROR_TEMPLATE_WHERE_NO_SUBJECT                                 \
-        "<where> element is missing a subject attribute"
-#define ERROR_TEMPLATE_WHERE_NO_RELATION                                \
-        "<where> element is missing a rel attribute"
-#define ERROR_TEMPLATE_WHERE_NO_VALUE                                   \
-        "<where> element is missing a value attribute"
-#define ERROR_TEMPLATE_WHERE_NO_VAR                                     \
-        "<where> element must have at least one variable as a subject or value"
-#define ERROR_TEMPLATE_BINDING_BAD_SUBJECT                              \
-        "<binding> requires a variable for its subject attribute"
-#define ERROR_TEMPLATE_BINDING_BAD_PREDICATE                            \
-        "<binding> element is missing a predicate attribute"
-#define ERROR_TEMPLATE_BINDING_BAD_OBJECT                               \
-        "<binding> requires a variable for its object attribute"
-#define ERROR_TEMPLATE_CONTENT_NOT_FIRST                                \
-        "expected <content> to be first"
-#define ERROR_TEMPLATE_MEMBER_NOCONTAINERVAR                            \
-        "<member> requires a variable for its container attribute"
-#define ERROR_TEMPLATE_MEMBER_NOCHILDVAR                                \
-        "<member> requires a variable for its child attribute"
-#define ERROR_TEMPLATE_TRIPLE_NO_VAR                                    \
-        "<triple> should have at least one variable as a subject or object"
-#define ERROR_TEMPLATE_TRIPLE_BAD_SUBJECT                               \
-        "<triple> requires a variable for its subject attribute"
-#define ERROR_TEMPLATE_TRIPLE_BAD_PREDICATE                             \
-        "<triple> should have a non-variable value as a predicate"
-#define ERROR_TEMPLATE_TRIPLE_BAD_OBJECT                                \
-        "<triple> requires a variable for its object attribute"
-#define ERROR_TEMPLATE_MEMBER_UNBOUND                                   \
-        "neither container or child variables of <member> has a value"
-#define ERROR_TEMPLATE_TRIPLE_UNBOUND                                   \
-        "neither subject or object variables of <triple> has a value"
-#define ERROR_TEMPLATE_BAD_XPATH                                        \
-        "XPath expression in query could not be parsed"
-#define ERROR_TEMPLATE_BAD_ASSIGN_XPATH                                 \
-        "XPath expression in <assign> could not be parsed"
-#define ERROR_TEMPLATE_BAD_BINDING_XPATH                                \
-        "XPath expression in <binding> could not be parsed"
-#define ERROR_TEMPLATE_STORAGE_BAD_URI                                  \
-        "only profile: or file URI are allowed"
-#define ERROR_TEMPLATE_STORAGE_CANNOT_OPEN_DATABASE                     \
-        "cannot open given database"
-#define ERROR_TEMPLATE_STORAGE_BAD_QUERY                                \
-        "syntax error in the SQL query"
-#define ERROR_TEMPLATE_STORAGE_UNKNOWN_QUERY_PARAMETER                   \
-        "the given named parameter is unknown in the SQL query"
-#define ERROR_TEMPLATE_STORAGE_WRONG_TYPE_QUERY_PARAMETER               \
-        "the type of a query parameter is wrong"
-#define ERROR_TEMPLATE_STORAGE_QUERY_PARAMETER_NOT_BOUND                \
-        "a query parameter cannot be bound to the SQL query"
-
 class nsXULContentUtils
 {
 protected:
     static nsIRDFService* gRDF;
     static nsICollation *gCollation;
 
     static bool gDisableXULCache;
 
@@ -107,47 +46,21 @@ public:
 
     static nsresult
     FindChildByTag(nsIContent *aElement,
                    int32_t aNameSpaceID,
                    nsAtom* aTag,
                    mozilla::dom::Element** aResult);
 
     static nsresult
-    FindChildByResource(nsIContent* aElement,
-                        nsIRDFResource* aResource,
-                        nsIContent** aResult);
-
-    static nsresult
-    GetTextForNode(nsIRDFNode* aNode, nsAString& aResult);
-
-    static nsresult
-    GetResource(int32_t aNameSpaceID, nsAtom* aAttribute, nsIRDFResource** aResult);
-
-    static nsresult
-    GetResource(int32_t aNameSpaceID, const nsAString& aAttribute, nsIRDFResource** aResult);
-
-    static nsresult
     SetCommandUpdater(nsIDocument* aDocument, mozilla::dom::Element* aElement);
 
-    /**
-     * Log a message to the error console
-     */
-    static void
-    LogTemplateError(const char* aMsg);
-
     static nsIRDFService*
     RDFService()
     {
         return gRDF;
     }
 
     static nsICollation*
     GetCollation();
-
-#define XUL_RESOURCE(ident, uri) static nsIRDFResource* ident
-#define XUL_LITERAL(ident, val)  static nsIRDFLiteral*  ident
-#include "nsXULResourceList.h"
-#undef XUL_RESOURCE
-#undef XUL_LITERAL
 };
 
 #endif // nsXULContentUtils_h__
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -28,33 +28,28 @@
 #include "mozilla/DeclarationBlockInlines.h"
 #include "nsFocusManager.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsNameSpaceManager.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIPresShell.h"
 #include "nsIPrincipal.h"
-#include "nsIRDFCompositeDataSource.h"
-#include "nsIRDFNode.h"
-#include "nsIRDFService.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptError.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIServiceManager.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsIURL.h"
 #include "nsViewManager.h"
 #include "nsIWidget.h"
 #include "nsIXULDocument.h"
-#include "nsIXULTemplateBuilder.h"
 #include "nsLayoutCID.h"
 #include "nsContentCID.h"
 #include "mozilla/dom/Event.h"
-#include "nsRDFCID.h"
 #include "nsStyleConsts.h"
 #include "nsString.h"
 #include "nsXULControllers.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "XULDocument.h"
 #include "nsXULPopupListener.h"
 #include "nsRuleWalker.h"
@@ -65,21 +60,19 @@
 #include "nsContentList.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/MouseEvents.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsJSPrincipals.h"
 #include "nsDOMAttributeMap.h"
 #include "nsGkAtoms.h"
-#include "nsXULContentUtils.h"
 #include "nsNodeUtils.h"
 #include "nsFrameLoader.h"
 #include "mozilla/Logging.h"
-#include "rdf.h"
 #include "nsIControllers.h"
 #include "nsAttrValueOrString.h"
 #include "nsAttrValueInlines.h"
 #include "mozilla/Attributes.h"
 #include "nsIController.h"
 #include "nsQueryObject.h"
 #include <algorithm>
 #include "nsIDOMChromeWindow.h"
@@ -327,21 +320,16 @@ nsXULElement::Clone(mozilla::dom::NodeIn
 
     RefPtr<mozilla::dom::NodeInfo> ni = aNodeInfo;
     RefPtr<nsXULElement> element = new nsXULElement(ni.forget());
 
     nsresult rv = element->mAttrsAndChildren.EnsureCapacityToClone(mAttrsAndChildren,
                                                                    aPreallocateChildren);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    // XXX TODO: set up RDF generic builder n' stuff if there is a
-    // 'datasources' attribute? This is really kind of tricky,
-    // because then we'd need to -selectively- copy children that
-    // -weren't- generated from RDF. Ugh. Forget it.
-
     // Note that we're _not_ copying mControllers.
 
     uint32_t count = mAttrsAndChildren.AttrCount();
     rv = NS_OK;
     for (uint32_t i = 0; i < count; ++i) {
         const nsAttrName* originalName = mAttrsAndChildren.AttrNameAt(i);
         const nsAttrValue* originalValue = mAttrsAndChildren.AttrAt(i);
         nsAttrValue attrValue;
@@ -1331,64 +1319,16 @@ nsXULElement::PreHandleEvent(EventChainV
         nsAutoString command;
         GetAttr(kNameSpaceID_None, nsGkAtoms::command, command);
         MOZ_ASSERT(!command.IsEmpty());
         return DispatchXULCommand(aVisitor, command);
     }
     return nsStyledElement::PreHandleEvent(aVisitor);
 }
 
-// XXX This _should_ be an implementation method, _not_ publicly exposed :-(
-already_AddRefed<nsIRDFResource>
-nsXULElement::GetResource(ErrorResult& rv)
-{
-    nsAutoString id;
-    GetAttr(kNameSpaceID_None, nsGkAtoms::ref, id);
-    if (id.IsEmpty()) {
-        GetAttr(kNameSpaceID_None, nsGkAtoms::id, id);
-    }
-
-    if (id.IsEmpty()) {
-        return nullptr;
-    }
-
-    nsCOMPtr<nsIRDFResource> resource;
-    rv = nsXULContentUtils::RDFService()->
-        GetUnicodeResource(id, getter_AddRefs(resource));
-    return resource.forget();
-}
-
-already_AddRefed<nsIRDFCompositeDataSource>
-nsXULElement::GetDatabase()
-{
-    nsCOMPtr<nsIXULTemplateBuilder> builder = GetBuilder();
-    if (!builder) {
-        return nullptr;
-    }
-
-    nsCOMPtr<nsIRDFCompositeDataSource> database;
-    builder->GetDatabase(getter_AddRefs(database));
-    return database.forget();
-}
-
-
-already_AddRefed<nsIXULTemplateBuilder>
-nsXULElement::GetBuilder()
-{
-    // XXX sXBL/XBL2 issue! Owner or current document?
-    nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(GetUncomposedDoc());
-    if (!xuldoc) {
-        return nullptr;
-    }
-
-    nsCOMPtr<nsIXULTemplateBuilder> builder;
-    xuldoc->GetTemplateBuilderFor(this, getter_AddRefs(builder));
-    return builder.forget();
-}
-
 //----------------------------------------------------------------------
 // Implementation methods
 
 NS_IMETHODIMP
 nsXULElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
 {
     return NS_OK;
 }
--- a/dom/xul/nsXULElement.h
+++ b/dom/xul/nsXULElement.h
@@ -17,20 +17,17 @@
 #include "nsIDOMEvent.h"
 #include "nsIServiceManager.h"
 #include "nsAtom.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "nsIControllers.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMXULElement.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
-#include "nsIRDFCompositeDataSource.h"
-#include "nsIRDFResource.h"
 #include "nsIURI.h"
-#include "nsIXULTemplateBuilder.h"
 #include "nsLayoutCID.h"
 #include "nsAttrAndChildArray.h"
 #include "nsGkAtoms.h"
 #include "nsStringFwd.h"
 #include "nsStyledElement.h"
 #include "nsIFrameLoader.h"
 #include "nsFrameLoader.h" // Needed because we return an
                            // already_AddRefed<nsFrameLoader> where bindings
@@ -328,22 +325,21 @@ public:
   The XUL element.
 
  */
 
 #define XUL_ELEMENT_FLAG_BIT(n_) NODE_FLAG_BIT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + (n_))
 
 // XUL element specific bits
 enum {
-  XUL_ELEMENT_TEMPLATE_GENERATED =        XUL_ELEMENT_FLAG_BIT(0),
-  XUL_ELEMENT_HAS_CONTENTMENU_LISTENER =  XUL_ELEMENT_FLAG_BIT(1),
-  XUL_ELEMENT_HAS_POPUP_LISTENER =        XUL_ELEMENT_FLAG_BIT(2)
+  XUL_ELEMENT_HAS_CONTENTMENU_LISTENER =  XUL_ELEMENT_FLAG_BIT(0),
+  XUL_ELEMENT_HAS_POPUP_LISTENER =        XUL_ELEMENT_FLAG_BIT(1)
 };
 
-ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 3);
+ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 2);
 
 #undef XUL_ELEMENT_FLAG_BIT
 
 class nsXULElement final : public nsStyledElement,
                            public nsIDOMXULElement
 {
 public:
     using Element::Blur;
@@ -392,25 +388,16 @@ public:
     virtual bool IsNodeOfType(uint32_t aFlags) const override;
     virtual bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) override;
 
     NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
     virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute,
                                                 int32_t aModType) const override;
     NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
 
-    // XUL element methods
-    /**
-     * The template-generated flag is used to indicate that a
-     * template-generated element has already had its children generated.
-     */
-    void SetTemplateGenerated() { SetFlags(XUL_ELEMENT_TEMPLATE_GENERATED); }
-    void ClearTemplateGenerated() { UnsetFlags(XUL_ELEMENT_TEMPLATE_GENERATED); }
-    bool GetTemplateGenerated() { return HasFlag(XUL_ELEMENT_TEMPLATE_GENERATED); }
-
     // nsIDOMNode
     NS_FORWARD_NSIDOMNODE_TO_NSINODE
     // And since that shadowed GetParentElement with the XPCOM
     // signature, pull in the one we care about.
     using nsStyledElement::GetParentElement;
 
     // nsIDOMElement
     NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
@@ -631,24 +618,16 @@ public:
     void GetTop(DOMString& aValue) const
     {
         GetXULAttr(nsGkAtoms::top, aValue);
     }
     void SetTop(const nsAString& aValue, mozilla::ErrorResult& rv)
     {
         SetXULAttr(nsGkAtoms::top, aValue, rv);
     }
-    void GetDatasources(DOMString& aValue) const
-    {
-        GetXULAttr(nsGkAtoms::datasources, aValue);
-    }
-    void SetDatasources(const nsAString& aValue, mozilla::ErrorResult& rv)
-    {
-        SetXULAttr(nsGkAtoms::datasources, aValue, rv);
-    }
     void GetRef(DOMString& aValue) const
     {
         GetXULAttr(nsGkAtoms::ref, aValue);
     }
     void SetRef(const nsAString& aValue, mozilla::ErrorResult& rv)
     {
         SetXULAttr(nsGkAtoms::ref, aValue, rv);
     }
@@ -679,19 +658,16 @@ public:
     bool AllowEvents() const
     {
         return BoolAttrIsTrue(nsGkAtoms::allowevents);
     }
     void SetAllowEvents(bool aAllowEvents)
     {
         SetXULBoolAttr(nsGkAtoms::allowevents, aAllowEvents);
     }
-    already_AddRefed<nsIRDFCompositeDataSource> GetDatabase();
-    already_AddRefed<nsIXULTemplateBuilder> GetBuilder();
-    already_AddRefed<nsIRDFResource> GetResource(mozilla::ErrorResult& rv);
     nsIControllers* GetControllers(mozilla::ErrorResult& rv);
     // Note: this can only fail if the do_CreateInstance for the boxobject
     // contact fails for some reason.
     already_AddRefed<mozilla::dom::BoxObject> GetBoxObject(mozilla::ErrorResult& rv);
     void Click(mozilla::dom::CallerType aCallerType);
     void DoCommand();
     already_AddRefed<nsINodeList>
       GetElementsByAttribute(const nsAString& aAttribute,
rename from dom/xul/templates/nsXULSortService.cpp
rename to dom/xul/nsXULSortService.cpp
--- a/dom/xul/templates/nsXULSortService.cpp
+++ b/dom/xul/nsXULSortService.cpp
@@ -15,18 +15,16 @@
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
 #include "nsXULContentUtils.h"
 #include "nsString.h"
 #include "nsQuickSort.h"
 #include "nsWhitespaceTokenizer.h"
 #include "nsXULSortService.h"
 #include "nsXULElement.h"
-#include "nsIXULTemplateBuilder.h"
-#include "nsTemplateMatch.h"
 #include "nsICollation.h"
 #include "nsUnicharUtils.h"
 
 NS_IMPL_ISUPPORTS(XULSortServiceImpl, nsIXULSortService)
 
 void
 XULSortServiceImpl::SetSortHints(Element* aElement, nsSortState* aSortState)
 {
@@ -62,19 +60,16 @@ XULSortServiceImpl::SetSortColumnHints(n
   for (nsIContent* child = content->GetFirstChild();
        child;
        child = child->GetNextSibling()) {
     if (child->IsXULElement(nsGkAtoms::treecols)) {
       SetSortColumnHints(child, sortResource, sortDirection);
     } else if (child->IsXULElement(nsGkAtoms::treecol)) {
       nsAutoString value;
       child->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::sort, value);
-      // also check the resource attribute for older code
-      if (value.IsEmpty())
-        child->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::resource, value);
       if (value == sortResource) {
         child->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::sortActive,
                                     NS_LITERAL_STRING("true"), true);
 
         child->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::sortDirection,
                                     sortDirection, true);
         // Note: don't break out of loop; want to set/unset
         // attribs on ALL sort columns
@@ -88,33 +83,18 @@ XULSortServiceImpl::SetSortColumnHints(n
   }
 }
 
 nsresult
 XULSortServiceImpl::GetItemsToSort(nsIContent *aContainer,
                                    nsSortState* aSortState,
                                    nsTArray<contentSortInfo>& aSortItems)
 {
-  // if there is a template attached to the sort node, use the builder to get
-  // the items to be sorted
-  RefPtr<nsXULElement> element = nsXULElement::FromContent(aContainer);
-  if (element) {
-    nsCOMPtr<nsIXULTemplateBuilder> builder = element->GetBuilder();
-
-    if (builder) {
-      nsresult rv = builder->GetQueryProcessor(getter_AddRefs(aSortState->processor));
-      if (NS_FAILED(rv) || !aSortState->processor)
-        return rv;
-
-      return GetTemplateItemsToSort(aContainer, builder, aSortState, aSortItems);
-    }
-  }
-
-  // if there is no template builder, just get the children. For trees,
-  // get the treechildren element as use that as the parent
+  // Get the children. For trees, get the treechildren element and
+  // use that as the parent
   RefPtr<Element> treechildren;
   if (aContainer->NodeInfo()->Equals(nsGkAtoms::tree, kNameSpaceID_XUL)) {
     nsXULContentUtils::FindChildByTag(aContainer,
                                       kNameSpaceID_XUL,
                                       nsGkAtoms::treechildren,
                                       getter_AddRefs(treechildren));
     if (!treechildren)
       return NS_OK;
@@ -131,90 +111,41 @@ XULSortServiceImpl::GetItemsToSort(nsICo
 
     cinfo->content = child;
   }
 
   return NS_OK;
 }
 
 
-nsresult
-XULSortServiceImpl::GetTemplateItemsToSort(nsIContent* aContainer,
-                                           nsIXULTemplateBuilder* aBuilder,
-                                           nsSortState* aSortState,
-                                           nsTArray<contentSortInfo>& aSortItems)
-{
-  for (nsIContent* child = aContainer->GetFirstChild();
-       child;
-       child = child->GetNextSibling()) {
-
-    nsCOMPtr<nsIDOMElement> childnode = do_QueryInterface(child);
-
-    nsCOMPtr<nsIXULTemplateResult> result;
-    nsresult rv = aBuilder->GetResultForContent(childnode, getter_AddRefs(result));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (result) {
-      contentSortInfo* cinfo = aSortItems.AppendElement();
-      if (!cinfo)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-      cinfo->content = child;
-      cinfo->result = result;
-    }
-    else if (!aContainer->IsXULElement(nsGkAtoms::_template)) {
-      rv = GetTemplateItemsToSort(child, aBuilder, aSortState, aSortItems);
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
-  }
-
-  return NS_OK;
-}
-
 int
 testSortCallback(const void *data1, const void *data2, void *privateData)
 {
   /// Note: testSortCallback is a small C callback stub for NS_QuickSort
   contentSortInfo *left = (contentSortInfo *)data1;
   contentSortInfo *right = (contentSortInfo *)data2;
   nsSortState* sortState = (nsSortState *)privateData;
 
   int32_t sortOrder = 0;
 
-  if (sortState->direction == nsSortState_natural && sortState->processor) {
-    // sort in natural order
-    sortState->processor->CompareResults(left->result, right->result,
-                                         nullptr, sortState->sortHints, &sortOrder);
-  }
-  else {
-    int32_t length = sortState->sortKeys.Length();
-    for (int32_t t = 0; t < length; t++) {
-      // for templates, use the query processor to do sorting
-      if (sortState->processor) {
-        sortState->processor->CompareResults(left->result, right->result,
-                                             sortState->sortKeys[t],
-                                             sortState->sortHints, &sortOrder);
-        if (sortOrder)
-          break;
-      } else {
-        // no template, so just compare attributes. Ignore namespaces for now.
-        nsAutoString leftstr, rightstr;
-        if (left->content->IsElement()) {
-          left->content->AsElement()->GetAttr(kNameSpaceID_None,
-                                              sortState->sortKeys[t],
-                                              leftstr);
-        }
-        if (right->content->IsElement()) {
-          right->content->AsElement()->GetAttr(kNameSpaceID_None,
-                                               sortState->sortKeys[t], rightstr);
-        }
+  int32_t length = sortState->sortKeys.Length();
+  for (int32_t t = 0; t < length; t++) {
+    // compare attributes. Ignore namespaces for now.
+    nsAutoString leftstr, rightstr;
+    if (left->content->IsElement()) {
+      left->content->AsElement()->GetAttr(kNameSpaceID_None,
+                                          sortState->sortKeys[t],
+                                          leftstr);
+    }
+    if (right->content->IsElement()) {
+      right->content->AsElement()->GetAttr(kNameSpaceID_None,
+                                           sortState->sortKeys[t], rightstr);
+    }
 
-        sortOrder = XULSortServiceImpl::CompareValues(leftstr, rightstr, sortState->sortHints);
-      }
-    }
+    sortOrder = XULSortServiceImpl::CompareValues(leftstr, rightstr, sortState->sortHints);
   }
 
   if (sortState->direction == nsSortState_descending)
     sortOrder = -sortOrder;
 
   return sortOrder;
 }
 
@@ -226,51 +157,23 @@ XULSortServiceImpl::SortContainer(nsICon
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t numResults = items.Length();
   if (!numResults)
     return NS_OK;
 
   uint32_t i;
 
-  // inbetweenSeparatorSort sorts the items between separators independently
-  if (aSortState->inbetweenSeparatorSort) {
-    uint32_t startIndex = 0;
-    for (i = 0; i < numResults; i++) {
-      if (i > startIndex + 1) {
-        nsAutoString type;
-        items[i].result->GetType(type);
-        if (type.EqualsLiteral("separator")) {
-          if (aSortState->invertSort)
-            InvertSortInfo(items, startIndex, i - startIndex);
-          else
-            NS_QuickSort((void *)(items.Elements() + startIndex), i - startIndex,
-                         sizeof(contentSortInfo), testSortCallback, (void*)aSortState);
-
-          startIndex = i + 1;
-        }
-      }
-    }
-
-    if (i > startIndex + 1) {
-      if (aSortState->invertSort)
-        InvertSortInfo(items, startIndex, i - startIndex);
-      else
-        NS_QuickSort((void *)(items.Elements() + startIndex), i - startIndex,
-                     sizeof(contentSortInfo), testSortCallback, (void*)aSortState);
-    }
-  } else {
-    // if the items are just being inverted, that is, just switching between
-    // ascending and descending, just reverse the list.
-    if (aSortState->invertSort)
-      InvertSortInfo(items, 0, numResults);
-    else
-      NS_QuickSort((void *)items.Elements(), numResults,
-                   sizeof(contentSortInfo), testSortCallback, (void*)aSortState);
-  }
+  // if the items are just being inverted, that is, just switching between
+  // ascending and descending, just reverse the list.
+  if (aSortState->invertSort)
+    InvertSortInfo(items, 0, numResults);
+  else
+    NS_QuickSort((void *)items.Elements(), numResults,
+                 sizeof(contentSortInfo), testSortCallback, (void*)aSortState);
 
   // first remove the items from the old positions
   for (i = 0; i < numResults; i++) {
     nsIContent* child = items[i].content;
     nsIContent* parent = child->GetParent();
 
     if (parent) {
       // remember the parent so that it can be reinserted back
@@ -340,56 +243,33 @@ XULSortServiceImpl::InitializeSortState(
 {
   // used as an optimization for the content builder
   if (aContainer != aSortState->lastContainer.get()) {
     aSortState->lastContainer = aContainer;
     aSortState->lastWasFirst = false;
     aSortState->lastWasLast = false;
   }
 
-  // The attributes allowed are either:
-  //    sort="key1 key2 ..."
-  // or sortResource="key1" sortResource2="key2"
-  // The latter is for backwards compatibility, and is equivalent to concatenating
-  // both values in the sort attribute
+  // The sort attribute is of the form: sort="key1 key2 ..."
   nsAutoString sort(aSortKey);
   aSortState->sortKeys.Clear();
-  if (sort.IsEmpty()) {
-    nsAutoString sortResource, sortResource2;
-    aRootElement->GetAttr(kNameSpaceID_None, nsGkAtoms::sortResource, sortResource);
-    if (!sortResource.IsEmpty()) {
-      RefPtr<nsAtom> sortkeyatom = NS_Atomize(sortResource);
-      aSortState->sortKeys.AppendElement(sortkeyatom);
-      sort.Append(sortResource);
-
-      aRootElement->GetAttr(kNameSpaceID_None, nsGkAtoms::sortResource2, sortResource2);
-      if (!sortResource2.IsEmpty()) {
-        RefPtr<nsAtom> sortkeyatom2 = NS_Atomize(sortResource2);
-        aSortState->sortKeys.AppendElement(sortkeyatom2);
-        sort.Append(' ');
-        sort.Append(sortResource2);
-      }
-    }
-  }
-  else {
-    nsWhitespaceTokenizer tokenizer(sort);
-    while (tokenizer.hasMoreTokens()) {
-      RefPtr<nsAtom> keyatom = NS_Atomize(tokenizer.nextToken());
-      NS_ENSURE_TRUE(keyatom, NS_ERROR_OUT_OF_MEMORY);
-      aSortState->sortKeys.AppendElement(keyatom);
-    }
+  nsWhitespaceTokenizer tokenizer(sort);
+  while (tokenizer.hasMoreTokens()) {
+    RefPtr<nsAtom> keyatom = NS_Atomize(tokenizer.nextToken());
+    NS_ENSURE_TRUE(keyatom, NS_ERROR_OUT_OF_MEMORY);
+    aSortState->sortKeys.AppendElement(keyatom);
   }
 
   aSortState->sort.Assign(sort);
   aSortState->direction = nsSortState_natural;
 
   bool noNaturalState = false;
-  nsWhitespaceTokenizer tokenizer(aSortHints);
-  while (tokenizer.hasMoreTokens()) {
-    const nsDependentSubstring& token(tokenizer.nextToken());
+  nsWhitespaceTokenizer hintsTokenizer(aSortHints);
+  while (hintsTokenizer.hasMoreTokens()) {
+    const nsDependentSubstring& token(hintsTokenizer.nextToken());
     if (token.EqualsLiteral("comparecase"))
       aSortState->sortHints |= nsIXULSortService::SORT_COMPARECASE;
     else if (token.EqualsLiteral("integer"))
       aSortState->sortHints |= nsIXULSortService::SORT_INTEGER;
     else if (token.EqualsLiteral("descending"))
       aSortState->direction = nsSortState_descending;
     else if (token.EqualsLiteral("ascending"))
       aSortState->direction = nsSortState_ascending;
@@ -418,26 +298,16 @@ XULSortServiceImpl::InitializeSortState(
         aSortState->invertSort = true;
     }
     else if (aSortState->direction == nsSortState_ascending &&
              existingsortDirection.EqualsLiteral("descending")) {
       aSortState->invertSort = true;
     }
   }
 
-  // sort items between separators independently
-  aSortState->inbetweenSeparatorSort =
-    aRootElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::sortSeparators,
-                              nsGkAtoms::_true, eCaseMatters);
-
-  // sort static content (non template generated nodes) after generated content
-  aSortState->sortStaticsLast = aRootElement->AttrValueIs(kNameSpaceID_None,
-                                  nsGkAtoms::sortStaticsLast,
-                                  nsGkAtoms::_true, eCaseMatters);
-
   aSortState->initialized = true;
 
   return NS_OK;
 }
 
 int32_t
 XULSortServiceImpl::CompareValues(const nsAString& aLeft,
                                   const nsAString& aRight,
@@ -484,17 +354,16 @@ XULSortServiceImpl::Sort(nsIDOMNode* aNo
   nsresult rv = InitializeSortState(sortNode, sortNode,
                                     aSortKey, aSortHints, &sortState);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // store sort info in attributes on content
   SetSortHints(sortNode, &sortState);
   rv = SortContainer(sortNode, &sortState);
 
-  sortState.processor = nullptr; // don't hang on to this reference
   return rv;
 }
 
 nsresult
 NS_NewXULSortService(nsIXULSortService** sortService)
 {
   *sortService = new XULSortServiceImpl();
   NS_ADDREF(*sortService);
rename from dom/xul/templates/nsXULSortService.h
rename to dom/xul/nsXULSortService.h
--- a/dom/xul/templates/nsXULSortService.h
+++ b/dom/xul/nsXULSortService.h
@@ -1,77 +1,67 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
-  This sort service is used to sort template built content or content by attribute.
+  This sort service is used to sort content by attribute.
  */
 
-#ifndef nsXULTemplateResultSetRDF_h
-#define nsXULTemplateResultSetRDF_h
+#ifndef nsXULSortService_h
+#define nsXULSortService_h
 
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsTArray.h"
 #include "nsIContent.h"
-#include "nsIXULTemplateResult.h"
-#include "nsIXULTemplateQueryProcessor.h"
 #include "nsIXULSortService.h"
 #include "nsCycleCollectionParticipant.h"
 
 enum nsSortState_direction {
   nsSortState_descending,
   nsSortState_ascending,
   nsSortState_natural
 };
 
 // the sort state holds info about the current sort
 struct nsSortState
 {
   bool initialized;
   MOZ_INIT_OUTSIDE_CTOR bool invertSort;
-  MOZ_INIT_OUTSIDE_CTOR bool inbetweenSeparatorSort;
-  MOZ_INIT_OUTSIDE_CTOR bool sortStaticsLast;
-  MOZ_INIT_OUTSIDE_CTOR bool isContainerRDFSeq;
 
   uint32_t sortHints;
 
   MOZ_INIT_OUTSIDE_CTOR nsSortState_direction direction;
   nsAutoString sort;
   nsTArray<RefPtr<nsAtom>> sortKeys;
 
-  nsCOMPtr<nsIXULTemplateQueryProcessor> processor;
   nsCOMPtr<nsIContent> lastContainer;
   MOZ_INIT_OUTSIDE_CTOR bool lastWasFirst, lastWasLast;
 
   nsSortState()
     : initialized(false),
-      isContainerRDFSeq(false),
       sortHints(0)
   {
   }
   void Traverse(nsCycleCollectionTraversalCallback &cb) const
   {
-    cb.NoteXPCOMChild(processor);
     cb.NoteXPCOMChild(lastContainer);
   }
 };
 
 // information about a particular item to be sorted
 struct contentSortInfo {
   nsCOMPtr<nsIContent> content;
   nsCOMPtr<nsIContent> parent;
-  nsCOMPtr<nsIXULTemplateResult> result;
   void swap(contentSortInfo& other)
   {
     content.swap(other.content);
     parent.swap(other.parent);
-    result.swap(other.result);
   }
 };
 
 ////////////////////////////////////////////////////////////////////////
 // ServiceImpl
 //
 //   This is the sort service.
 //
@@ -118,25 +108,16 @@ public:
    *   - otherwise, get the direct children
    */
   nsresult
   GetItemsToSort(nsIContent *aContainer,
                  nsSortState* aSortState,
                  nsTArray<contentSortInfo>& aSortItems);
 
   /**
-   * Get the list of items to sort for template built content
-   */
-  nsresult
-  GetTemplateItemsToSort(nsIContent* aContainer,
-                         nsIXULTemplateBuilder* aBuilder,
-                         nsSortState* aSortState,
-                         nsTArray<contentSortInfo>& aSortItems);
-
-  /**
    * Sort a container using the supplied sort state details.
    */
   nsresult
   SortContainer(nsIContent *aContainer, nsSortState* aSortState);
 
   /**
    * Given a list of sortable items, reverse the list. This is done
    * when simply changing the sort direction for the same key.
@@ -166,9 +147,9 @@ public:
    * Compares aLeft and aRight and returns < 0, 0, or > 0. The sort
    * hints are checked for case matching and integer sorting.
    */
   static int32_t CompareValues(const nsAString& aLeft,
                                const nsAString& aRight,
                                uint32_t aSortHints);
 };
 
-#endif
+#endif // nsXULSortService_h
deleted file mode 100644
--- a/dom/xul/templates/crashtests/257752-1-recursion.rdf
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:m="urn:foo#">
-   <rdf:Seq about="urn:x-rec:1">
-     <rdf:li rdf:resource="urn:x-rec:2"/>
-   </rdf:Seq>
-   <rdf:Seq about="urn:x-rec:2">
-     <rdf:li rdf:resource="urn:x-rec:3"/>
-   </rdf:Seq>
-   <rdf:Seq about="urn:x-rec:3">
-     <rdf:li rdf:resource="urn:x-rec:1"/>
-   </rdf:Seq>
-</rdf:RDF>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/257752-1-recursion.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window id="child-iterate-recurse"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<vbox flex="1" style="overflow: auto;">
-
-<vbox datasources="257752-1-recursion.rdf" ref="urn:x-rec:1">
-  <template>
-    <rule>
-      <conditions>
-          <content uri="?uri"/>
-          <member container="?uri" child="?child"/>
-      </conditions>
-      <action>
-        <vbox uri="?child" style="border: 1px solid grey; margin: 1em;">
-          <label value="hi"/>
-        </vbox>
-      </action>
-    </rule>
-  </template>
-</vbox>
-
-</vbox>
-
-</window>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/329884-1.xul
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-        
-<script>
-
-function rM(q1) { q1.parentNode.removeChild(q1); }
-
-function init2()
-{ 
-  rM(document.getElementById("t"));
-}
-
-window.addEventListener("load", init2, false);
-
-</script>
-
-<foo id="t" datasources="1.rdf" />
-
-</window>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/330012-1.rdf
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:s="urn:squarefree:a1:">
-  <rdf:Description about="urn:root">
-    <s:grapes>
-      <rdf:Bag>
-        <rdf:li>
-          <rdf:Description/>
-        </rdf:li>
-      </rdf:Bag>
-    </s:grapes>
- </rdf:Description>
-</rdf:RDF>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/330012-1.xul
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <foo id="foo" datasources="330012-1.rdf" ref="urn:root">
-    <template>
-      <rule>
-        <conditions>
-          <content uri="?root"/>
-          <triple subject="?root"
-                  predicate="urn:squarefree:a1:grapes"
-                  object="?lalala"/>
-          <member container="?grapes" child="?grape"/>
-        </conditions>
-        <action>
-          <bar uri="?grape"/>
-       </action>
-     </rule>
-   </template>
- </foo>
-
-</window>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/404346-1.xul
+++ /dev/null
@@ -1,7 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<box id="b">
-<box id="a" template="b"/>
-<triple/>
-</box>
-<box datasources="" observes="a" ref="bbb"/>
-</window>
\ No newline at end of file
deleted file mode 100644
--- a/dom/xul/templates/crashtests/415019-1.xul
+++ /dev/null
@@ -1,14 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <hbox datasources="nosuch.rdf" ref="urn:root">
-    <template>
-      <rule>
-        <conditions>
-          <triple subject="?a"/>
-        </conditions>
-        <action>
-          <vbox uri="?b"/>
-        </action>
-      </rule>
-    </template>
-  </hbox>
-</window>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/417840-1.xul
+++ /dev/null
@@ -1,1 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="document.getElementById('foo').removeAttribute('ref');"><foo id="foo" datasources="nosuch.rdf" ref="urn:root"><template/></foo></window>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/424418-1.xul
+++ /dev/null
@@ -1,1 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><hbox datasources="u"/></window>
deleted file mode 100644
--- a/dom/xul/templates/crashtests/crashtests.list
+++ /dev/null
@@ -1,7 +0,0 @@
-load 257752-1-recursion.xul
-load 329884-1.xul
-skip-if(winWidget) load 330012-1.xul # bug 742455
-load 404346-1.xul
-load 415019-1.xul
-load 417840-1.xul
-load 424418-1.xul
deleted file mode 100644
--- a/dom/xul/templates/moz.build
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
-
-XPIDL_SOURCES += [
-    'nsIXULBuilderListener.idl',
-    'nsIXULSortService.idl',
-    'nsIXULTemplateBuilder.idl',
-    'nsIXULTemplateQueryProcessor.idl',
-    'nsIXULTemplateResult.idl',
-    'nsIXULTemplateRuleFilter.idl',
-]
-
-XPIDL_MODULE = 'xultmpl'
-
-EXPORTS += [
-    'nsTreeRows.h',
-    'nsXULTemplateBuilder.h',
-    'nsXULTreeBuilder.h',
-]
-
-UNIFIED_SOURCES += [
-    'nsContentSupportMap.cpp',
-    'nsContentTestNode.cpp',
-    'nsInstantiationNode.cpp',
-    'nsRDFBinding.cpp',
-    'nsRDFConInstanceTestNode.cpp',
-    'nsRDFConMemberTestNode.cpp',
-    'nsRDFPropertyTestNode.cpp',
-    'nsRDFQuery.cpp',
-    'nsResourceSet.cpp',
-    'nsRuleNetwork.cpp',
-    'nsTemplateMatch.cpp',
-    'nsTemplateRule.cpp',
-    'nsTreeRows.cpp',
-    'nsXMLBinding.cpp',
-    'nsXULContentBuilder.cpp',
-    'nsXULContentUtils.cpp',
-    'nsXULSortService.cpp',
-    'nsXULTemplateBuilder.cpp',
-    'nsXULTemplateQueryProcessorRDF.cpp',
-    'nsXULTemplateQueryProcessorStorage.cpp',
-    'nsXULTemplateQueryProcessorXML.cpp',
-    'nsXULTemplateResultRDF.cpp',
-    'nsXULTemplateResultSetRDF.cpp',
-    'nsXULTemplateResultStorage.cpp',
-    'nsXULTemplateResultXML.cpp',
-    'nsXULTreeBuilder.cpp',
-]
-
-LOCAL_INCLUDES += [
-    '/dom/base',
-    '/dom/xul',
-    '/layout/xul/tree/',
-]
-
-FINAL_LIBRARY = 'xul'
-
-if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
-    CXXFLAGS += ['-Wno-error=shadow']
deleted file mode 100644
--- a/dom/xul/templates/nsContentSupportMap.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsContentSupportMap.h"
-#include "nsXULElement.h"
-
-void
-nsContentSupportMap::Remove(nsIContent* aElement)
-{
-    nsIContent* child = aElement;
-    do {
-        mMap.Remove(child);
-        child = child->GetNextNode(aElement);
-    } while(child);
-}
-
deleted file mode 100644
--- a/dom/xul/templates/nsContentSupportMap.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsContentSupportMap_h__
-#define nsContentSupportMap_h__
-
-#include "PLDHashTable.h"
-#include "nsTemplateMatch.h"
-
-/**
- * The nsContentSupportMap maintains a mapping from a "resource element"
- * in the content tree to the nsTemplateMatch that was used to instantiate it. This
- * is necessary to allow the XUL content to be built lazily. Specifically,
- * when building "resumes" on a partially-built content element, the builder
- * will walk upwards in the content tree to find the first element with an
- * 'id' attribute. This element is assumed to be the "resource element",
- * and allows the content builder to access the nsTemplateMatch (variable assignments
- * and rule information).
- */
-class nsContentSupportMap {
-public:
-    nsContentSupportMap() : mMap(PLDHashTable::StubOps(), sizeof(Entry)) { }
-    ~nsContentSupportMap() { }
-
-    nsresult Put(nsIContent* aElement, nsTemplateMatch* aMatch) {
-        PLDHashEntryHdr* hdr = mMap.Add(aElement, mozilla::fallible);
-        if (!hdr)
-            return NS_ERROR_OUT_OF_MEMORY;
-
-        Entry* entry = static_cast<Entry*>(hdr);
-        NS_ASSERTION(entry->mMatch == nullptr, "over-writing entry");
-        entry->mContent = aElement;
-        entry->mMatch   = aMatch;
-        return NS_OK;
-    }
-
-    bool Get(nsIContent* aElement, nsTemplateMatch** aMatch) {
-        PLDHashEntryHdr* hdr = mMap.Search(aElement);
-        if (!hdr)
-            return false;
-
-        Entry* entry = static_cast<Entry*>(hdr);
-        *aMatch = entry->mMatch;
-        return true;
-    }
-
-    void Remove(nsIContent* aElement);
-
-    void Clear() { mMap.Clear(); }
-
-protected:
-    PLDHashTable mMap;
-
-    struct Entry : public PLDHashEntryHdr {
-        nsIContent*      mContent;
-        nsTemplateMatch* mMatch;
-    };
-};
-
-#endif
deleted file mode 100644
--- a/dom/xul/templates/nsContentTestNode.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsContentTestNode.h"
-#include "nsIRDFResource.h"
-#include "nsAtom.h"
-#include "nsIDOMElement.h"
-#include "nsXULContentUtils.h"
-#include "nsIXULTemplateResult.h"
-#include "nsIXULTemplateBuilder.h"
-#include "nsXULTemplateQueryProcessorRDF.h"
-
-#include "mozilla/Logging.h"
-
-using mozilla::LogLevel;
-
-extern mozilla::LazyLogModule gXULTemplateLog;
-
-nsContentTestNode::nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
-                                     nsAtom* aRefVariable)
-    : TestNode(nullptr),
-      mProcessor(aProcessor),
-      mDocument(nullptr),
-      mRefVariable(aRefVariable),
-      mTag(nullptr)
-{
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        nsAutoString tag(NS_LITERAL_STRING("(none)"));
-        if (mTag)
-            mTag->ToString(tag);
-
-        nsAutoString refvar(NS_LITERAL_STRING("(none)"));
-        if (aRefVariable)
-            aRefVariable->ToString(refvar);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsContentTestNode[%p]: ref-var=%s tag=%s",
-                this, NS_ConvertUTF16toUTF8(refvar).get(),
-                NS_ConvertUTF16toUTF8(tag).get()));
-    }
-}
-
-nsresult
-nsContentTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
-                                        bool* aCantHandleYet) const
-
-{
-    if (aCantHandleYet)
-        *aCantHandleYet = false;
-    return NS_OK;
-}
-
-nsresult
-nsContentTestNode::Constrain(InstantiationSet& aInstantiations)
-{
-    // contrain the matches to those that have matched in the template builder
-
-    nsIXULTemplateBuilder* builder = mProcessor->GetBuilder();
-    if (!builder) {
-        aInstantiations.Clear();
-        return NS_OK;
-    }
-
-    nsresult rv;
-
-    InstantiationSet::Iterator last = aInstantiations.Last();
-    for (InstantiationSet::Iterator inst = aInstantiations.First(); inst != last; ++inst) {
-
-        nsCOMPtr<nsIRDFNode> refValue;
-        bool hasRefBinding = inst->mAssignments.GetAssignmentFor(mRefVariable,
-                                                                   getter_AddRefs(refValue));
-        if (hasRefBinding) {
-            nsCOMPtr<nsIRDFResource> refResource = do_QueryInterface(refValue);
-            if (refResource) {
-                bool generated;
-                rv = builder->HasGeneratedContent(refResource, mTag, &generated);
-                if (NS_FAILED(rv)) return rv;
-
-                if (generated)
-                    continue;
-            }
-        }
-
-        aInstantiations.Erase(inst--);
-    }
-
-    return NS_OK;
-}
deleted file mode 100644
--- a/dom/xul/templates/nsContentTestNode.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsContentTestNode_h__
-#define nsContentTestNode_h__
-
-#include "mozilla/Attributes.h"
-#include "nscore.h"
-#include "nsRuleNetwork.h"
-#include "nsAtom.h"
-#include "nsIDOMDocument.h"
-
-class nsXULTemplateQueryProcessorRDF;
-
-/**
- * The nsContentTestNode is always the top node in a query's rule network. It
- * exists so that Constrain can filter out resources that aren't part of a
- * result.
- */
-class nsContentTestNode : public TestNode
-{
-public:
-    nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
-                      nsAtom* aContentVariable);
-
-    virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations,
-                                          bool* aCantHandleYet) const override;
-
-    nsresult
-    Constrain(InstantiationSet& aInstantiations) override;
-
-    void SetTag(nsAtom* aTag, nsIDOMDocument* aDocument)
-    {
-        mTag = aTag;
-        mDocument = aDocument;
-    }
-
-protected:
-    nsXULTemplateQueryProcessorRDF *mProcessor;
-    nsIDOMDocument* mDocument;
-    RefPtr<nsAtom> mRefVariable;
-    RefPtr<nsAtom> mTag;
-};
-
-#endif // nsContentTestNode_h__
-
deleted file mode 100644
--- a/dom/xul/templates/nsIXULBuilderListener.idl
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: idl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-#include "nsISupports.idl"
-
-interface nsIXULTemplateBuilder;
-
-// An nsIXULBuilderListener object is a listener that will be notified
-// when a template builder rebuilds its content.
-[scriptable, uuid(ac46be8f-c863-4c23-84a2-d0fcc8dfa9f4)]
-interface nsIXULBuilderListener: nsISupports {
-
-  /**
-   * Called before a template builder rebuilds its content.
-   * @param aBuilder the template builder that rebuilds the content.
-   */
-  void willRebuild(in nsIXULTemplateBuilder aBuilder);
-
-  /**
-   * Called after a template builder has rebuilt its content.
-   * @param aBuilder the template builder that has rebuilt the content.
-   */
-  void didRebuild(in nsIXULTemplateBuilder aBuilder);
-
-};
deleted file mode 100644
--- a/dom/xul/templates/nsIXULTemplateBuilder.idl
+++ /dev/null
@@ -1,407 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-interface nsIContent;
-interface nsIXULBuilderListener;
-interface nsIXULTemplateResult;
-interface nsIXULTemplateRuleFilter;
-interface nsIXULTemplateQueryProcessor;
-interface nsIRDFResource;
-interface nsIRDFCompositeDataSource;
-interface nsIDOMDataTransfer;
-
-%{C++
-class nsAtom;
-%}
-[ptr] native nsAtomPtr(nsAtom);
-[ptr] native Element (mozilla::dom::Element);
-
-/**
- * A template builder, given an input source of data, a template, and a
- * reference point, generates a list of results from the input, and copies
- * part of the template for each result. Templates may generate content
- * recursively, using the same template, but with the previous iteration's
- * results as the reference point. As an example, for an XML datasource the
- * initial reference point would be a specific node in the DOM tree and a
- * template might generate a list of all child nodes. For the next iteration,
- * those children would be used to generate output for their child nodes and
- * so forth.
- *
- * A template builder is attached to a single DOM node; this node is called
- * the root node and is expected to contain a XUL template element as a direct
- * child. Different template builders may be specialized in the manner in
- * which they generate and display the resulting content from the template.
- *
- * The structure of a template is as follows:
- *
- * <rootnode datasources="" ref="">
- *   <template>
- *     <queryset>
- *       <query>
- *       </query>
- *       <rule>
- *         <conditions>...</conditions>
- *         <bindings>...</bindings>
- *         <action>...</action>
- *       </rule>
- *     </queryset>
- *   </template>
- * </rootnode>
- *
- * The datasources attribute on the root node is used to identify the source
- * of data to be used. The ref attribute is used to specify the reference
- * point for the query. Currently, the datasource will either be an
- * nsIRDFDataSource or a DOM node. In the future, other datasource types may
- * be used.
- *
- * The <queryset> element contains a single query and one or more <rule>
- * elements. There may be more than one <queryset> if multiple queries are
- * desired, and this element is optional if only one query is needed -- in
- * that case the <query> and <rule>s are allowed to be children of the
- * <template> node
- *
- * The contents of the query are processed by a separate component called a
- * query processor. This query processor is expected to use this query to
- * generate results when asked by the template builder. The template builder
- * then generates output for each result based on the <rule> elements.
- *
- * This allows the query processor to be specific to a particular kind of
- * input data or query syntax, while the template builder remains independent
- * of the kind of data being used. Due to this, the query processor will be
- * supplied with the datasource and query which the template builder handles
- * in an opaque way, while the query processor handles these more
- * specifically.
- *
- * Results implement the nsIXULTemplateResult interface and may be identified
- * by an id which must be unique within a given set of query results.
- *
- * Each query may be accompanied by one or more <rule> elements. These rules
- * are evaluated by the template builder for each result produced by the
- * query. A rule consists of conditions that cause a rule to be either
- * accepted or rejected. The condition syntax allows for common conditional
- * handling; additional filtering may be applied by adding a custom filter
- * to a rule with the builder's addRuleFilter method.
- *
- * If a result passes a rule's conditions, this is considered a match, and the
- * content within the rule's <action> body is inserted as a sibling of the
- * <template>, assuming the template builder creates real DOM content. Only
- * one rule will match a result. For a tree builder, for example, the content
- * within the action body is used to create the tree rows instead. A matching
- * result must have its ruleMatched method called. When a result no longer
- * matches, the result's hasBeenRemoved method must be called.
- *
- * Optionally, the rule may have a <bindings> section which may be used to
- * define additional variables to be used within an action body. Each of these
- * declared bindings must be supplied to the query processor via its
- * addBinding method. The bindings are evaluated after a rule has matched.
- *
- * Templates may generate content recursively, using the previous iteration's
- * results as reference point to invoke the same queries. Since the reference
- * point is different, different output will typically be generated.
- *
- * The reference point nsIXULTemplateResult object for the first iteration is
- * determined by calling the query processor's translateRef method using the
- * value of the root node's ref attribute. This object may be retrieved later
- * via the builder's rootResult property.
- *
- * For convenience, each reference point as well as all results implement the
- * nsIXULTemplateResult interface, allowing the result objects from each
- * iteration to be used directly as the reference points for the next
- * iteration.
- *
- * When using multiple queries, each may generate results with the same id.
- * More than one of these results may match one of the rules in their
- * respective queries, however only the result for the earliest matching query
- * in the template becomes the active match and generates output. The
- * addResult, removeResult, replaceResult and resultBindingChanged methods may
- * be called by the query processor to indicate that the set of valid results
- * has changed, such that a different query may match. If a different match
- * would become active, the content for the existing match is removed and the
- * content for the new match is generated. A query processor is not required
- * to provide any support for updating results after they have been generated.
- *
- * See http://wiki.mozilla.org/XUL:Templates_Plan for details about templates.
- */
-[scriptable, uuid(A583B676-5B02-4F9C-A0C9-CB850CB99818)]
-interface nsIXULTemplateBuilder : nsISupports
-{
-    /**
-     * The root node in the DOM to which this builder is attached.
-     */
-    readonly attribute nsIDOMElement root;
-
-    /**
-     * The opaque datasource object that is used for the template. This object
-     * is created by the getDataSource method of the query processor. May be
-     * null if the datasource has not been loaded yet. Set this attribute to
-     * use a different datasource and rebuild the template.
-     *
-     * For an RDF datasource, this will be the same as the database. For XML
-     * this will be the nsIDOMNode for the datasource document or node for
-     * an inline reference (such as #name). Other query processors may use
-     * other types for the datasource.
-     */
-    attribute nsISupports datasource;
-
-    /**
-     * The composite datasource that the template builder observes
-     * and uses to create content. This is used only for RDF queries and is
-     * maintained for backwards compatibility. It will be the same object as
-     * the datasource property. For non-RDF queries, it will always be null.
-     */
-    readonly attribute nsIRDFCompositeDataSource database;
-
-    /**
-     * The virtual result representing the starting reference point,
-     * determined by calling the query processor's translateRef method
-     * with the root node's ref attribute as an argument.
-     */
-    readonly attribute nsIXULTemplateResult rootResult;
-
-    /**
-     * The query processor used to generate results.
-     */
-    [noscript] readonly attribute nsIXULTemplateQueryProcessor queryProcessor;
-
-    /**
-     * Force the template builder to rebuild its content. All existing content
-     * will be removed first. The query processor's done() method will be
-     * invoked during cleanup, followed by its initializeForBuilding method
-     * when the content is to be regenerated.
-     * 
-     */
-    void rebuild();
-
-    /**
-     * Reload any of our RDF datasources that support nsIRDFRemoteDatasource. 
-     *
-     * @note This is a temporary hack so that remote-XUL authors can
-     *       reload remote datasources. When RDF becomes remote-scriptable,
-     *       this will no longer be necessary.
-     */
-    void refresh();
-
-    /**
-     * Inform the template builder that a new result is available. The builder
-     * will add this result to the set of results. The query node that the
-     * new result applies to must be specified using the aQueryNode parameter.
-     *
-     * The builder will apply the rules associated with the query to the new
-     * result, unless a result with the same id from an earlier query
-     * supersedes it, and the result's RuleMatched method will be called if it
-     * matches.
-     *
-     * @param aResult the result to add
-     * @param aQueryNode the query that the result applies to
-     *
-     * @throws NS_ERROR_NULL_POINTER if aResult or aQueryNode are null
-     */
-    void addResult(in nsIXULTemplateResult aResult, in nsIDOMNode aQueryNode);
-
-    /**
-     * Inform the template builder that a result no longer applies. The builder
-     * will call the remove content generated for the result, if any. If a different
-     * query would then match instead, it will become the active match. This
-     * method will have no effect if the result isn't known to the builder.
-     *
-     * @param aResult the result to remove
-     *
-     * @throws NS_ERROR_NULL_POINTER if aResult is null
-     */
-    void removeResult(in nsIXULTemplateResult aResult);
-
-    /**
-     * Inform the template builder that one result should be replaced with
-     * another. Both the old result (aOldResult) and the new result
-     * (aNewResult) must have the same id. The query node that the new result
-     * applies to must be specified using the aQueryNode parameter.
-     *
-     * This method is expected to have the same effect as calling both
-     * removeResult for the old result and addResult for the new result.
-     *
-     * @param aOldResult the old result
-     * @param aNewResult the new result
-     * @param aQueryNode the query that the new result applies to
-     *
-     * @throws NS_ERROR_NULL_POINTER if either argument is null, or
-     *         NS_ERROR_INVALID_ARG if the ids don't match
-     */
-    void replaceResult(in nsIXULTemplateResult aOldResult,
-                       in nsIXULTemplateResult aNewResult,
-                       in nsIDOMNode aQueryNode);
-
-    /**
-     * Inform the template builder that one or more of the optional bindings
-     * for a result has changed. In this case, the rules are not reapplied as
-     * it is expected that the same rule will still apply. The builder will
-     * resynchronize any variables that are referenced in the action body.
-     *
-     * @param aResult the result to change
-     *
-     * @throws NS_ERROR_NULL_POINTER if aResult is null
-     */
-    void resultBindingChanged(in nsIXULTemplateResult aResult);
-
-    /**
-     * Return the result for a given id. Only one such result is returned and
-     * is always the result with that id associated with the active match.
-     * This method will return null is there is no result for the id.
-     *
-     * @param aId the id to return the result for
-     */
-    nsIXULTemplateResult getResultForId(in AString aId);
-
-    /**
-     * Retrieve the result corresponding to a generated element, or null is
-     * there isn't one.
-     *
-     * @param aContent element to result the result of
-     */
-    nsIXULTemplateResult getResultForContent(in nsIDOMElement aElement);
-
-    /**
-     * Returns true if the node has content generated for it. This method is
-     * intended to be called only by the RDF query processor. If aTag is set,
-     * the content must have a tag name that matches aTag. aTag may be ignored
-     * for builders that don't generate real DOM content.
-     *
-     * @param aNode node to check
-     * @param aTag tag that must match
-     */
-    [noscript] boolean hasGeneratedContent(in nsIRDFResource aNode,
-                                           in nsAtomPtr aTag);
-
-    /**
-     * Adds a rule filter for a given rule, which may be used for specialized
-     * rule filtering. Any existing filter on the rule is removed. The default
-     * conditions specified inside the <rule> tag are applied before the
-     * rule filter is applied, meaning that the filter may be used to further
-     * filter out results but not reaccept results that have already been
-     * rejected.
-     *
-     * @param aRule the rule to apply the filter to
-     * @param aFilter the filter to add
-     */
-    void addRuleFilter(in nsIDOMNode aRule, in nsIXULTemplateRuleFilter aFilter);
-
-    /**
-     * Invoked lazily by a XUL element that needs its child content built.
-     * If aForceCreation is true, then the contents of an element will be
-     * generated even if it is closed. If false, the element will only
-     * generate its contents if it is open. This behaviour is used with menus.
-     */
-    [noscript] void createContents(in Element aElement,
-                                   in boolean aForceCreation);
-
-    /**
-     * Add a listener to this template builder. The template builder
-     * holds a strong reference to the listener.
-     */
-    void addListener(in nsIXULBuilderListener aListener);
-
-    /**
-     * Remove a listener from this template builder.
-     */
-    void removeListener(in nsIXULBuilderListener aListener);
-};
-
-/**
- * nsIXULTreeBuilderObserver
- *  This interface allows clients of the XULTreeBuilder to define domain 
- *  specific handling of specific nsITreeView methods that 
- *  XULTreeBuilder does not implement.
- */
-[scriptable, uuid(57CED9A7-EC0B-4A0E-8AEB-5DA32EBE951C)]
-interface nsIXULTreeBuilderObserver : nsISupports
-{
-    const long DROP_BEFORE = -1;
-    const long DROP_ON = 0;
-    const long DROP_AFTER = 1;
-    /**
-     * Methods used by the drag feedback code to determine if a drag is allowable at
-     * the current location. To get the behavior where drops are only allowed on
-     * items, such as the mailNews folder pane, always return false whe
-     * the orientation is not DROP_ON.
-     */
-    boolean canDrop(in long index, in long orientation, in nsIDOMDataTransfer dataTransfer);
-
-    /**
-     * Called when the user drops something on this view. The |orientation| param
-     * specifies before/on/after the given |row|.
-     */
-    void onDrop(in long row, in long orientation, in nsIDOMDataTransfer dataTransfer);
- 
-    /** 
-     * Called when an item is opened or closed. 
-     */
-    void onToggleOpenState (in long index);
-
-    /** 
-	 * Called when a header is clicked.
-     */
-    void onCycleHeader(in wstring colID, in nsIDOMElement elt);
-
-    /**
-     * Called when a cell in a non-selectable cycling column (e.g. 
-     * unread/flag/etc.) is clicked.
-     */
-    void onCycleCell(in long row, in wstring colID);
-
-    /** 
-     * Called when selection in the tree changes
-     */
-    void onSelectionChanged();
-
-    /**
-     * A command API that can be used to invoke commands on the selection.  
-     * The tree will automatically invoke this method when certain keys 
-     * are pressed.  For example, when the DEL key is pressed, performAction 
-     * will be called with the "delete" string. 
-     */
-    void onPerformAction(in wstring action);
-
-    /**
-     * A command API that can be used to invoke commands on a specific row.
-     */
-    void onPerformActionOnRow(in wstring action, in long row);
-
-    /**
-     * A command API that can be used to invoke commands on a specific cell.
-     */
-    void onPerformActionOnCell(in wstring action, in long row, in wstring colID);
-};
-
-[scriptable, uuid(06b31b15-ebf5-4e74-a0e2-6bc0a18a3969)]
-interface nsIXULTreeBuilder : nsISupports
-{
-    /**
-     * Retrieve the RDF resource associated with the specified row.
-     */
-    nsIRDFResource getResourceAtIndex(in long aRowIndex);
-
-    /**
-     * Retrieve the index associated with specified RDF resource.
-     */
-    long getIndexOfResource(in nsIRDFResource resource);
-
-    /** 
-     * Add a Tree Builder Observer to handle Tree View 
-     * methods that the base builder does not implement. 
-     */
-    void addObserver(in nsIXULTreeBuilderObserver aObserver);
-
-    /** 
-     * Remove an Tree Builder Observer.
-     */
-    void removeObserver(in nsIXULTreeBuilderObserver aObserver);
-
-    /** 
-     * Sort the contents of the tree using the specified column.
-     */
-    void sort(in nsIDOMElement aColumnElement);
-};
-
deleted file mode 100644
--- a/dom/xul/templates/nsIXULTemplateQueryProcessor.idl
+++ /dev/null
@@ -1,280 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-interface nsIArray;
-interface nsISimpleEnumerator;
-interface nsIXULTemplateResult;
-interface nsIXULTemplateRuleFilter;
-interface nsIXULTemplateBuilder;
-
-%{C++
-class nsAtom;
-%}
-[ptr] native nsAtomPtr(nsAtom);
-
-/**
- * A query processor takes a template query and generates results for it given
- * a datasource and a reference point. There is a one-to-one relationship
- * between a template builder and a query processor. The template builder
- * creates the query processor, and there is no other means to retrieve it.
- *
- * A template query is the contents inside a <query> element within the
- * template. The actual syntax is opaque to the template builder and defined
- * by a query processor. The query is expected to consist of either text or
- * DOM nodes that, when executed by a call to the generateResults method, will
- * allow the generation of a list of results.
- *
- * The template builder will supply two variables, the reference variable and
- * the member variable to further indicate what part of the datasource is to
- * be examined in addition to the query itself. The reference is always
- * a placeholder for the starting point and the member is always a placeholder
- * for the end points (the results).
- *
- * The reference point is important when generating output recursively, as
- * the query will be the same for each iteration, however, the reference point
- * will differ.
- *
- * For instance, when examining an XML source, an XML query processor might
- * begin at the node referred by the reference variable and end at a list of
- * that node's children.
- *
- * Some queries may not need the reference variable if the syntax or the form
- * of the data implies the value. For instance, a datasource that holds a
- * table that can only produce one set of results.
- *
- * The reference variable may be specified in a template by setting the
- * "container" attribute on the <template> element to the variable to use. The
- * member variable may be specified in a similar way using the "member"
- * attribute, or it may be specified in the first <action> body in the
- * template as the value of a uri attribute on an element. A breadth-first
- * search of the first action is performed to find this element.
- *
- * If unspecified, the default value of the reference variable is ?uri.
- *
- * For example, a query might have the following syntax:
- *
- * (?id, ?name, ?url) from Bookmarks where parentfolder = ?start
- *
- * This query might generate a result for each bookmark within a given folder.
- * The variable ?start would be the reference variable, while the variable ?id
- * would be the member variable, since it is the unique value that identifies
- * a result. Each result will have the four variables referred to defined for
- * it and the values may be retrieved using the result's getBindingFor and
- * getBindingObjectFor methods.
- *
- * The template builder must call initializeForBuilding before the other
- * methods, except for translateRef. The builder will then call compileQuery
- * for each query in the template to compile the queries. When results need
- * to be generated, the builder will call generateResults. The
- * initializeForBuilding, compileQuery and addBinding methods may not be
- * called after generateResults has been called until the builder indicates
- * that the generated output is being removed by calling the done method.
- *
- * Currently, the datasource supplied to the methods will always be an
- * nsIRDFDataSource or a DOM node, and will always be the same one in between
- * calls to initializeForBuilding and done.
- */
-[scriptable, uuid(C257573F-444F-468A-BA27-DE979DC55FE4)]
-interface nsIXULTemplateQueryProcessor : nsISupports
-{
-  /**
-   * Retrieve the datasource to use for the query processor. The list of
-   * datasources in a template is specified using the datasources attribute as
-   * a space separated list of URIs. This list is processed by the builder and
-   * supplied to the query processor in the aDataSources array as a list of
-   * nsIURI objects or nsIDOMNode objects. This method may return an object
-   * corresponding to these URIs and the builder will supply this object to
-   * other query processor methods. For example, for an XML source, the
-   * datasource might be an nsIDOMNode.
-   *
-   * All of these URIs are checked by the builder so it is safe to use them,
-   * however note that a URI that redirects may still needs to be checked to
-   * ensure that the document containing aRootNode may access it. This is the
-   * responsibility of the query processor if it needs to load the content of
-   * the URI.
-   *
-   * If the query processor needs to load the datasource asynchronously, it
-   * may set the aShouldDelayBuilding returned parameter to true to delay
-   * building the template content, and call the builder's Rebuild method when
-   * the data is available.
-   *
-   * @param aDataSources  the list of nsIURI objects and/or nsIDOMNode objects
-   * @param aRootNode     the root node the builder is attached to
-   * @param aIsTrusted    true if the template is in a trusted document
-   * @param aBuilder      the template builder
-   * @param aShouldDelayBuilding [out] whether the builder should wait to
-   *                                   build the content or not
-   * @returns a datasource object
-   */
-  nsISupports getDatasource(in nsIArray aDataSources,
-                            in nsIDOMNode aRootNode,
-                            in boolean aIsTrusted,
-                            in nsIXULTemplateBuilder aBuilder,
-                            out boolean aShouldDelayBuilding);
-
-  /**
-   * Initialize for query generation. This will be called before the rules are
-   * processed and whenever the template is rebuilt. This method must be
-   * called once before any of the other query processor methods except for
-   * translateRef.
-   *
-   * @param aDatasource datasource for the data
-   * @param aBuilder the template builder
-   * @param aRootNode the root node the builder is attached to
-   *
-   * @throws NS_ERROR_INVALID_ARG if the datasource is not supported or
-   *         NS_ERROR_UNEXPECTED if generateResults has already been called.
-   */
-  void initializeForBuilding(in nsISupports aDatasource,
-                             in nsIXULTemplateBuilder aBuilder,
-                             in nsIDOMNode aRootNode);
-
-  /**
-   * Called when the template builder is being destroyed so that the query
-   * processor can clean up any state. The query processor should remove as
-   * much state as possible, such as results or references to the builder.
-   * This method will also be called when the template is going to be rebuilt.
-   */
-  void done();
-
-  /**
-   * Compile a query from a node. The result of this function will later be
-   * passed to generateResults for result generation. If null is returned,
-   * the query will be ignored.
-   *
-   * The template builder will call this method once for each query within
-   * the template, before any results can be generated using generateResults,
-   * but after initializeForBuilding has been called. This method should not
-   * be called again for the same query unless the template is rebuilt.
-   *
-   * The reference variable may be used by the query processor as a
-   * placeholder for the reference point, or starting point in the query.
-   *
-   * The member variable is determined from the member attribute on the
-   * template, or from the uri in the first action's rule if that attribute is
-   * not present. A rule processor may use the member variable as a hint to
-   * indicate what variable is expected to contain the results.
-   *
-   * @param aBuilder the template builder
-   * @param aQuery <query> node to compile
-   * @param aRefVariable the reference variable
-   * @param aMemberVariable the member variable
-   *
-   * @returns a compiled query object
-   */
-  [noscript] nsISupports compileQuery(in nsIXULTemplateBuilder aBuilder,
-                                      in nsIDOMNode aQuery,
-                                      in nsAtomPtr aRefVariable,
-                                      in nsAtomPtr aMemberVariable);
-
-  /**
-   * Generate the results of a query and return them in an enumerator. The
-   * enumerator must contain nsIXULTemplateResult objects. If there are no
-   * results, an empty enumerator must be returned.
-   *
-   * The datasource will be the same as the one passed to the earlier
-   * initializeForBuilding method. The context reference (aRef) is a reference
-   * point used when calculating results.
-   *
-   * The value of aQuery must be the result of a previous call to compileQuery
-   * from this query processor. This method may be called multiple times,
-   * typically with different values for aRef.
-   *
-   * @param aDatasource datasource for the data
-   * @param aRef context reference value used as a starting point
-   * @param aQuery the compiled query returned from query compilation
-   *
-   * @returns an enumerator of nsIXULTemplateResult objects as the results
-   *
-   * @throws NS_ERROR_INVALID_ARG if aQuery is invalid
-   */
-  nsISimpleEnumerator generateResults(in nsISupports aDatasource,
-                                      in nsIXULTemplateResult aRef,
-                                      in nsISupports aQuery);
-
-  /**
-   * Add a variable binding for a particular rule. A binding allows an
-   * additional variable to be set for a result, outside of those defined
-   * within the query. These bindings are always optional, in that they will
-   * never affect the results generated.
-   *
-   * This function will never be called after generateResults. Any bindings
-   * that were added should be applied to each result when the result's
-   * ruleMatched method is called, since the bindings are different for each
-   * rule.
-   *
-   * The reference aRef may be used to determine the reference when
-   * calculating the value for the binding, for example when a value should
-   * depend on the value of another variable.
-   *
-   * The syntax of the expression aExpr is defined by the query processor. If
-   * the syntax is invalid, the binding should be ignored. Only fatal errors
-   * should be thrown, or NS_ERROR_UNEXPECTED if generateResults has already
-   * been called.
-   *
-   * As an example, if the reference aRef is the variable '?count' which
-   * holds the value 5, and the expression aExpr is the string '+2', the value
-   * of the variable aVar would be 7, assuming the query processor considers
-   * the syntax '+2' to mean add two to the reference.
-   *
-   * @param aRuleNode rule to add the binding to
-   * @param aVar variable that will be bound
-   * @param aRef variable that holds reference value
-   * @param aExpr expression used to compute the value to assign
-   */
-  [noscript] void addBinding(in nsIDOMNode aRuleNode,
-                             in nsAtomPtr aVar,
-                             in nsAtomPtr aRef,
-                             in AString aExpr);
-
-  /**
-   * Translate a ref attribute string into a result. This is used as the
-   * reference point by the template builder when generating the first level
-   * of content. For recursive generation, the result from the parent
-   * generation phase will be used directly as the reference so a translation
-   * is not needed. This allows all levels to be generated using objects that
-   * all implement the nsIXULTemplateResult interface.
-   *
-   * This method may be called before initializeForBuilding, so the
-   * implementation may use the supplied datasource if it is needed to
-   * translate the reference.
-   *
-   * @param aDatasource datasource for the data
-   * @param aRefString the ref attribute string
-   *
-   * @return the translated ref
-   */
-  nsIXULTemplateResult translateRef(in nsISupports aDatasource,
-                                    in AString aRefString);
-
-  /**
-   * Compare two results to determine their order, used when sorting results.
-   * This method should return -1 when the left result is less than the right,
-   * 0 if both are equivalent, and 1 if the left is greater than the right.
-   * The comparison should only consider the values for the specified
-   * variable.
-   *
-   * If the comparison variable is null, the results may be
-   * sorted in a natural order, for instance, based on the order the data in
-   * stored in the datasource.
-   *
-   * The sort hints are the flags in nsIXULSortService.
-   *
-   * This method must only be called with results that were created by this
-   * query processor.
-   *
-   * @param aLeft the left result to compare
-   * @param aRight the right result to compare
-   * @param aVar variable to compare
-   *
-   * @param returns -1 if less, 0 if equal, or 1 if greater
-   */
-   [noscript] int32_t compareResults(in nsIXULTemplateResult aLeft,
-                                     in nsIXULTemplateResult aRight,
-                                     in nsAtomPtr aVar,
-                                     in unsigned long aSortHints);
-};
deleted file mode 100644
--- a/dom/xul/templates/nsIXULTemplateResult.idl
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIDOMNode;
-interface nsIRDFResource;
-
-%{C++
-class nsAtom;
-%}
-[ptr] native nsAtomPtr(nsAtom);
-
-/**
- * A single result generated from a template query. Each result is identified
- * by an id, which must be unique within the set of results produced from a
- * query. The result may optionally be identified by an RDF resource.
- *
- * Generally, the result and its id will be able to uniquely identify a node
- * in the source data, such as an RDF or XML node. In other contexts, such as
- * a database query, a result would represent a particular record.
- *
- * A result is expected to only be created by a query processor.
- *
- * Each result also contains a set of variable bindings. The value for a
- * particular variable may be retrieved using the getBindingFor and
- * getBindingObjectFor methods.
- */
-[scriptable, uuid(ebea0230-36fa-41b7-8e31-760806057965)]
-interface nsIXULTemplateResult : nsISupports
-{
-  /**
-   * True if the result represents a container.
-   */
-  readonly attribute boolean isContainer;
-
-  /**
-   * True if the result represents an empty container.
-   */
-  readonly attribute boolean isEmpty;
-
-  /**
-   * True if the template builder may use this result as the reference point
-   * for additional recursive processing of the template. The template builder
-   * will reprocess the template using this result as the reference point and
-   * generate output content that is expected to be inserted as children of the
-   * output generated for this result. If false, child content is not
-   * processed. This property identifies only the default handling and may be
-   * overriden by syntax used in the template.
-   */
-  readonly attribute boolean mayProcessChildren;
-
-  /**
-   * ID of the result. The DOM element created for this result, if any, will
-   * have its id attribute set to this value. The id must be unique for a
-   * query.
-   */
-  readonly attribute AString id;
-
-  /**
-   * Resource for the result, which may be null. If set, the resource uri
-   * must be the same as the ID property.
-   */
-  readonly attribute nsIRDFResource resource;
-
-  /**
-   * The type of the object. The predefined value 'separator' may be used
-   * for separators. Other values may be used for application specific
-   * purposes.
-   */
-  readonly attribute AString type;
-
-  /**
-   * Get the string representation of the value of a variable for this
-   * result. This string will be used in the action body from a template as
-   * the replacement text. For instance, if the text ?name appears in an
-   * attribute within the action body, it will be replaced with the result
-   * of this method. The question mark is considered part of the variable
-   * name, thus aVar should be ?name and not simply name.
-   *
-   * @param aVar the variable to look up
-   *
-   * @return the value for the variable or a null string if it has no value
-   */
-  [noscript] AString getBindingFor(in nsAtomPtr aVar);
-
-  /**
-   * Get an object value for a variable such as ?name for this result. 
-   *
-   * This method may return null for a variable, even if getBindingFor returns
-   * a non-null value for the same variable. This method is provided as a
-   * convenience when sorting results.
-   *
-   * @param aVar the variable to look up
-   *
-   * @return the value for the variable or null if it has no value
-   */
-  [noscript] nsISupports getBindingObjectFor(in nsAtomPtr aVar);
-
-  /**
-   * Indicate that a particular rule of a query has matched and that output
-   * will be generated for it. Both the query as compiled by the query
-   * processor's compileQuery method and the XUL <rule> element are supplied.
-   * The query must always be one that was compiled by the query processor
-   * that created this result. The <rule> element must always be a child of
-   * the <query> element that was used to compile the query.
-   *
-   * @param aQuery the query that matched
-   * @param aRuleNode the rule node that matched
-   */
-  void ruleMatched(in nsISupports aQuery, in nsIDOMNode aRuleNode);
-
-  /**
-   * Indicate that the output for a result has beeen removed and that the
-   * result is no longer being used by the builder.
-   */
-  void hasBeenRemoved();
-};
deleted file mode 100644
--- a/dom/xul/templates/nsIXULTemplateRuleFilter.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "domstubs.idl"
-
-interface nsISupports;
-interface nsIXULTemplateResult;
-
-/**
- * A rule filter may be used to add additional filtering of results to a rule.
- * The filter is used to further reject results from matching the template's
- * rules, beyond what the template syntax can do itself, thus allowing for
- * more complex result filtering. The rule filter is applied after the rule
- * syntax within the template.
- *
- * Only one filter may apply to each rule within the template and may be
- * assigned using the template builder's addRuleFilter method.
- */
-[scriptable, uuid(819cd1ed-8010-42e1-a8b9-778b726a1ff3)]
-interface nsIXULTemplateRuleFilter : nsISupports
-{
-  /**
-   * Evaluate a result and return true if the result is accepted by this
-   * filter, or false if it is rejected. Accepted results will have output
-   * generated for them for the rule. Rejected results will not, but they
-   * may still match another rule.
-   *
-   * @param aRef the result to examine
-   * @param aRule the rule node
-   *
-   * @return true if the rule matches
-   */
-  boolean match(in nsIXULTemplateResult aRef, in nsIDOMNode aRule);
-};
deleted file mode 100644
--- a/dom/xul/templates/nsInstantiationNode.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsInstantiationNode.h"
-#include "nsTemplateRule.h"
-#include "nsXULTemplateQueryProcessorRDF.h"
-
-#include "mozilla/Logging.h"
-extern mozilla::LazyLogModule gXULTemplateLog;
-
-nsInstantiationNode::nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProcessor,
-                                         nsRDFQuery* aQuery)
-        : mProcessor(aProcessor),
-          mQuery(aQuery)
-{
-    MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-           ("nsInstantiationNode[%p] query=%p", this, aQuery));
-
-    MOZ_COUNT_CTOR(nsInstantiationNode);
-}
-
-
-nsInstantiationNode::~nsInstantiationNode()
-{
-    MOZ_COUNT_DTOR(nsInstantiationNode);
-}
-
-nsresult
-nsInstantiationNode::Propagate(InstantiationSet& aInstantiations,
-                               bool aIsUpdate, bool& aTakenInstantiations)
-{
-    // In update mode, iterate through the results and call the template
-    // builder to update them. In non-update mode, cache them in the processor
-    // to be used during processing. The results are cached in the processor
-    // so that the simple rules are only computed once. In this situation, all
-    // data for all queries are calculated at once.
-    nsresult rv = NS_OK;
-
-    aTakenInstantiations = false;
-
-    if (aIsUpdate) {
-        // Iterate through newly added keys to determine which rules fired.
-        //
-        // XXXwaterson Unfortunately, this could also lead to retractions;
-        // e.g., (container ?a ^empty false) could become "unmatched". How
-        // to track those?
-        nsCOMPtr<nsIDOMNode> querynode;
-        mQuery->GetQueryNode(getter_AddRefs(querynode));
-
-        InstantiationSet::ConstIterator last = aInstantiations.Last();
-        for (InstantiationSet::ConstIterator inst = aInstantiations.First(); inst != last; ++inst) {
-            nsAssignmentSet assignments = inst->mAssignments;
-
-            nsCOMPtr<nsIRDFNode> node;
-            assignments.GetAssignmentFor(mQuery->mMemberVariable,
-                                         getter_AddRefs(node));
-            if (node) {
-                nsCOMPtr<nsIRDFResource> resource = do_QueryInterface(node);
-                if (resource) {
-                    RefPtr<nsXULTemplateResultRDF> nextresult =
-                        new nsXULTemplateResultRDF(mQuery, *inst, resource);
-                    if (! nextresult)
-                        return NS_ERROR_OUT_OF_MEMORY;
-
-                    rv = mProcessor->AddMemoryElements(*inst, nextresult);
-                    if (NS_FAILED(rv))
-                        return rv;
-
-                    mProcessor->GetBuilder()->AddResult(nextresult, querynode);
-                }
-            }
-        }
-    }
-    else {
-        nsresult rv = mQuery->SetCachedResults(mProcessor, aInstantiations);
-        if (NS_SUCCEEDED(rv))
-            aTakenInstantiations = true;
-    }
-
-    return rv;
-}
deleted file mode 100644
--- a/dom/xul/templates/nsInstantiationNode.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsInstantiationNode_h__
-#define nsInstantiationNode_h__
-
-#include "mozilla/Attributes.h"
-#include "nsRuleNetwork.h"
-#include "nsRDFQuery.h"
-
-class nsXULTemplateQueryProcessorRDF;
-
-/**
- * A leaf-level node in the rule network. If any instantiations
- * propagate to this node, then we know we've matched a rule.
- */
-class nsInstantiationNode : public ReteNode
-{
-public:
-    nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProcessor,
-                        nsRDFQuery* aRule);
-
-    ~nsInstantiationNode();
-
-    // "downward" propagations
-    virtual nsresult Propagate(InstantiationSet& aInstantiations,
-                               bool aIsUpdate, bool& aMatched) override;
-
-protected:
-
-    nsXULTemplateQueryProcessorRDF* mProcessor;
-    nsRDFQuery* mQuery;
-};
-
-#endif // nsInstantiationNode_h__
deleted file mode 100644
--- a/dom/xul/templates/nsRDFBinding.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsXULTemplateQueryProcessorRDF.h"
-#include "nsXULTemplateResultRDF.h"
-#include "nsRDFBinding.h"
-
-#ifdef DEBUG
-#include "nsXULContentUtils.h"
-#endif
-
-RDFBindingSet::~RDFBindingSet()
-{
-    while (mFirst) {
-        RDFBinding* doomed = mFirst;
-        mFirst = mFirst->mNext;
-        delete doomed;
-    }
-
-    MOZ_COUNT_DTOR(RDFBindingSet);
-}
-
-nsresult
-RDFBindingSet::AddBinding(nsAtom* aVar, nsAtom* aRef, nsIRDFResource* aPredicate)
-{
-    RDFBinding* newbinding = new RDFBinding(aRef, aPredicate, aVar);
-    if (mFirst) {
-        RDFBinding* binding = mFirst;
-
-        while (binding) {
-            // the binding is dependant on the calculation of a previous binding
-            if (binding->mSubjectVariable == aVar)
-                newbinding->mHasDependency = true;
-
-            // if the target variable is already used in a binding, ignore it
-            // since it won't be useful for anything
-            if (binding->mTargetVariable == aVar) {
-                delete newbinding;
-                return NS_OK;
-            }
-
-            // add the binding at the end of the list
-            if (! binding->mNext) {
-                binding->mNext = newbinding;
-                break;
-            }
-
-            binding = binding->mNext;
-        }
-    }
-    else {
-        mFirst = newbinding;
-    }
-
-    mCount++;
-
-    return NS_OK;
-}
-
-bool
-RDFBindingSet::SyncAssignments(nsIRDFResource* aSubject,
-                               nsIRDFResource* aPredicate,
-                               nsIRDFNode* aTarget,
-                               nsAtom* aMemberVariable,
-                               nsXULTemplateResultRDF* aResult,
-                               nsBindingValues& aBindingValues)
-{
-    NS_ASSERTION(aBindingValues.GetBindingSet() == this,
-                 "nsBindingValues not for this RDFBindingSet");
-    NS_PRECONDITION(aResult, "Must have result");
-
-    bool needSync = false;
-    nsCOMPtr<nsIRDFNode>* valuesArray = aBindingValues.ValuesArray();
-    if (!valuesArray)
-        return false;
-
-    RDFBinding* binding = mFirst;
-    int32_t count = 0;
-
-    // QI for proper comparisons just to be safe
-    nsCOMPtr<nsIRDFNode> subjectnode = do_QueryInterface(aSubject);
-
-    // iterate through the bindings looking for ones that would match the RDF
-    // nodes that were involved in a change
-    nsCOMPtr<nsIRDFNode> value;
-    while (binding) {
-        if (aPredicate == binding->mPredicate) {
-            // if the source of the binding is the member variable, optimize
-            if (binding->mSubjectVariable == aMemberVariable) {
-                valuesArray[count] = aTarget;
-                needSync = true;
-            }
-            else {
-                aResult->GetAssignment(binding->mSubjectVariable, getter_AddRefs(value));
-                if (value == subjectnode) {
-                    valuesArray[count] = aTarget;
-                    needSync = true;
-                }
-            }
-        }
-
-        binding = binding->mNext;
-        count++;
-    }
-
-    return needSync;
-}
-
-void
-RDFBindingSet::AddDependencies(nsIRDFResource* aSubject,
-                               nsXULTemplateResultRDF* aResult)
-{
-    NS_PRECONDITION(aResult, "Must have result");
-
-    // iterate through the bindings and add binding dependencies to the
-    // processor
-
-    nsXULTemplateQueryProcessorRDF* processor = aResult->GetProcessor();
-    if (! processor)
-        return;
-
-    nsCOMPtr<nsIRDFNode> value;
-
-    RDFBinding* binding = mFirst;
-    while (binding) {
-        aResult->GetAssignment(binding->mSubjectVariable, getter_AddRefs(value));
-
-        nsCOMPtr<nsIRDFResource> valueres = do_QueryInterface(value);
-        if (valueres)
-            processor->AddBindingDependency(aResult, valueres);
-
-        binding = binding->mNext;
-    }
-}
-
-void
-RDFBindingSet::RemoveDependencies(nsIRDFResource* aSubject,
-                                  nsXULTemplateResultRDF* aResult)
-{
-    NS_PRECONDITION(aResult, "Must have result");
-
-    // iterate through the bindings and remove binding dependencies from the
-    // processor
-
-    nsXULTemplateQueryProcessorRDF* processor = aResult->GetProcessor();
-    if (! processor)
-        return;
-
-    nsCOMPtr<nsIRDFNode> value;
-
-    RDFBinding* binding = mFirst;
-    while (binding) {
-        aResult->GetAssignment(binding->mSubjectVariable, getter_AddRefs(value));
-
-        nsCOMPtr<nsIRDFResource> valueres = do_QueryInterface(value);
-        if (valueres)
-            processor->RemoveBindingDependency(aResult, valueres);
-
-        binding = binding->mNext;
-    }
-}
-
-int32_t
-RDFBindingSet::LookupTargetIndex(nsAtom* aTargetVariable, RDFBinding** aBinding)
-{
-    int32_t idx = 0;
-    RDFBinding* binding = mFirst;
-
-    while (binding) {
-        if (binding->mTargetVariable == aTargetVariable) {
-            *aBinding = binding;
-            return idx;
-        }
-        idx++;
-        binding = binding->mNext;
-    }
-
-    return -1;
-}
-
-nsBindingValues::~nsBindingValues()
-{
-    ClearBindingSet();
-    MOZ_COUNT_DTOR(nsBindingValues);
-}
-
-void
-nsBindingValues::ClearBindingSet()
-{
-    if (mBindings && mValues) {
-        delete [] mValues;
-        mValues = nullptr;
-    }
-
-    mBindings = nullptr;
-}
-
-nsresult
-nsBindingValues::SetBindingSet(RDFBindingSet* aBindings)
-{
-    ClearBindingSet();
-
-    int32_t count = aBindings->Count();
-    if (count) {
-        mValues = new nsCOMPtr<nsIRDFNode>[count];
-        mBindings = aBindings;
-    }
-    else {
-        mValues = nullptr;
-    }
-
-    return NS_OK;
-}
-
-void
-nsBindingValues::GetAssignmentFor(nsXULTemplateResultRDF* aResult,
-                                  nsAtom* aVar,
-                                  nsIRDFNode** aValue)
-{
-    *aValue = nullptr;
-
-    // assignments are calculated lazily when asked for. The only issue is
-    // when a binding has no value in the RDF graph, it will be checked again
-    // every time.
-
-    if (mBindings && mValues) {
-        RDFBinding* binding;
-        int32_t idx = mBindings->LookupTargetIndex(aVar, &binding);
-        if (idx >= 0) {
-            *aValue = mValues[idx];
-            if (*aValue) {
-                NS_ADDREF(*aValue);
-            }
-            else {
-                nsXULTemplateQueryProcessorRDF* processor = aResult->GetProcessor();
-                if (! processor)
-                    return;
-
-                nsIRDFDataSource* ds = processor->GetDataSource();
-                if (! ds)
-                    return;
-
-                nsCOMPtr<nsIRDFNode> subjectValue;
-                aResult->GetAssignment(binding->mSubjectVariable,
-                                       getter_AddRefs(subjectValue));
-                if (subjectValue) {
-                    nsCOMPtr<nsIRDFResource> subject = do_QueryInterface(subjectValue);
-                    ds->GetTarget(subject, binding->mPredicate, true, aValue);
-                    if (*aValue)
-                        mValues[idx] = *aValue;
-                }
-            }
-        }
-    }
-}
-
-void
-nsBindingValues::RemoveDependencies(nsIRDFResource* aSubject,
-                                    nsXULTemplateResultRDF* aResult)
-{
-    if (mBindings)
-        mBindings->RemoveDependencies(aSubject, aResult);
-}
deleted file mode 100644
--- a/dom/xul/templates/nsRDFBinding.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsRDFBinding_h__
-#define nsRDFBinding_h__
-
-#include "nsAtom.h"
-#include "nsIRDFResource.h"
-#include "nsISupportsImpl.h"
-
-class nsXULTemplateResultRDF;
-class nsBindingValues;
-
-/*
- * Classes related to storing bindings for RDF handling.
- */
-
-/*
- * a  <binding> descriptors
- */
-class RDFBinding {
-
-public:
-
-    RefPtr<nsAtom>        mSubjectVariable;
-    nsCOMPtr<nsIRDFResource> mPredicate;
-    RefPtr<nsAtom>        mTargetVariable;
-
-    // indicates whether a binding is dependant on the result from a
-    // previous binding
-    bool                     mHasDependency;
-
-    RDFBinding*              mNext;
-
-private:
-
-    friend class RDFBindingSet;
-
-    RDFBinding(nsAtom* aSubjectVariable,
-               nsIRDFResource* aPredicate,
-               nsAtom* aTargetVariable)
-      : mSubjectVariable(aSubjectVariable),
-        mPredicate(aPredicate),
-        mTargetVariable(aTargetVariable),
-        mHasDependency(false),
-        mNext(nullptr)
-    {
-        MOZ_COUNT_CTOR(RDFBinding);
-    }
-
-    ~RDFBinding()
-    {
-        MOZ_COUNT_DTOR(RDFBinding);
-    }
-};
-
-/*
- * a collection of <binding> descriptors. This object is refcounted by
- * nsBindingValues objects and the query processor.
- */
-class RDFBindingSet final
-{
-private:
-    // Private destructor, to discourage deletion outside of Release():
-    ~RDFBindingSet();
-
-    // the number of bindings
-    int32_t mCount;
-
-    // pointer to the first binding in a linked list
-    RDFBinding* mFirst;
-
-public:
-
-    RDFBindingSet()
-        : mCount(0),
-          mFirst(nullptr)
-    {
-        MOZ_COUNT_CTOR(RDFBindingSet);
-    }
-
-    NS_INLINE_DECL_REFCOUNTING(RDFBindingSet)
-
-    int32_t Count() const { return mCount; }
-
-    /*
-     * Add a binding (aRef -> aPredicate -> aVar) to the set
-     */
-    nsresult
-    AddBinding(nsAtom* aVar, nsAtom* aRef, nsIRDFResource* aPredicate);
-
-    /*
-     * Return true if the binding set contains a binding which would cause
-     * the result to need resynchronizing for an RDF triple. The member
-     * variable may be supplied as an optimization since bindings most
-     * commonly use the member variable as the subject. If aMemberVariable
-     * is set, aSubject must be the value of the member variable for the
-     * result. The supplied binding values aBindingValues must be values
-     * using this binding set (that is aBindingValues->GetBindingSet() == this)
-     *
-     * @param aSubject subject of the RDF triple
-     * @param aPredicate predicate of the RDF triple
-     * @param aTarget target of the RDF triple
-     * @param aMemberVariable member variable for the query for the binding
-     * @param aResult result to synchronize
-     * @param aBindingValues the values for the bindings for the result
-     */
-    bool
-    SyncAssignments(nsIRDFResource* aSubject,
-                    nsIRDFResource* aPredicate,
-                    nsIRDFNode* aTarget,
-                    nsAtom* aMemberVariable,
-                    nsXULTemplateResultRDF* aResult,
-                    nsBindingValues& aBindingValues);
-
-    /*
-     * The query processor maintains a map of subjects to an array of results.
-     * This is used such that when a new assertion is added to the RDF graph,
-     * the results associated with the subject of that triple may be checked
-     * to see if their bindings have changed. The AddDependencies method adds
-     * these subject dependencies to the map.
-     */
-    void
-    AddDependencies(nsIRDFResource* aSubject,
-                    nsXULTemplateResultRDF* aResult);
-
-    /*
-     * Remove the results from the dependencies map when results are deleted.
-     */
-    void
-    RemoveDependencies(nsIRDFResource* aSubject,
-                       nsXULTemplateResultRDF* aResult);
-
-    /*
-     * The nsBindingValues classes stores an array of values, one for each
-     * target symbol that could be set by the bindings in the set.
-     * LookupTargetIndex determines the index into the array for a given
-     * target symbol.
-     */
-    int32_t
-    LookupTargetIndex(nsAtom* aTargetVariable, RDFBinding** aBinding);
-};
-
-/*
- * A set of values of bindings. This object is used once per result.
- * This stores a reference to the binding set and an array of node values.
- * Since the binding set is used once per query and the values are
- * used once per result, we reduce size by only storing the value array's
- * length in the binding set. This is possible since the array is always
- * a fixed length for a particular binding set.
- *
- * XXX ndeakin We may want to revisit this later since it makes the code
- *             more complicated.
- */
-class nsBindingValues
-{
-protected:
-
-    // the binding set
-    RefPtr<RDFBindingSet> mBindings;
-
-    /*
-     * A set of values for variable bindings. To look up a binding value,
-     * scan through the binding set in mBindings for the right target atom.
-     * Its index will correspond to the index in this array. The size of this
-     * array is determined by the RDFBindingSet's Count().
-     */
-    nsCOMPtr<nsIRDFNode>* mValues;
-
-public:
-
-    nsBindingValues()
-      : mBindings(nullptr),
-        mValues(nullptr)
-    {
-        MOZ_COUNT_CTOR(nsBindingValues);
-    }
-
-    ~nsBindingValues();
-
-
-    /**
-     * Clear the binding set, to be called when the nsBindingValues is deleted
-     * or a new binding set is being set.
-     */
-    void ClearBindingSet();
-
-    RDFBindingSet* GetBindingSet() { return mBindings; }
-
-    /**
-     * Set the binding set to use. This needs to be called once a rule matches
-     * since it is then known which bindings will apply.
-     */
-    nsresult SetBindingSet(RDFBindingSet* aBindings);
-
-    nsCOMPtr<nsIRDFNode>* ValuesArray() { return mValues; }
-
-    /*
-     * Retrieve the assignment for a particular variable
-     */
-    void
-    GetAssignmentFor(nsXULTemplateResultRDF* aResult,
-                     nsAtom* aVar,
-                     nsIRDFNode** aValue);
-
-    /*
-     * Remove depenedencies the bindings have on particular resources
-     */
-    void
-    RemoveDependencies(nsIRDFResource* aSubject,
-                       nsXULTemplateResultRDF* aResult);
-};
-
-#endif // nsRDFBinding_h__
deleted file mode 100644
--- a/dom/xul/templates/nsRDFConInstanceTestNode.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIComponentManager.h"
-#include "nsIRDFContainer.h"
-#include "nsIRDFContainerUtils.h"
-#include "nsIServiceManager.h"
-#include "nsRDFCID.h"
-#include "nsRDFConInstanceTestNode.h"
-#include "nsResourceSet.h"
-
-#include "mozilla/Logging.h"
-#include "nsXULContentUtils.h"
-
-using mozilla::LogLevel;
-
-extern mozilla::LazyLogModule gXULTemplateLog;
-
-static const char*
-TestToString(nsRDFConInstanceTestNode::Test aTest) {
-    switch (aTest) {
-    case nsRDFConInstanceTestNode::eFalse:    return "false";
-    case nsRDFConInstanceTestNode::eTrue:     return "true";
-    case nsRDFConInstanceTestNode::eDontCare: return "dontcare";
-    }
-    return "?";
-}
-
-nsRDFConInstanceTestNode::nsRDFConInstanceTestNode(TestNode* aParent,
-                                                   nsXULTemplateQueryProcessorRDF* aProcessor,
-                                                   nsAtom* aContainerVariable,
-                                                   Test aContainer,
-                                                   Test aEmpty)
-    : nsRDFTestNode(aParent),
-      mProcessor(aProcessor),
-      mContainerVariable(aContainerVariable),
-      mContainer(aContainer),
-      mEmpty(aEmpty)
-{
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        nsAutoCString props;
-
-        nsResourceSet& containmentProps = aProcessor->ContainmentProperties();
-        nsResourceSet::ConstIterator last = containmentProps.Last();
-        nsResourceSet::ConstIterator first = containmentProps.First();
-        nsResourceSet::ConstIterator iter;
-
-        for (iter = first; iter != last; ++iter) {
-            if (iter != first)
-                props += " ";
-
-            const char* str;
-            iter->GetValueConst(&str);
-
-            props += str;
-        }
-
-        nsAutoString cvar(NS_LITERAL_STRING("(none)"));
-        if (mContainerVariable)
-            mContainerVariable->ToString(cvar);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFConInstanceTestNode[%p]: parent=%p member-props=(%s) container-var=%s container=%s empty=%s",
-                this,
-                aParent,
-                props.get(),
-                NS_ConvertUTF16toUTF8(cvar).get(),
-                TestToString(aContainer),
-                TestToString(aEmpty)));
-    }
-}
-
-nsresult
-nsRDFConInstanceTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
-                                               bool* aCantHandleYet) const
-{
-    nsresult rv;
-
-    if (aCantHandleYet)
-        *aCantHandleYet = false;
-
-    nsCOMPtr<nsIRDFContainerUtils> rdfc
-        = do_GetService("@mozilla.org/rdf/container-utils;1");
-
-    if (! rdfc)
-        return NS_ERROR_FAILURE;
-
-    nsIRDFDataSource* ds = mProcessor->GetDataSource();
-
-    InstantiationSet::Iterator last = aInstantiations.Last();
-    for (InstantiationSet::Iterator inst = aInstantiations.First(); inst != last; ++inst) {
-        nsCOMPtr<nsIRDFNode> value;
-        if (! inst->mAssignments.GetAssignmentFor(mContainerVariable, getter_AddRefs(value))) {
-            NS_ERROR("can't do unbounded container testing");
-            return NS_ERROR_UNEXPECTED;
-        }
-
-        nsCOMPtr<nsIRDFResource> valueres = do_QueryInterface(value);
-        if (! valueres) {
-            aInstantiations.Erase(inst--);
-            continue;
-        }
-
-        if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-            const char* container = "(unbound)";
-            valueres->GetValueConst(&container);
-
-            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                   ("nsRDFConInstanceTestNode[%p]::FilterInstantiations() container=[%s]",
-                    this, container));
-        }
-
-        nsCOMPtr<nsIRDFContainer> rdfcontainer;
-
-        bool isRDFContainer;
-        rv = rdfc->IsContainer(ds, valueres, &isRDFContainer);
-        if (NS_FAILED(rv)) return rv;
-
-        if (mEmpty != eDontCare || mContainer != eDontCare) {
-            Test empty = eDontCare;
-            Test container = eDontCare;
-
-            if (isRDFContainer) {
-                // It's an RDF container. Use the container utilities
-                // to deduce what's in it.
-                container = eTrue;
-
-                // XXX should cache the factory
-                rdfcontainer = do_CreateInstance("@mozilla.org/rdf/container;1", &rv);
-                if (NS_FAILED(rv)) return rv;
-
-                rv = rdfcontainer->Init(ds, valueres);
-                if (NS_FAILED(rv)) return rv;
-
-                int32_t count;
-                rv = rdfcontainer->GetCount(&count);
-                if (NS_FAILED(rv)) return rv;
-
-                empty = (count == 0) ? eTrue : eFalse;
-            } else {
-                empty = eTrue;
-                container = eFalse;
-
-                // First do the simple check of finding some outward
-                // arcs; there should be only a few containment arcs, so this can
-                // save us time from dealing with an iterator later on
-                nsResourceSet& containmentProps = mProcessor->ContainmentProperties();
-                for (nsResourceSet::ConstIterator property = containmentProps.First();
-                     property != containmentProps.Last();
-                     ++property) {
-                    nsCOMPtr<nsIRDFNode> target;
-                    rv = ds->GetTarget(valueres, *property, true, getter_AddRefs(target));
-                    if (NS_FAILED(rv)) return rv;
-
-                    if (target != nullptr) {
-                        // bingo. we found one.
-                        empty = eFalse;
-                        container = eTrue;
-                        break;
-                    }
-                }
-
-                // if we still don't think its a container, but we
-                // want to know for sure whether it is or not, we need
-                // to check ArcLabelsOut for potential container arcs.
-                if (container == eFalse && mContainer != eDontCare) {
-                    nsCOMPtr<nsISimpleEnumerator> arcsout;
-                    rv = ds->ArcLabelsOut(valueres, getter_AddRefs(arcsout));
-                    if (NS_FAILED(rv)) return rv;
-
-                    while (1) {
-                        bool hasmore;
-                        rv = arcsout->HasMoreElements(&hasmore);
-                        if (NS_FAILED(rv)) return rv;
-
-                        if (! hasmore)
-                            break;
-
-                        nsCOMPtr<nsISupports> isupports;
-                        rv = arcsout->GetNext(getter_AddRefs(isupports));
-                        if (NS_FAILED(rv)) return rv;
-
-                        nsCOMPtr<nsIRDFResource> property = do_QueryInterface(isupports);
-                        NS_ASSERTION(property != nullptr, "not a property");
-                        if (! property)
-                            return NS_ERROR_UNEXPECTED;
-
-                        if (mProcessor->ContainmentProperties().Contains(property)) {
-                            container = eTrue;
-                            break;
-                        }
-                    }
-                }
-            }
-
-            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                   ("    empty => %s",
-                    (empty == mEmpty) ? "consistent" : "inconsistent"));
-
-            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                   ("    container => %s",
-                    (container == mContainer) ? "consistent" : "inconsistent"));
-
-            if (((mEmpty == empty) && (mContainer == container)) ||
-                ((mEmpty == eDontCare) && (mContainer == container)) ||
-                ((mContainer == eDontCare) && (mEmpty == empty)))
-            {
-                Element* element =
-                    new nsRDFConInstanceTestNode::Element(valueres, container, empty);
-                inst->AddSupportingElement(element);
-            }
-            else {
-                aInstantiations.Erase(inst--);
-            }
-        }
-    }
-
-    return NS_OK;
-}
-
-bool
-nsRDFConInstanceTestNode::CanPropagate(nsIRDFResource* aSource,
-                                       nsIRDFResource* aProperty,
-                                       nsIRDFNode* aTarget,
-                                       Instantiation& aInitialBindings) const
-{
-    nsresult rv;
-
-    bool canpropagate = false;
-
-    nsCOMPtr<nsIRDFContainerUtils> rdfc
-        = do_GetService("@mozilla.org/rdf/container-utils;1");
-
-    if (! rdfc)
-        return false;
-
-    // We can certainly propagate ordinal properties
-    rv = rdfc->IsOrdinalProperty(aProperty, &canpropagate);
-    if (NS_FAILED(rv)) return false;
-
-    if (! canpropagate) {
-        canpropagate = mProcessor->ContainmentProperties().Contains(aProperty);
-    }
-
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        const char* source;
-        aSource->GetValueConst(&source);
-
-        const char* property;
-        aProperty->GetValueConst(&property);
-
-        nsAutoString target;
-        nsXULContentUtils::GetTextForNode(aTarget, target);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFConInstanceTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s",
-                this, source, property, NS_ConvertUTF16toUTF8(target).get(),
-                canpropagate ? "true" : "false"));
-    }
-
-    if (canpropagate) {
-        aInitialBindings.AddAssignment(mContainerVariable, aSource);
-        return true;
-    }
-
-    return false;
-}
-
-void
-nsRDFConInstanceTestNode::Retract(nsIRDFResource* aSource,
-                                  nsIRDFResource* aProperty,
-                                  nsIRDFNode* aTarget) const
-{
-    // XXXwaterson oof. complicated. figure this out.
-    if (0) {
-        mProcessor->RetractElement(Element(aSource, mContainer, mEmpty));
-    }
-}
-
deleted file mode 100644
--- a/dom/xul/templates/nsRDFConInstanceTestNode.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsRDFConInstanceTestNode_h__
-#define nsRDFConInstanceTestNode_h__
-
-#include "mozilla/Attributes.h"
-#include "nscore.h"
-#include "nsRDFTestNode.h"
-#include "nsIRDFResource.h"
-#include "nsIRDFDataSource.h"
-#include "nsXULTemplateQueryProcessorRDF.h"
-
-/**
- * Rule network node that tests if a resource is an RDF container, or
- * uses multi-attributes to ``contain'' other elements.
- */
-class nsRDFConInstanceTestNode : public nsRDFTestNode
-{
-public:
-    enum Test { eFalse, eTrue, eDontCare };
-
-    nsRDFConInstanceTestNode(TestNode* aParent,
-                             nsXULTemplateQueryProcessorRDF* aProcessor,
-                             nsAtom* aContainerVariable,
-                             Test aContainer,
-                             Test aEmpty);
-
-    virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations,
-                                          bool* aCantHandleYet) const override;
-
-    virtual bool
-    CanPropagate(nsIRDFResource* aSource,
-                 nsIRDFResource* aProperty,
-                 nsIRDFNode* aTarget,
-                 Instantiation& aInitialBindings) const override;
-
-    virtual void
-    Retract(nsIRDFResource* aSource,
-            nsIRDFResource* aProperty,
-            nsIRDFNode* aTarget) const override;
-
-
-    class Element : public MemoryElement {
-    public:
-        Element(nsIRDFResource* aContainer,
-                Test aContainerTest,
-                Test aEmptyTest)
-            : mContainer(aContainer),
-              mContainerTest(aContainerTest),
-              mEmptyTest(aEmptyTest) {
-            MOZ_COUNT_CTOR(nsRDFConInstanceTestNode::Element); }
-
-        virtual ~Element() { MOZ_COUNT_DTOR(nsRDFConInstanceTestNode::Element); }
-
-        virtual const char* Type() const override {
-            return "nsRDFConInstanceTestNode::Element"; }
-
-        virtual PLHashNumber Hash() const override {
-            return mozilla::HashGeneric(mContainerTest, mEmptyTest, mContainer.get());
-        }
-
-        virtual bool Equals(const MemoryElement& aElement) const override {
-            if (aElement.Type() == Type()) {
-                const Element& element = static_cast<const Element&>(aElement);
-                return mContainer == element.mContainer
-                    && mContainerTest == element.mContainerTest
-                    && mEmptyTest == element.mEmptyTest;
-            }
-            return false; }
-
-    protected:
-        nsCOMPtr<nsIRDFResource> mContainer;
-        Test mContainerTest;
-        Test mEmptyTest;
-    };
-
-protected:
-    nsXULTemplateQueryProcessorRDF* mProcessor;
-    RefPtr<nsAtom> mContainerVariable;
-    Test mContainer;
-    Test mEmpty;
-};
-
-#endif // nsRDFConInstanceTestNode_h__
-
deleted file mode 100644
--- a/dom/xul/templates/nsRDFConMemberTestNode.cpp
+++ /dev/null
@@ -1,510 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsRDFConMemberTestNode.h"
-#include "nsIRDFContainer.h"
-#include "nsIRDFContainerUtils.h"
-#include "nsRDFCID.h"
-#include "nsIServiceManager.h"
-#include "nsResourceSet.h"
-#include "nsString.h"
-#include "nsXULContentUtils.h"
-
-#include "mozilla/Logging.h"
-
-using mozilla::LogLevel;
-
-extern mozilla::LazyLogModule gXULTemplateLog;
-
-nsRDFConMemberTestNode::nsRDFConMemberTestNode(TestNode* aParent,
-                                               nsXULTemplateQueryProcessorRDF* aProcessor,
-                                               nsAtom *aContainerVariable,
-                                               nsAtom *aMemberVariable)
-    : nsRDFTestNode(aParent),
-      mProcessor(aProcessor),
-      mContainerVariable(aContainerVariable),
-      mMemberVariable(aMemberVariable)
-{
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        nsAutoCString props;
-
-        nsResourceSet& containmentProps = aProcessor->ContainmentProperties();
-        nsResourceSet::ConstIterator last = containmentProps.Last();
-        nsResourceSet::ConstIterator first = containmentProps.First();
-        nsResourceSet::ConstIterator iter;
-
-        for (iter = first; iter != last; ++iter) {
-            if (iter != first)
-                props += " ";
-
-            const char* str;
-            iter->GetValueConst(&str);
-
-            props += str;
-        }
-
-        nsAutoString cvar(NS_LITERAL_STRING("(none)"));
-        if (mContainerVariable)
-            mContainerVariable->ToString(cvar);
-
-        nsAutoString mvar(NS_LITERAL_STRING("(none)"));
-        if (mMemberVariable)
-            mMemberVariable->ToString(mvar);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFConMemberTestNode[%p]: parent=%p member-props=(%s) container-var=%s member-var=%s",
-                this,
-                aParent,
-                props.get(),
-                NS_ConvertUTF16toUTF8(cvar).get(),
-                NS_ConvertUTF16toUTF8(mvar).get()));
-    }
-}
-
-nsresult
-nsRDFConMemberTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
-                                             bool* aCantHandleYet) const
-{
-    // XXX Uh, factor me, please!
-    nsresult rv;
-
-    if (aCantHandleYet)
-        *aCantHandleYet = false;
-
-    nsCOMPtr<nsIRDFContainerUtils> rdfc =
-        do_GetService("@mozilla.org/rdf/container-utils;1");
-
-    if (! rdfc)
-        return NS_ERROR_FAILURE;
-
-    nsIRDFDataSource* ds = mProcessor->GetDataSource();
-
-    InstantiationSet::Iterator last = aInstantiations.Last();
-    for (InstantiationSet::Iterator inst = aInstantiations.First(); inst != last; ++inst) {
-        bool hasContainerBinding;
-        nsCOMPtr<nsIRDFNode> containerValue;
-        hasContainerBinding = inst->mAssignments.GetAssignmentFor(mContainerVariable,
-                                                                  getter_AddRefs(containerValue));
-
-        nsCOMPtr<nsIRDFResource> containerRes = do_QueryInterface(containerValue);
-
-        nsCOMPtr<nsIRDFContainer> rdfcontainer;
-
-        if (hasContainerBinding && containerRes) {
-            // If we have a container assignment, then see if the
-            // container is an RDF container (bag, seq, alt), and if
-            // so, wrap it.
-            bool isRDFContainer;
-            rv = rdfc->IsContainer(ds, containerRes, &isRDFContainer);
-            if (NS_FAILED(rv)) return rv;
-
-            if (isRDFContainer) {
-                rdfcontainer = do_CreateInstance("@mozilla.org/rdf/container;1", &rv);
-                if (NS_FAILED(rv)) return rv;
-
-                rv = rdfcontainer->Init(ds, containerRes);
-                if (NS_FAILED(rv)) return rv;
-            }
-        }
-
-        bool hasMemberBinding;
-        nsCOMPtr<nsIRDFNode> memberValue;
-        hasMemberBinding = inst->mAssignments.GetAssignmentFor(mMemberVariable,
-                                                               getter_AddRefs(memberValue));
-
-        if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-            const char* container = "(unbound)";
-            if (hasContainerBinding)
-                containerRes->GetValueConst(&container);
-
-            nsAutoString member(NS_LITERAL_STRING("(unbound)"));
-            if (hasMemberBinding)
-                nsXULContentUtils::GetTextForNode(memberValue, member);
-
-            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                   ("nsRDFConMemberTestNode[%p]: FilterInstantiations() container=[%s] member=[%s]",
-                    this, container, NS_ConvertUTF16toUTF8(member).get()));
-        }
-
-        if (hasContainerBinding && hasMemberBinding) {
-            // it's a consistency check. see if we have a assignment that is consistent
-            bool isconsistent = false;
-
-            if (rdfcontainer) {
-                // RDF containers are easy. Just use the container API.
-                int32_t index;
-                rv = rdfcontainer->IndexOf(memberValue, &index);
-                if (NS_FAILED(rv)) return rv;
-
-                if (index >= 0)
-                    isconsistent = true;
-            }
-
-            // XXXwaterson oof. if we *are* an RDF container, why do
-            // we still need to grovel through all the containment
-            // properties if the thing we're looking for wasn't there?
-
-            if (! isconsistent) {
-                // Othewise, we'll need to grovel through the
-                // membership properties to see if we have an
-                // assertion that indicates membership.
-                nsResourceSet& containmentProps = mProcessor->ContainmentProperties();
-                for (nsResourceSet::ConstIterator property = containmentProps.First();
-                     property != containmentProps.Last();
-                     ++property) {
-                    bool hasAssertion;
-                    rv = ds->HasAssertion(containerRes,
-                                          *property,
-                                          memberValue,
-                                          true,
-                                          &hasAssertion);
-                    if (NS_FAILED(rv)) return rv;
-
-                    if (hasAssertion) {
-                        // it's consistent. leave it in the set and we'll
-                        // run it up to our parent.
-                        isconsistent = true;
-                        break;
-                    }
-                }
-            }
-
-            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                   ("    consistency check => %s", isconsistent ? "passed" : "failed"));
-
-            if (isconsistent) {
-                // Add a memory element to our set-of-support.
-                Element* element =
-                    new nsRDFConMemberTestNode::Element(containerRes,
-                                                        memberValue);
-                inst->AddSupportingElement(element);
-            }
-            else {
-                // it's inconsistent. remove it.
-                aInstantiations.Erase(inst--);
-            }
-
-            // We're done, go on to the next instantiation
-            continue;
-        }
-
-        if (hasContainerBinding && rdfcontainer) {
-            // We've got a container assignment, and the container is
-            // bound to an RDF container. Add each member as a new
-            // instantiation.
-            nsCOMPtr<nsISimpleEnumerator> elements;
-            rv = rdfcontainer->GetElements(getter_AddRefs(elements));
-            if (NS_FAILED(rv)) return rv;
-
-            while (1) {
-                bool hasmore;
-                rv = elements->HasMoreElements(&hasmore);
-                if (NS_FAILED(rv)) return rv;
-
-                if (! hasmore)
-                    break;
-
-                nsCOMPtr<nsISupports> isupports;
-                rv = elements->GetNext(getter_AddRefs(isupports));
-                if (NS_FAILED(rv)) return rv;
-
-                nsCOMPtr<nsIRDFNode> node = do_QueryInterface(isupports);
-                if (! node)
-                    return NS_ERROR_UNEXPECTED;
-
-                if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-                    nsAutoString member;
-                    nsXULContentUtils::GetTextForNode(node, member);
-
-                    MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                           ("    member => %s", NS_ConvertUTF16toUTF8(member).get()));
-                }
-
-                Instantiation newinst = *inst;
-                newinst.AddAssignment(mMemberVariable, node);
-
-                Element* element =
-                    new nsRDFConMemberTestNode::Element(containerRes, node);
-                newinst.AddSupportingElement(element);
-                aInstantiations.Insert(inst, newinst);
-            }
-        }
-
-        if (hasMemberBinding) {
-            // Oh, this is so nasty. If we have a member assignment, then
-            // grovel through each one of our inbound arcs to see if
-            // any of them are ordinal properties (like an RDF
-            // container might have). If so, walk it backwards to get
-            // the container we're in.
-            nsCOMPtr<nsISimpleEnumerator> arcsin;
-            rv = ds->ArcLabelsIn(memberValue, getter_AddRefs(arcsin));
-            if (NS_FAILED(rv)) return rv;
-
-            while (1) {
-                nsCOMPtr<nsIRDFResource> property;
-
-                {
-                    bool hasmore;
-                    rv = arcsin->HasMoreElements(&hasmore);
-                    if (NS_FAILED(rv)) return rv;
-
-                    if (! hasmore)
-                        break;
-
-                    nsCOMPtr<nsISupports> isupports;
-                    rv = arcsin->GetNext(getter_AddRefs(isupports));
-                    if (NS_FAILED(rv)) return rv;
-
-                    property = do_QueryInterface(isupports);
-                    if (! property)
-                        return NS_ERROR_UNEXPECTED;
-                }
-
-                // Ordinal properties automagically indicate container
-                // membership as far as we're concerned. Note that
-                // we're *only* concerned with ordinal properties
-                // here: the next block will worry about the other
-                // membership properties.
-                bool isordinal;
-                rv = rdfc->IsOrdinalProperty(property, &isordinal);
-                if (NS_FAILED(rv)) return rv;
-
-                if (isordinal) {
-                    // If we get here, we've found a property that
-                    // indicates container membership leading *into* a
-                    // member node. Find all the people that point to
-                    // it, and call them containers.
-                    nsCOMPtr<nsISimpleEnumerator> sources;
-                    rv = ds->GetSources(property, memberValue, true,
-                                        getter_AddRefs(sources));
-                    if (NS_FAILED(rv)) return rv;
-
-                    while (1) {
-                        bool hasmore;
-                        rv = sources->HasMoreElements(&hasmore);
-                        if (NS_FAILED(rv)) return rv;
-
-                        if (! hasmore)
-                            break;
-
-                        nsCOMPtr<nsISupports> isupports;
-                        rv = sources->GetNext(getter_AddRefs(isupports));
-                        if (NS_FAILED(rv)) return rv;
-
-                        nsCOMPtr<nsIRDFResource> source = do_QueryInterface(isupports);
-                        if (! source)
-                            return NS_ERROR_UNEXPECTED;
-
-                        if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-                            const char* container;
-                            source->GetValueConst(&container);
-
-                            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                                   ("    container => %s", container));
-                        }
-
-                        // Add a new instantiation
-                        Instantiation newinst = *inst;
-                        newinst.AddAssignment(mContainerVariable, source);
-
-                        Element* element =
-                            new nsRDFConMemberTestNode::Element(source,
-                                                                memberValue);
-                        newinst.AddSupportingElement(element);
-
-                        aInstantiations.Insert(inst, newinst);
-                    }
-                }
-            }
-        }
-
-        if ((hasContainerBinding && ! hasMemberBinding) ||
-            (! hasContainerBinding && hasMemberBinding)) {
-            // it's an open ended query on the container or member. go
-            // through our containment properties to see if anything
-            // applies.
-            nsResourceSet& containmentProps = mProcessor->ContainmentProperties();
-            for (nsResourceSet::ConstIterator property = containmentProps.First();
-                 property != containmentProps.Last();
-                 ++property) {
-                nsCOMPtr<nsISimpleEnumerator> results;
-                if (hasContainerBinding) {
-                    rv = ds->GetTargets(containerRes, *property, true,
-                                        getter_AddRefs(results));
-                }
-                else {
-                    rv = ds->GetSources(*property, memberValue, true,
-                                        getter_AddRefs(results));
-                }
-                if (NS_FAILED(rv)) return rv;
-
-                while (1) {
-                    bool hasmore;
-                    rv = results->HasMoreElements(&hasmore);
-                    if (NS_FAILED(rv)) return rv;
-
-                    if (! hasmore)
-                        break;
-
-                    nsCOMPtr<nsISupports> isupports;
-                    rv = results->GetNext(getter_AddRefs(isupports));
-                    if (NS_FAILED(rv)) return rv;
-
-                    nsAtom* variable;
-                    nsCOMPtr<nsIRDFNode> value;
-                    nsCOMPtr<nsIRDFResource> valueRes;
-
-                    if (hasContainerBinding) {
-                        variable = mMemberVariable;
-
-                        value = do_QueryInterface(isupports);
-                        NS_ASSERTION(value != nullptr, "member is not an nsIRDFNode");
-                        if (! value) continue;
-
-                        if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-                            nsAutoString s;
-                            nsXULContentUtils::GetTextForNode(value, s);
-
-                            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                                   ("    member => %s", NS_ConvertUTF16toUTF8(s).get()));
-                        }
-                    }
-                    else {
-                        variable = mContainerVariable;
-
-                        valueRes = do_QueryInterface(isupports);
-                        NS_ASSERTION(valueRes != nullptr, "container is not an nsIRDFResource");
-                        if (! valueRes) continue;
-
-                        value = valueRes;
-
-                        if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-                            const char* s;
-                            valueRes->GetValueConst(&s);
-
-                            MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-                                   ("    container => %s", s));
-                        }
-                    }
-
-                    // Copy the original instantiation, and add it to the
-                    // instantiation set with the new assignment that we've
-                    // introduced. Ownership will be transferred to the
-                    Instantiation newinst = *inst;
-                    newinst.AddAssignment(variable, value);
-
-                    Element* element;
-                    if (hasContainerBinding) {
-                        element =
-                            new nsRDFConMemberTestNode::Element(containerRes, value);
-                    }
-                    else {
-                        element =
-                            new nsRDFConMemberTestNode::Element(valueRes, memberValue);
-                    }
-
-                    if (! element)
-                        return NS_ERROR_OUT_OF_MEMORY;
-
-                    newinst.AddSupportingElement(element);
-
-                    aInstantiations.Insert(inst, newinst);
-                }
-            }
-        }
-
-        if (! hasContainerBinding && ! hasMemberBinding) {
-            // Neither container nor member assignment!
-            if (!aCantHandleYet) {
-                nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_MEMBER_UNBOUND);
-                return NS_ERROR_UNEXPECTED;
-            }
-
-            *aCantHandleYet = true;
-            return NS_OK;
-        }
-
-        // finally, remove the "under specified" instantiation.
-        aInstantiations.Erase(inst--);
-    }
-
-    return NS_OK;
-}
-
-bool
-nsRDFConMemberTestNode::CanPropagate(nsIRDFResource* aSource,
-                                     nsIRDFResource* aProperty,
-                                     nsIRDFNode* aTarget,
-                                     Instantiation& aInitialBindings) const
-{
-    nsresult rv;
-
-    bool canpropagate = false;
-
-    nsCOMPtr<nsIRDFContainerUtils> rdfc =
-        do_GetService("@mozilla.org/rdf/container-utils;1");
-
-    if (! rdfc)
-        return false;
-
-    // We can certainly propagate ordinal properties
-    rv = rdfc->IsOrdinalProperty(aProperty, &canpropagate);
-    if (NS_FAILED(rv)) return false;
-
-    if (! canpropagate) {
-        canpropagate = mProcessor->ContainmentProperties().Contains(aProperty);
-    }
-
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        const char* source;
-        aSource->GetValueConst(&source);
-
-        const char* property;
-        aProperty->GetValueConst(&property);
-
-        nsAutoString target;
-        nsXULContentUtils::GetTextForNode(aTarget, target);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFConMemberTestNode[%p]: CanPropagate([%s]==[%s]=>[%s]) => %s",
-                this, source, property, NS_ConvertUTF16toUTF8(target).get(),
-                canpropagate ? "true" : "false"));
-    }
-
-    if (canpropagate) {
-        aInitialBindings.AddAssignment(mContainerVariable, aSource);
-        aInitialBindings.AddAssignment(mMemberVariable, aTarget);
-        return true;
-    }
-
-    return false;
-}
-
-void
-nsRDFConMemberTestNode::Retract(nsIRDFResource* aSource,
-                                nsIRDFResource* aProperty,
-                                nsIRDFNode* aTarget) const
-{
-    bool canretract = false;
-
-    nsCOMPtr<nsIRDFContainerUtils> rdfc =
-        do_GetService("@mozilla.org/rdf/container-utils;1");
-
-    if (! rdfc)
-        return;
-
-    // We can certainly retract ordinal properties
-    nsresult rv;
-    rv = rdfc->IsOrdinalProperty(aProperty, &canretract);
-    if (NS_FAILED(rv)) return;
-
-    if (! canretract) {
-        canretract = mProcessor->ContainmentProperties().Contains(aProperty);
-    }
-
-    if (canretract) {
-        mProcessor->RetractElement(Element(aSource, aTarget));
-    }
-}
deleted file mode 100644
--- a/dom/xul/templates/nsRDFConMemberTestNode.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsRDFConMemberTestNode_h__
-#define nsRDFConMemberTestNode_h__
-
-#include "mozilla/Attributes.h"
-#include "nscore.h"
-#include "nsRDFTestNode.h"
-#include "nsIRDFDataSource.h"
-#include "nsXULTemplateQueryProcessorRDF.h"
-
-/**
- * Rule network node that test if a resource is a member of an RDF
- * container, or is ``contained'' by another resource that refers to
- * it using a ``containment'' attribute.
- */
-class nsRDFConMemberTestNode : public nsRDFTestNode
-{
-public:
-    nsRDFConMemberTestNode(TestNode* aParent,
-                           nsXULTemplateQueryProcessorRDF* aProcessor,
-                           nsAtom* aContainerVariable,
-                           nsAtom* aMemberVariable);
-
-    virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations,
-                                          bool* aCantHandleYet) const override;
-
-    virtual bool
-    CanPropagate(nsIRDFResource* aSource,
-                 nsIRDFResource* aProperty,
-                 nsIRDFNode* aTarget,
-                 Instantiation& aInitialBindings) const override;
-
-    virtual void
-    Retract(nsIRDFResource* aSource,
-            nsIRDFResource* aProperty,
-            nsIRDFNode* aTarget) const override;
-
-    class Element : public MemoryElement {
-    public:
-        Element(nsIRDFResource* aContainer,
-                nsIRDFNode* aMember)
-            : mContainer(aContainer),
-              mMember(aMember) {
-            MOZ_COUNT_CTOR(nsRDFConMemberTestNode::Element); }
-
-        virtual ~Element() { MOZ_COUNT_DTOR(nsRDFConMemberTestNode::Element); }
-
-        virtual const char* Type() const override {
-            return "nsRDFConMemberTestNode::Element"; }
-
-        virtual PLHashNumber Hash() const override {
-            return PLHashNumber(NS_PTR_TO_INT32(mContainer.get())) ^
-                (PLHashNumber(NS_PTR_TO_INT32(mMember.get())) >> 12); }
-
-        virtual bool Equals(const MemoryElement& aElement) const override {
-            if (aElement.Type() == Type()) {
-                const Element& element = static_cast<const Element&>(aElement);
-                return mContainer == element.mContainer && mMember == element.mMember;
-            }
-            return false; }
-
-    protected:
-        nsCOMPtr<nsIRDFResource> mContainer;
-        nsCOMPtr<nsIRDFNode> mMember;
-    };
-
-protected:
-    nsXULTemplateQueryProcessorRDF* mProcessor;
-    RefPtr<nsAtom> mContainerVariable;
-    RefPtr<nsAtom> mMemberVariable;
-};
-
-#endif // nsRDFConMemberTestNode_h__
deleted file mode 100644
--- a/dom/xul/templates/nsRDFPropertyTestNode.cpp
+++ /dev/null
@@ -1,362 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsRDFPropertyTestNode.h"
-#include "nsString.h"
-#include "nsXULContentUtils.h"
-
-#include "mozilla/Logging.h"
-
-using mozilla::LogLevel;
-
-extern mozilla::LazyLogModule gXULTemplateLog;
-#include "nsIRDFLiteral.h"
-
-nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
-                                             nsXULTemplateQueryProcessorRDF* aProcessor,
-                                             nsAtom* aSourceVariable,
-                                             nsIRDFResource* aProperty,
-                                             nsAtom* aTargetVariable)
-    : nsRDFTestNode(aParent),
-      mProcessor(aProcessor),
-      mSourceVariable(aSourceVariable),
-      mSource(nullptr),
-      mProperty(aProperty),
-      mTargetVariable(aTargetVariable),
-      mTarget(nullptr)
-{
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        const char* prop = "(null)";
-        if (aProperty)
-            aProperty->GetValueConst(&prop);
-
-        nsAutoString svar(NS_LITERAL_STRING("(none)"));
-        if (mSourceVariable)
-            mSourceVariable->ToString(svar);
-
-        nsAutoString tvar(NS_LITERAL_STRING("(none)"));
-        if (mTargetVariable)
-            mTargetVariable->ToString(tvar);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
-                this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(tvar).get()));
-    }
-}
-
-
-nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
-                                             nsXULTemplateQueryProcessorRDF* aProcessor,
-                                             nsIRDFResource* aSource,
-                                             nsIRDFResource* aProperty,
-                                             nsAtom* aTargetVariable)
-    : nsRDFTestNode(aParent),
-      mProcessor(aProcessor),
-      mSourceVariable(nullptr),
-      mSource(aSource),
-      mProperty(aProperty),
-      mTargetVariable(aTargetVariable),
-      mTarget(nullptr)
-{
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        const char* source = "(null)";
-        if (aSource)
-            aSource->GetValueConst(&source);
-
-        const char* prop = "(null)";
-        if (aProperty)
-            aProperty->GetValueConst(&prop);
-
-        nsAutoString tvar(NS_LITERAL_STRING("(none)"));
-        if (mTargetVariable)
-            mTargetVariable->ToString(tvar);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
-                this, aParent, source, prop, NS_ConvertUTF16toUTF8(tvar).get()));
-    }
-}
-
-
-nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent,
-                                             nsXULTemplateQueryProcessorRDF* aProcessor,
-                                             nsAtom* aSourceVariable,
-                                             nsIRDFResource* aProperty,
-                                             nsIRDFNode* aTarget)
-    : nsRDFTestNode(aParent),
-      mProcessor(aProcessor),
-      mSourceVariable(aSourceVariable),
-      mSource(nullptr),
-      mProperty(aProperty),
-      mTargetVariable(nullptr),
-      mTarget(aTarget)
-{
-    if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) {
-        nsAutoString svar(NS_LITERAL_STRING("(none)"));
-        if (mSourceVariable)
-            mSourceVariable->ToString(svar);
-
-        const char* prop = "(null)";
-        if (aProperty)
-            aProperty->GetValueConst(&prop);
-
-        nsAutoString target;
-        nsXULContentUtils::GetTextForNode(aTarget, target);
-
-        MOZ_LOG(gXULTemplateLog, LogLevel::Debug,
-               ("nsRDFPropertyTestNode[%p]: parent=%p source=%s property=%s target=%s",
-                this, aParent, NS_ConvertUTF16toUTF8(svar).get(), prop, NS_ConvertUTF16toUTF8(target).get()));
-    }
-}
-
-
-nsresult
-nsRDFPropertyTestNode::FilterInstantiations(InstantiationSet& aInstantiations,
-                                            bool* aCantHandleYet) const
-{
-    nsresult rv;
-
-    if (aCantHandleYet)
-        *aCantHandleYet = false;
-
-    nsIRDFDataSource* ds = mProcessor->GetDataSource();
-
-    InstantiationSet::Iterator last = aInstantiations.Last();
-    for (InstantiationSet::Iterator inst = aInstantiations.First(); inst != last; ++inst) {
-        bool hasSourceBinding;
-        nsCOMPtr<nsIRDFResource> sourceRes;
-
-        if (mSource) {
-            hasSourceBinding = true;
-            sourceRes = mSource;
-        }
-        else {
-            nsCOMPtr<nsIRDFNode> sourceValue;
-            hasSourceBinding = inst->mAssignments.GetAssignmentFor(mSourceVariable,
-                                                                   getter_AddRefs(sourceValue));
-            sourceRes = do_QueryInterface(sourceValue);
-        }
-
-        bool hasTargetBinding;
-        nsCOMPtr<nsIRDFNode> targetValue;
-
-        if (mTarget) {
-            hasTa