mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
050a9a8980
--HG-- rename : content/xul/document/src/XULDocument.cpp => dom/xul/XULDocument.cpp rename : content/xul/document/src/XULDocument.h => dom/xul/XULDocument.h rename : content/xul/content/crashtests/107518-1.xml => dom/xul/crashtests/107518-1.xml rename : content/xul/content/crashtests/252448-1.xul => dom/xul/crashtests/252448-1.xul rename : content/xul/content/crashtests/253479-1.xul => dom/xul/crashtests/253479-1.xul rename : content/xul/content/crashtests/253479-2.xul => dom/xul/crashtests/253479-2.xul rename : content/xul/document/crashtests/326204-1.xul => dom/xul/crashtests/326204-1.xul rename : content/xul/content/crashtests/326644-1-inner.xul => dom/xul/crashtests/326644-1-inner.xul rename : content/xul/content/crashtests/326644-1.html => dom/xul/crashtests/326644-1.html rename : content/xul/content/crashtests/326644-2-inner.xul => dom/xul/crashtests/326644-2-inner.xul rename : content/xul/content/crashtests/326644-2.html => dom/xul/crashtests/326644-2.html rename : content/xul/content/crashtests/326864-1.xul => dom/xul/crashtests/326864-1.xul rename : content/xul/content/crashtests/326875-1.xul => dom/xul/crashtests/326875-1.xul rename : content/xul/content/crashtests/326881-1.xul => dom/xul/crashtests/326881-1.xul rename : content/xul/content/crashtests/329982-1.xhtml => dom/xul/crashtests/329982-1.xhtml rename : content/xul/content/crashtests/336096-1.xhtml => dom/xul/crashtests/336096-1.xhtml rename : content/xul/document/crashtests/344215-1.xul => dom/xul/crashtests/344215-1.xul rename : content/xul/content/crashtests/354611-1.html => dom/xul/crashtests/354611-1.html rename : content/xul/content/crashtests/360078-1.xhtml => dom/xul/crashtests/360078-1.xhtml rename : content/xul/content/crashtests/360078-1xbl.xml => dom/xul/crashtests/360078-1xbl.xml rename : content/xul/content/crashtests/363791-1.xul => dom/xul/crashtests/363791-1.xul rename : content/xul/content/crashtests/384740-1.xul => dom/xul/crashtests/384740-1.xul rename : content/xul/content/crashtests/384877-1-inner.xul => dom/xul/crashtests/384877-1-inner.xul rename : content/xul/content/crashtests/384877-1.html => dom/xul/crashtests/384877-1.html rename : content/xul/document/crashtests/386914-1-inner.xul => dom/xul/crashtests/386914-1-inner.xul rename : content/xul/document/crashtests/386914-1.html => dom/xul/crashtests/386914-1.html rename : content/xul/content/crashtests/386947-1.xul => dom/xul/crashtests/386947-1.xul rename : content/xul/content/crashtests/425821-1.xul => dom/xul/crashtests/425821-1.xul rename : content/xul/document/crashtests/428951-1.xul => dom/xul/crashtests/428951-1.xul rename : content/xul/content/crashtests/429085-1.xhtml => dom/xul/crashtests/429085-1.xhtml rename : content/xul/content/crashtests/431906-1-inner.xul => dom/xul/crashtests/431906-1-inner.xul rename : content/xul/content/crashtests/431906-1.html => dom/xul/crashtests/431906-1.html rename : content/xul/content/crashtests/451311-1.xul => dom/xul/crashtests/451311-1.xul rename : content/xul/content/crashtests/461917-1.xhtml => dom/xul/crashtests/461917-1.xhtml rename : content/xul/document/crashtests/468211-1.xul => dom/xul/crashtests/468211-1.xul rename : content/xul/document/crashtests/468211-2-binding.xml => dom/xul/crashtests/468211-2-binding.xml rename : content/xul/document/crashtests/468211-2.xul => dom/xul/crashtests/468211-2.xul rename : content/xul/document/crashtests/468211-3.xul => dom/xul/crashtests/468211-3.xul rename : content/xul/document/crashtests/495635-1.xul => dom/xul/crashtests/495635-1.xul rename : content/xul/content/crashtests/509719-1-overlay.xul => dom/xul/crashtests/509719-1-overlay.xul rename : content/xul/content/crashtests/509719-1.xul => dom/xul/crashtests/509719-1.xul rename : content/xul/content/crashtests/509719-2-overlay.xul => dom/xul/crashtests/509719-2-overlay.xul rename : content/xul/content/crashtests/509719-2.xul => dom/xul/crashtests/509719-2.xul rename : content/xul/document/crashtests/583230.xul => dom/xul/crashtests/583230.xul rename : content/xul/content/crashtests/crashtests.list => dom/xul/crashtests/crashtests.list rename : content/xul/document/crashtests/extA1.xul => dom/xul/crashtests/extA1.xul rename : content/xul/document/crashtests/extA2.xul => dom/xul/crashtests/extA2.xul rename : content/xul/document/crashtests/extB1.xul => dom/xul/crashtests/extB1.xul rename : content/xul/moz.build => dom/xul/moz.build rename : content/xul/document/src/nsForwardReference.h => dom/xul/nsForwardReference.h rename : content/xul/document/public/nsIController.idl => dom/xul/nsIController.idl rename : content/xul/document/public/nsIControllers.idl => dom/xul/nsIControllers.idl rename : content/xul/content/public/nsIXULContextMenuBuilder.idl => dom/xul/nsIXULContextMenuBuilder.idl rename : content/xul/document/public/nsIXULDocument.h => dom/xul/nsIXULDocument.h rename : content/xul/document/public/nsIXULOverlayProvider.idl => dom/xul/nsIXULOverlayProvider.idl rename : content/xul/document/src/nsXULCommandDispatcher.cpp => dom/xul/nsXULCommandDispatcher.cpp rename : content/xul/document/src/nsXULCommandDispatcher.h => dom/xul/nsXULCommandDispatcher.h rename : content/xul/document/src/nsXULContentSink.cpp => dom/xul/nsXULContentSink.cpp rename : content/xul/document/src/nsXULContentSink.h => dom/xul/nsXULContentSink.h rename : content/xul/content/src/nsXULContextMenuBuilder.cpp => dom/xul/nsXULContextMenuBuilder.cpp rename : content/xul/content/src/nsXULContextMenuBuilder.h => dom/xul/nsXULContextMenuBuilder.h rename : content/xul/document/src/nsXULControllers.cpp => dom/xul/nsXULControllers.cpp rename : content/xul/document/src/nsXULControllers.h => dom/xul/nsXULControllers.h rename : content/xul/content/src/nsXULElement.cpp => dom/xul/nsXULElement.cpp rename : content/xul/content/src/nsXULElement.h => dom/xul/nsXULElement.h rename : content/xul/content/src/nsXULPopupListener.cpp => dom/xul/nsXULPopupListener.cpp rename : content/xul/content/src/nsXULPopupListener.h => dom/xul/nsXULPopupListener.h rename : content/xul/document/src/nsXULPrototypeCache.cpp => dom/xul/nsXULPrototypeCache.cpp rename : content/xul/document/src/nsXULPrototypeCache.h => dom/xul/nsXULPrototypeCache.h rename : content/xul/document/src/nsXULPrototypeDocument.cpp => dom/xul/nsXULPrototypeDocument.cpp rename : content/xul/document/src/nsXULPrototypeDocument.h => dom/xul/nsXULPrototypeDocument.h rename : content/xul/templates/src/crashtests/257752-1-recursion.rdf => dom/xul/templates/crashtests/257752-1-recursion.rdf rename : content/xul/templates/src/crashtests/257752-1-recursion.xul => dom/xul/templates/crashtests/257752-1-recursion.xul rename : content/xul/templates/src/crashtests/329884-1.xul => dom/xul/templates/crashtests/329884-1.xul rename : content/xul/templates/src/crashtests/330012-1.rdf => dom/xul/templates/crashtests/330012-1.rdf rename : content/xul/templates/src/crashtests/330012-1.xul => dom/xul/templates/crashtests/330012-1.xul rename : content/xul/templates/src/crashtests/404346-1.xul => dom/xul/templates/crashtests/404346-1.xul rename : content/xul/templates/src/crashtests/415019-1.xul => dom/xul/templates/crashtests/415019-1.xul rename : content/xul/templates/src/crashtests/417840-1.xul => dom/xul/templates/crashtests/417840-1.xul rename : content/xul/templates/src/crashtests/424418-1.xul => dom/xul/templates/crashtests/424418-1.xul rename : content/xul/templates/src/crashtests/crashtests.list => dom/xul/templates/crashtests/crashtests.list rename : content/xul/templates/moz.build => dom/xul/templates/moz.build rename : content/xul/templates/src/nsContentSupportMap.cpp => dom/xul/templates/nsContentSupportMap.cpp rename : content/xul/templates/src/nsContentSupportMap.h => dom/xul/templates/nsContentSupportMap.h rename : content/xul/templates/src/nsContentTestNode.cpp => dom/xul/templates/nsContentTestNode.cpp rename : content/xul/templates/src/nsContentTestNode.h => dom/xul/templates/nsContentTestNode.h rename : content/xul/templates/public/nsIXULBuilderListener.idl => dom/xul/templates/nsIXULBuilderListener.idl rename : content/xul/templates/public/nsIXULSortService.idl => dom/xul/templates/nsIXULSortService.idl rename : content/xul/templates/public/nsIXULTemplateBuilder.idl => dom/xul/templates/nsIXULTemplateBuilder.idl rename : content/xul/templates/public/nsIXULTemplateQueryProcessor.idl => dom/xul/templates/nsIXULTemplateQueryProcessor.idl rename : content/xul/templates/public/nsIXULTemplateResult.idl => dom/xul/templates/nsIXULTemplateResult.idl rename : content/xul/templates/public/nsIXULTemplateRuleFilter.idl => dom/xul/templates/nsIXULTemplateRuleFilter.idl rename : content/xul/templates/src/nsInstantiationNode.cpp => dom/xul/templates/nsInstantiationNode.cpp rename : content/xul/templates/src/nsInstantiationNode.h => dom/xul/templates/nsInstantiationNode.h rename : content/xul/templates/src/nsRDFBinding.cpp => dom/xul/templates/nsRDFBinding.cpp rename : content/xul/templates/src/nsRDFBinding.h => dom/xul/templates/nsRDFBinding.h rename : content/xul/templates/src/nsRDFConInstanceTestNode.cpp => dom/xul/templates/nsRDFConInstanceTestNode.cpp rename : content/xul/templates/src/nsRDFConInstanceTestNode.h => dom/xul/templates/nsRDFConInstanceTestNode.h rename : content/xul/templates/src/nsRDFConMemberTestNode.cpp => dom/xul/templates/nsRDFConMemberTestNode.cpp rename : content/xul/templates/src/nsRDFConMemberTestNode.h => dom/xul/templates/nsRDFConMemberTestNode.h rename : content/xul/templates/src/nsRDFPropertyTestNode.cpp => dom/xul/templates/nsRDFPropertyTestNode.cpp rename : content/xul/templates/src/nsRDFPropertyTestNode.h => dom/xul/templates/nsRDFPropertyTestNode.h rename : content/xul/templates/src/nsRDFQuery.cpp => dom/xul/templates/nsRDFQuery.cpp rename : content/xul/templates/src/nsRDFQuery.h => dom/xul/templates/nsRDFQuery.h rename : content/xul/templates/src/nsRDFTestNode.h => dom/xul/templates/nsRDFTestNode.h rename : content/xul/templates/src/nsResourceSet.cpp => dom/xul/templates/nsResourceSet.cpp rename : content/xul/templates/src/nsResourceSet.h => dom/xul/templates/nsResourceSet.h rename : content/xul/templates/src/nsRuleNetwork.cpp => dom/xul/templates/nsRuleNetwork.cpp rename : content/xul/templates/src/nsRuleNetwork.h => dom/xul/templates/nsRuleNetwork.h rename : content/xul/templates/src/nsTemplateMap.h => dom/xul/templates/nsTemplateMap.h rename : content/xul/templates/src/nsTemplateMatch.cpp => dom/xul/templates/nsTemplateMatch.cpp rename : content/xul/templates/src/nsTemplateMatch.h => dom/xul/templates/nsTemplateMatch.h rename : content/xul/templates/src/nsTemplateRule.cpp => dom/xul/templates/nsTemplateRule.cpp rename : content/xul/templates/src/nsTemplateRule.h => dom/xul/templates/nsTemplateRule.h rename : content/xul/templates/src/nsTreeRows.cpp => dom/xul/templates/nsTreeRows.cpp rename : content/xul/templates/src/nsTreeRows.h => dom/xul/templates/nsTreeRows.h rename : content/xul/templates/src/nsXMLBinding.cpp => dom/xul/templates/nsXMLBinding.cpp rename : content/xul/templates/src/nsXMLBinding.h => dom/xul/templates/nsXMLBinding.h rename : content/xul/templates/src/nsXULContentBuilder.cpp => dom/xul/templates/nsXULContentBuilder.cpp rename : content/xul/templates/src/nsXULContentUtils.cpp => dom/xul/templates/nsXULContentUtils.cpp rename : content/xul/templates/src/nsXULContentUtils.h => dom/xul/templates/nsXULContentUtils.h rename : content/xul/templates/src/nsXULResourceList.h => dom/xul/templates/nsXULResourceList.h rename : content/xul/templates/src/nsXULSortService.cpp => dom/xul/templates/nsXULSortService.cpp rename : content/xul/templates/src/nsXULSortService.h => dom/xul/templates/nsXULSortService.h rename : content/xul/templates/src/nsXULTemplateBuilder.cpp => dom/xul/templates/nsXULTemplateBuilder.cpp rename : content/xul/templates/src/nsXULTemplateBuilder.h => dom/xul/templates/nsXULTemplateBuilder.h rename : content/xul/templates/src/nsXULTemplateQueryProcessorRDF.cpp => dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp rename : content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h => dom/xul/templates/nsXULTemplateQueryProcessorRDF.h rename : content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp => dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp rename : content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h => dom/xul/templates/nsXULTemplateQueryProcessorStorage.h rename : content/xul/templates/src/nsXULTemplateQueryProcessorXML.cpp => dom/xul/templates/nsXULTemplateQueryProcessorXML.cpp rename : content/xul/templates/src/nsXULTemplateQueryProcessorXML.h => dom/xul/templates/nsXULTemplateQueryProcessorXML.h rename : content/xul/templates/src/nsXULTemplateResultRDF.cpp => dom/xul/templates/nsXULTemplateResultRDF.cpp rename : content/xul/templates/src/nsXULTemplateResultRDF.h => dom/xul/templates/nsXULTemplateResultRDF.h rename : content/xul/templates/src/nsXULTemplateResultSetRDF.cpp => dom/xul/templates/nsXULTemplateResultSetRDF.cpp rename : content/xul/templates/src/nsXULTemplateResultSetRDF.h => dom/xul/templates/nsXULTemplateResultSetRDF.h rename : content/xul/templates/src/nsXULTemplateResultStorage.cpp => dom/xul/templates/nsXULTemplateResultStorage.cpp rename : content/xul/templates/src/nsXULTemplateResultStorage.h => dom/xul/templates/nsXULTemplateResultStorage.h rename : content/xul/templates/src/nsXULTemplateResultXML.cpp => dom/xul/templates/nsXULTemplateResultXML.cpp rename : content/xul/templates/src/nsXULTemplateResultXML.h => dom/xul/templates/nsXULTemplateResultXML.h rename : content/xul/templates/src/nsXULTreeBuilder.cpp => dom/xul/templates/nsXULTreeBuilder.cpp rename : content/xul/templates/tests/chrome/animals.rdf => dom/xul/templates/tests/chrome/animals.rdf rename : content/xul/templates/tests/chrome/animals.sqlite => dom/xul/templates/tests/chrome/animals.sqlite rename : content/xul/templates/tests/chrome/animals.xml => dom/xul/templates/tests/chrome/animals.xml rename : content/xul/templates/tests/chrome/bug441785-1.rdf => dom/xul/templates/tests/chrome/bug441785-1.rdf rename : content/xul/templates/tests/chrome/bug441785-2.rdf => dom/xul/templates/tests/chrome/bug441785-2.rdf rename : content/xul/templates/tests/chrome/chrome.ini => dom/xul/templates/tests/chrome/chrome.ini rename : content/xul/templates/tests/chrome/file_bug330010.rdf => dom/xul/templates/tests/chrome/file_bug330010.rdf rename : content/xul/templates/tests/chrome/templates_shared.js => dom/xul/templates/tests/chrome/templates_shared.js rename : content/xul/templates/tests/chrome/test_bug329335.xul => dom/xul/templates/tests/chrome/test_bug329335.xul rename : content/xul/templates/tests/chrome/test_bug330010.xul => dom/xul/templates/tests/chrome/test_bug330010.xul rename : content/xul/templates/tests/chrome/test_bug397148.xul => dom/xul/templates/tests/chrome/test_bug397148.xul rename : content/xul/templates/tests/chrome/test_bug441785.xul => dom/xul/templates/tests/chrome/test_bug441785.xul rename : content/xul/templates/tests/chrome/test_bug476634.xul => dom/xul/templates/tests/chrome/test_bug476634.xul rename : content/xul/templates/tests/chrome/test_sortservice.xul => dom/xul/templates/tests/chrome/test_sortservice.xul rename : content/xul/templates/tests/chrome/test_tmpl_bindingsextendedsyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_bindingsextendedsyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_bindingsmultiple.xul => dom/xul/templates/tests/chrome/test_tmpl_bindingsmultiple.xul rename : content/xul/templates/tests/chrome/test_tmpl_bindingsquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_bindingsquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_bindingsreversed.xul => dom/xul/templates/tests/chrome/test_tmpl_bindingsreversed.xul rename : content/xul/templates/tests/chrome/test_tmpl_bindingssameastriple.xul => dom/xul/templates/tests/chrome/test_tmpl_bindingssameastriple.xul rename : content/xul/templates/tests/chrome/test_tmpl_containerandmembervariablechanged.xul => dom/xul/templates/tests/chrome/test_tmpl_containerandmembervariablechanged.xul rename : content/xul/templates/tests/chrome/test_tmpl_containervariablechanged.xul => dom/xul/templates/tests/chrome/test_tmpl_containervariablechanged.xul rename : content/xul/templates/tests/chrome/test_tmpl_containmentattribute.xul => dom/xul/templates/tests/chrome/test_tmpl_containmentattribute.xul rename : content/xul/templates/tests/chrome/test_tmpl_defaultcontainervariableisuri.xul => dom/xul/templates/tests/chrome/test_tmpl_defaultcontainervariableisuri.xul rename : content/xul/templates/tests/chrome/test_tmpl_errors.xul => dom/xul/templates/tests/chrome/test_tmpl_errors.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntaxemptyconditions.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxemptyconditions.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntaxotherrefvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxotherrefvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntaxremoveunmatched.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxremoveunmatched.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntaxsimplevariablesubstitution.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxsimplevariablesubstitution.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntaxtworulesrecurse.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxtworulesrecurse.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedsyntaxusinganinterveningcontainer.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedsyntaxusinganinterveningcontainer.xul rename : content/xul/templates/tests/chrome/test_tmpl_extendedvariablesubstitution.xul => dom/xul/templates/tests/chrome/test_tmpl_extendedvariablesubstitution.xul rename : content/xul/templates/tests/chrome/test_tmpl_gridelement.xul => dom/xul/templates/tests/chrome/test_tmpl_gridelement.xul rename : content/xul/templates/tests/chrome/test_tmpl_htmlelementextendedsyntaxwithbinding.xul => dom/xul/templates/tests/chrome/test_tmpl_htmlelementextendedsyntaxwithbinding.xul rename : content/xul/templates/tests/chrome/test_tmpl_htmlelementquerysyntaxrecursive.xul => dom/xul/templates/tests/chrome/test_tmpl_htmlelementquerysyntaxrecursive.xul rename : content/xul/templates/tests/chrome/test_tmpl_htmlelementquerysyntaxwithmultiplerules.xul => dom/xul/templates/tests/chrome/test_tmpl_htmlelementquerysyntaxwithmultiplerules.xul rename : content/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntaxusingatextnode.xul => dom/xul/templates/tests/chrome/test_tmpl_htmlelementsimplesyntaxusingatextnode.xul rename : content/xul/templates/tests/chrome/test_tmpl_invalidqp.xul => dom/xul/templates/tests/chrome/test_tmpl_invalidqp.xul rename : content/xul/templates/tests/chrome/test_tmpl_listboxelement.xul => dom/xul/templates/tests/chrome/test_tmpl_listboxelement.xul rename : content/xul/templates/tests/chrome/test_tmpl_literalasmember.xul => dom/xul/templates/tests/chrome/test_tmpl_literalasmember.xul rename : content/xul/templates/tests/chrome/test_tmpl_membervariablechanged.xul => dom/xul/templates/tests/chrome/test_tmpl_membervariablechanged.xul rename : content/xul/templates/tests/chrome/test_tmpl_membervariablesubstitution.xul => dom/xul/templates/tests/chrome/test_tmpl_membervariablesubstitution.xul rename : content/xul/templates/tests/chrome/test_tmpl_menuelement.xul => dom/xul/templates/tests/chrome/test_tmpl_menuelement.xul rename : content/xul/templates/tests/chrome/test_tmpl_menuelementrecursive.xul => dom/xul/templates/tests/chrome/test_tmpl_menuelementrecursive.xul rename : content/xul/templates/tests/chrome/test_tmpl_menulistelement.xul => dom/xul/templates/tests/chrome/test_tmpl_menulistelement.xul rename : content/xul/templates/tests/chrome/test_tmpl_mixedsyntaxiscontainer.xul => dom/xul/templates/tests/chrome/test_tmpl_mixedsyntaxiscontainer.xul rename : content/xul/templates/tests/chrome/test_tmpl_mixedsyntaxiscontainerisempty.xul => dom/xul/templates/tests/chrome/test_tmpl_mixedsyntaxiscontainerisempty.xul rename : content/xul/templates/tests/chrome/test_tmpl_mixedsyntaxisempty.xul => dom/xul/templates/tests/chrome/test_tmpl_mixedsyntaxisempty.xul rename : content/xul/templates/tests/chrome/test_tmpl_noaction.xul => dom/xul/templates/tests/chrome/test_tmpl_noaction.xul rename : content/xul/templates/tests/chrome/test_tmpl_noactionuriattribute.xul => dom/xul/templates/tests/chrome/test_tmpl_noactionuriattribute.xul rename : content/xul/templates/tests/chrome/test_tmpl_parentconditions.xul => dom/xul/templates/tests/chrome/test_tmpl_parentconditions.xul rename : content/xul/templates/tests/chrome/test_tmpl_parentcontenttag.xul => dom/xul/templates/tests/chrome/test_tmpl_parentcontenttag.xul rename : content/xul/templates/tests/chrome/test_tmpl_parentsimplesyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_parentsimplesyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_query3triples.xul => dom/xul/templates/tests/chrome/test_tmpl_query3triples.xul rename : content/xul/templates/tests/chrome/test_tmpl_query3tripleswherecontains.xul => dom/xul/templates/tests/chrome/test_tmpl_query3tripleswherecontains.xul rename : content/xul/templates/tests/chrome/test_tmpl_querymember3tripleswhereequals.xul => dom/xul/templates/tests/chrome/test_tmpl_querymember3tripleswhereequals.xul rename : content/xul/templates/tests/chrome/test_tmpl_querymemberandtwotriples.xul => dom/xul/templates/tests/chrome/test_tmpl_querymemberandtwotriples.xul rename : content/xul/templates/tests/chrome/test_tmpl_querymembertriplemembertriple.xul => dom/xul/templates/tests/chrome/test_tmpl_querymembertriplemembertriple.xul rename : content/xul/templates/tests/chrome/test_tmpl_queryresourcematch.xul => dom/xul/templates/tests/chrome/test_tmpl_queryresourcematch.xul rename : content/xul/templates/tests/chrome/test_tmpl_queryreversetriple.xul => dom/xul/templates/tests/chrome/test_tmpl_queryreversetriple.xul rename : content/xul/templates/tests/chrome/test_tmpl_queryselfwithtriple.xul => dom/xul/templates/tests/chrome/test_tmpl_queryselfwithtriple.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysetone.xul => dom/xul/templates/tests/chrome/test_tmpl_querysetone.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysettwo.xul => dom/xul/templates/tests/chrome/test_tmpl_querysettwo.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysettwowithcondition.xul => dom/xul/templates/tests/chrome/test_tmpl_querysettwowithcondition.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_querysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerules.xul => dom/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerules.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerulesfirstconditionall.xul => dom/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerulesfirstconditionall.xul rename : content/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerulestwoconditions.xul => dom/xul/templates/tests/chrome/test_tmpl_querysyntaxmultiplerulestwoconditions.xul rename : content/xul/templates/tests/chrome/test_tmpl_querytripleandmembermerge.xul => dom/xul/templates/tests/chrome/test_tmpl_querytripleandmembermerge.xul rename : content/xul/templates/tests/chrome/test_tmpl_querytripleobjecttosubject.xul => dom/xul/templates/tests/chrome/test_tmpl_querytripleobjecttosubject.xul rename : content/xul/templates/tests/chrome/test_tmpl_querytwomembers.xul => dom/xul/templates/tests/chrome/test_tmpl_querytwomembers.xul rename : content/xul/templates/tests/chrome/test_tmpl_querytwomembersfiltered.xul => dom/xul/templates/tests/chrome/test_tmpl_querytwomembersfiltered.xul rename : content/xul/templates/tests/chrome/test_tmpl_querytwotriples.xul => dom/xul/templates/tests/chrome/test_tmpl_querytwotriples.xul rename : content/xul/templates/tests/chrome/test_tmpl_queryupwardsmember.xul => dom/xul/templates/tests/chrome/test_tmpl_queryupwardsmember.xul rename : content/xul/templates/tests/chrome/test_tmpl_queryupwardsmembertripleandfilteringtriple.xul => dom/xul/templates/tests/chrome/test_tmpl_queryupwardsmembertripleandfilteringtriple.xul rename : content/xul/templates/tests/chrome/test_tmpl_querywithemptyconditions.xul => dom/xul/templates/tests/chrome/test_tmpl_querywithemptyconditions.xul rename : content/xul/templates/tests/chrome/test_tmpl_referenceasmember.xul => dom/xul/templates/tests/chrome/test_tmpl_referenceasmember.xul rename : content/xul/templates/tests/chrome/test_tmpl_regenerate.xul => dom/xul/templates/tests/chrome/test_tmpl_regenerate.xul rename : content/xul/templates/tests/chrome/test_tmpl_selfgenerationextendedsyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_selfgenerationextendedsyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_selfgenerationsimplesyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_selfgenerationsimplesyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxenclosedinacontainer.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxenclosedinacontainer.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxenclosedinacontainerwitharule.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxenclosedinacontainerwitharule.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilter.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilter.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilterwithmultiplerules.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilterwithmultiplerules.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilterwithrule.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxfilterwithrule.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxiteratingoverasinglevalue.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxiteratingoverasinglevalue.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxusinganinterveningcontainer.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusinganinterveningcontainer.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingatextnode.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingatextnode.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingcontainerasthegenerationelement.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingcontainerasthegenerationelement.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingdontrecurse.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingdontrecurse.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingrecursivegeneration.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingrecursivegeneration.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingrecursivegenerationagain.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxusingrecursivegenerationagain.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplesyntaxwithtwovariablesused.xul => dom/xul/templates/tests/chrome/test_tmpl_simplesyntaxwithtwovariablesused.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutioncaretsatbeginningandend.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutioncaretsatbeginningandend.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutioncaretsubstitution.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutioncaretsubstitution.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionnovariable.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionnovariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionquestionmarkaspartofvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionquestionmarkaspartofvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionquestionmarksubstitution.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionquestionmarksubstitution.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutiontextandvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutiontextandvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionvariableandtextconcatenated.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionvariableandtextconcatenated.xul rename : content/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionvariablesconcatenated.xul => dom/xul/templates/tests/chrome/test_tmpl_simplevariablesubstitutionvariablesconcatenated.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortascendinginteger.xul => dom/xul/templates/tests/chrome/test_tmpl_sortascendinginteger.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortascendingtworulesquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortascendingtworulesquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortascendingtworuleswithcontainerquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortascendingtworuleswithcontainerquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortascendingtworuleswithdifferentcontainerquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortascendingtworuleswithdifferentcontainerquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortdescendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortdescendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortquerymemberandtwotriples.xul => dom/xul/templates/tests/chrome/test_tmpl_sortquerymemberandtwotriples.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresource2descendingsimplesyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresource2descendingsimplesyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresource2settopredicateascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresource2settopredicateascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresource2settopredicatedescendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresource2settopredicatedescendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresourceascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresourceascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresourcedescendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresourcedescendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresourcesettopredicateascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresourcesettopredicateascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortresourcesettopredicatedescendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortresourcesettopredicatedescendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sorttworesourcesasstringsettopredicatedescendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sorttworesourcesasstringsettopredicatedescendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sorttworesourcessettopredicateascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sorttworesourcessettopredicateascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sorttwovariablesascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sorttwovariablesascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sorttwovariablesascendingsimplesyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sorttwovariablesascendingsimplesyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sorttwovariablesdescendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sorttwovariablesdescendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_sortunknownascendingquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_sortunknownascendingquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_2.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_2.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_3.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_bad_parameters_3.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_baddatasource.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_baddatasource.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_badquery.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_badquery.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_dynamicparameters.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_dynamicparameters.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_listbox.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_listbox.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_multiqueries.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_parameters.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_rule.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_rule.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_simple.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_simple.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerasc.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_sortintegerasc.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_sortintegerdesc.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_sortintegerdesc.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_sortstringasc.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_sortstringasc.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_sortstringdesc.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_sortstringdesc.xul rename : content/xul/templates/tests/chrome/test_tmpl_storage_tree.xul => dom/xul/templates/tests/chrome/test_tmpl_storage_tree.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntax.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntax.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxnotrecursive.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxnotrecursive.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxnotrecursivetreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxnotrecursivetreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursive.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursive.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivemultiplerules.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivemultiplerules.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivemultiplerulestreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivemultiplerulestreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivetreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxrecursivetreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxtreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementquerysyntaxtreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxnotrecursive.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxnotrecursive.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxnotrecursivetreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxnotrecursivetreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxrecursive.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxrecursive.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxrecursivetreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementsimplesyntaxrecursivetreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementtreecell.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecell.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementtreecellsortascending.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecellsortascending.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementtreecellsortascendingtreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecellsortascendingtreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementtreecelltreebuilder.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementtreecelltreebuilder.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementtreeitemonly.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementtreeitemonly.xul rename : content/xul/templates/tests/chrome/test_tmpl_treeelementtreeitemsortascending.xul => dom/xul/templates/tests/chrome/test_tmpl_treeelementtreeitemsortascending.xul rename : content/xul/templates/tests/chrome/test_tmpl_twogenerationnodes.xul => dom/xul/templates/tests/chrome/test_tmpl_twogenerationnodes.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereafterignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereafterignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereafterlowercase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereafterlowercase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereafternegation.xul => dom/xul/templates/tests/chrome/test_tmpl_whereafternegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereafteruppercase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereafteruppercase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherebeforeignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_wherebeforeignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherebeforelowercase.xul => dom/xul/templates/tests/chrome/test_tmpl_wherebeforelowercase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherebeforenegation.xul => dom/xul/templates/tests/chrome/test_tmpl_wherebeforenegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherebeforeuppercase.xul => dom/xul/templates/tests/chrome/test_tmpl_wherebeforeuppercase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontains.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontains.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontainsignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontainsignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontainsnegation.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontainsnegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontainsnumber.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontainsnumber.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontainsnumberstring.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontainsnumberstring.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontainsresource.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontainsresource.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherecontainstwo.xul => dom/xul/templates/tests/chrome/test_tmpl_wherecontainstwo.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereendswith.xul => dom/xul/templates/tests/chrome/test_tmpl_whereendswith.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereendswithignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereendswithignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereendswithnegation.xul => dom/xul/templates/tests/chrome/test_tmpl_whereendswithnegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequals.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequals.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsmultiple.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsmultiple.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsmultiplenegation.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsmultiplenegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsmultiplenegationignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsmultiplenegationignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsnegation.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsnegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsnegationignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsnegationignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsnegationwrongcase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsnegationwrongcase.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsnumber.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsnumber.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsothervariable.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsothervariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalsresource.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalsresource.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalssamevariable.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalssamevariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereequalswrongcase.xul => dom/xul/templates/tests/chrome/test_tmpl_whereequalswrongcase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wheregreater.xul => dom/xul/templates/tests/chrome/test_tmpl_wheregreater.xul rename : content/xul/templates/tests/chrome/test_tmpl_wheregreaternegation.xul => dom/xul/templates/tests/chrome/test_tmpl_wheregreaternegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_wheregreaternegationstring.xul => dom/xul/templates/tests/chrome/test_tmpl_wheregreaternegationstring.xul rename : content/xul/templates/tests/chrome/test_tmpl_wheregreaterstring.xul => dom/xul/templates/tests/chrome/test_tmpl_wheregreaterstring.xul rename : content/xul/templates/tests/chrome/test_tmpl_whereless.xul => dom/xul/templates/tests/chrome/test_tmpl_whereless.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherelessnegation.xul => dom/xul/templates/tests/chrome/test_tmpl_wherelessnegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherelessnegationstring.xul => dom/xul/templates/tests/chrome/test_tmpl_wherelessnegationstring.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherelessstring.xul => dom/xul/templates/tests/chrome/test_tmpl_wherelessstring.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherenorel.xul => dom/xul/templates/tests/chrome/test_tmpl_wherenorel.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherenosubject.xul => dom/xul/templates/tests/chrome/test_tmpl_wherenosubject.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherenovalue.xul => dom/xul/templates/tests/chrome/test_tmpl_wherenovalue.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherestartswith.xul => dom/xul/templates/tests/chrome/test_tmpl_wherestartswith.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherestartswithignorecase.xul => dom/xul/templates/tests/chrome/test_tmpl_wherestartswithignorecase.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherestartswithmultiple.xul => dom/xul/templates/tests/chrome/test_tmpl_wherestartswithmultiple.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherestartswithnegation.xul => dom/xul/templates/tests/chrome/test_tmpl_wherestartswithnegation.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherestartswithunknownvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_wherestartswithunknownvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_wherestartswithvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_wherestartswithvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_wheresubjectequalsvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_wheresubjectequalsvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_wheresubjectstartswithvariable.xul => dom/xul/templates/tests/chrome/test_tmpl_wheresubjectstartswithvariable.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerysimple.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerysimple.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithassign.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithassign.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithassignmentandcondition.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithassignmentandcondition.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithassignmentandconditiondontrecurse.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithassignmentandconditiondontrecurse.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginbindings.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginbindings.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginrule.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithbindinginrule.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithdifferentmember.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithdifferentmember.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithinlinedata.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithinlinedata.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithinlinedatawithmultiplequeries.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithinlinedatawithmultiplequeries.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithmultiplequeries.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithmultiplequeries.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithothertypes.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithothertypes.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithsort.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithsort.xul rename : content/xul/templates/tests/chrome/test_tmpl_xmlquerywithsortotherfield.xul => dom/xul/templates/tests/chrome/test_tmpl_xmlquerywithsortotherfield.xul rename : content/xul/content/test/398289-resource.xul => dom/xul/test/398289-resource.xul rename : content/xul/document/test/bug497875-iframe.xul => dom/xul/test/bug497875-iframe.xul rename : content/xul/content/test/chrome.ini => dom/xul/test/chrome.ini rename : content/xul/content/test/file_bug236853.rdf => dom/xul/test/file_bug236853.rdf rename : content/xul/content/test/mochitest.ini => dom/xul/test/mochitest.ini rename : content/xul/document/test/overlay1_bug335375.xul => dom/xul/test/overlay1_bug335375.xul rename : content/xul/document/test/overlay2_bug335375.xul => dom/xul/test/overlay2_bug335375.xul rename : content/xul/document/test/overlay_640158.xul => dom/xul/test/overlay_640158.xul rename : content/xul/document/test/test_bug199692.xul => dom/xul/test/test_bug199692.xul rename : content/xul/content/test/test_bug233643.xul => dom/xul/test/test_bug233643.xul rename : content/xul/content/test/test_bug236853.xul => dom/xul/test/test_bug236853.xul rename : content/xul/document/test/test_bug311681.xul => dom/xul/test/test_bug311681.xul rename : content/xul/document/test/test_bug335375.xul => dom/xul/test/test_bug335375.xul rename : content/xul/document/test/test_bug391002.xul => dom/xul/test/test_bug391002.xul rename : content/xul/content/test/test_bug398289.html => dom/xul/test/test_bug398289.html rename : content/xul/document/test/test_bug403868.xul => dom/xul/test/test_bug403868.xul rename : content/xul/document/test/test_bug414907.xul => dom/xul/test/test_bug414907.xul rename : content/xul/document/test/test_bug418216.xul => dom/xul/test/test_bug418216.xul rename : content/xul/document/test/test_bug445177.xul => dom/xul/test/test_bug445177.xul rename : content/xul/document/test/test_bug449457.xul => dom/xul/test/test_bug449457.xul rename : content/xul/document/test/test_bug468176.xul => dom/xul/test/test_bug468176.xul rename : content/xul/content/test/test_bug486990.xul => dom/xul/test/test_bug486990.xul rename : content/xul/document/test/test_bug497875.xul => dom/xul/test/test_bug497875.xul rename : content/xul/document/test/test_bug583948.xul => dom/xul/test/test_bug583948.xul rename : content/xul/document/test/test_bug640158_overlay_persist.xul => dom/xul/test/test_bug640158_overlay_persist.xul rename : content/xul/content/test/test_bug749367.xul => dom/xul/test/test_bug749367.xul rename : content/xul/document/test/test_bug757137.xul => dom/xul/test/test_bug757137.xul rename : content/xul/content/test/test_bug775972.xul => dom/xul/test/test_bug775972.xul rename : content/xul/content/test/test_import_xul_to_content.xul => dom/xul/test/test_import_xul_to_content.xul rename : content/xul/document/test/window_bug583948.xul => dom/xul/test/window_bug583948.xul rename : content/xul/document/test/window_bug757137.xul => dom/xul/test/window_bug757137.xul
1897 lines
60 KiB
C++
1897 lines
60 KiB
C++
/* -*- 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 "nsCOMPtr.h"
|
|
#include "nsICollation.h"
|
|
#include "nsIDOMNode.h"
|
|
#include "nsIRDFNode.h"
|
|
#include "nsIRDFObserver.h"
|
|
#include "nsIRDFRemoteDataSource.h"
|
|
#include "nsIRDFInferDataSource.h"
|
|
#include "nsIRDFService.h"
|
|
#include "nsRDFCID.h"
|
|
#include "nsIServiceManager.h"
|
|
#include "nsNameSpaceManager.h"
|
|
#include "nsGkAtoms.h"
|
|
#include "nsIDOMDocument.h"
|
|
#include "nsAttrName.h"
|
|
#include "rdf.h"
|
|
#include "nsArrayUtils.h"
|
|
#include "nsIURI.h"
|
|
|
|
#include "nsContentTestNode.h"
|
|
#include "nsRDFConInstanceTestNode.h"
|
|
#include "nsRDFConMemberTestNode.h"
|
|
#include "nsRDFPropertyTestNode.h"
|
|
#include "nsInstantiationNode.h"
|
|
#include "nsRDFTestNode.h"
|
|
#include "nsXULContentUtils.h"
|
|
#include "nsXULTemplateBuilder.h"
|
|
#include "nsXULTemplateResultRDF.h"
|
|
#include "nsXULTemplateResultSetRDF.h"
|
|
#include "nsXULTemplateQueryProcessorRDF.h"
|
|
#include "nsXULSortService.h"
|
|
#include "nsIDocument.h"
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
#define PARSE_TYPE_INTEGER "Integer"
|
|
|
|
nsrefcnt nsXULTemplateQueryProcessorRDF::gRefCnt = 0;
|
|
nsIRDFService* nsXULTemplateQueryProcessorRDF::gRDFService;
|
|
nsIRDFContainerUtils* nsXULTemplateQueryProcessorRDF::gRDFContainerUtils;
|
|
nsIRDFResource* nsXULTemplateQueryProcessorRDF::kNC_BookmarkSeparator;
|
|
nsIRDFResource* nsXULTemplateQueryProcessorRDF::kRDF_type;
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTemplateQueryProcessorRDF)
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXULTemplateQueryProcessorRDF)
|
|
tmp->Done();
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
|
|
|
static PLDHashOperator
|
|
BindingDependenciesTraverser(nsISupports* key,
|
|
nsXULTemplateQueryProcessorRDF::ResultArray* array,
|
|
void* userArg)
|
|
{
|
|
nsCycleCollectionTraversalCallback *cb =
|
|
static_cast<nsCycleCollectionTraversalCallback*>(userArg);
|
|
|
|
int32_t i, count = array->Length();
|
|
for (i = 0; i < count; ++i) {
|
|
cb->NoteXPCOMChild(array->ElementAt(i));
|
|
}
|
|
|
|
return PL_DHASH_NEXT;
|
|
}
|
|
|
|
static PLDHashOperator
|
|
MemoryElementTraverser(const uint32_t& key,
|
|
nsCOMArray<nsXULTemplateResultRDF>* array,
|
|
void* userArg)
|
|
{
|
|
nsCycleCollectionTraversalCallback *cb =
|
|
static_cast<nsCycleCollectionTraversalCallback*>(userArg);
|
|
|
|
int32_t i, count = array->Count();
|
|
for (i = 0; i < count; ++i) {
|
|
cb->NoteXPCOMChild(array->ObjectAt(i));
|
|
}
|
|
|
|
return PL_DHASH_NEXT;
|
|
}
|
|
|
|
static PLDHashOperator
|
|
RuleToBindingTraverser(nsISupports* key, RDFBindingSet* binding, void* userArg)
|
|
{
|
|
nsCycleCollectionTraversalCallback *cb =
|
|
static_cast<nsCycleCollectionTraversalCallback*>(userArg);
|
|
|
|
cb->NoteXPCOMChild(key);
|
|
|
|
return PL_DHASH_NEXT;
|
|
}
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXULTemplateQueryProcessorRDF)
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDB)
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLastRef)
|
|
tmp->mBindingDependencies.EnumerateRead(BindingDependenciesTraverser,
|
|
&cb);
|
|
tmp->mMemoryElementToResultMap.EnumerateRead(MemoryElementTraverser,
|
|
&cb);
|
|
tmp->mRuleToBindingsMap.EnumerateRead(RuleToBindingTraverser, &cb);
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mQueries)
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXULTemplateQueryProcessorRDF)
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXULTemplateQueryProcessorRDF)
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXULTemplateQueryProcessorRDF)
|
|
NS_INTERFACE_MAP_ENTRY(nsIXULTemplateQueryProcessor)
|
|
NS_INTERFACE_MAP_ENTRY(nsIRDFObserver)
|
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXULTemplateQueryProcessor)
|
|
NS_INTERFACE_MAP_END
|
|
|
|
nsXULTemplateQueryProcessorRDF::nsXULTemplateQueryProcessorRDF(void)
|
|
: mDB(nullptr),
|
|
mBuilder(nullptr),
|
|
mQueryProcessorRDFInited(false),
|
|
mGenerationStarted(false),
|
|
mUpdateBatchNest(0),
|
|
mSimpleRuleMemberTest(nullptr)
|
|
{
|
|
gRefCnt++;
|
|
}
|
|
|
|
nsXULTemplateQueryProcessorRDF::~nsXULTemplateQueryProcessorRDF(void)
|
|
{
|
|
if (--gRefCnt == 0) {
|
|
NS_IF_RELEASE(gRDFService);
|
|
NS_IF_RELEASE(gRDFContainerUtils);
|
|
NS_IF_RELEASE(kNC_BookmarkSeparator);
|
|
NS_IF_RELEASE(kRDF_type);
|
|
}
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::InitGlobals()
|
|
{
|
|
nsresult rv;
|
|
|
|
// Initialize the global shared reference to the service
|
|
// manager and get some shared resource objects.
|
|
if (!gRDFService) {
|
|
NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
|
rv = CallGetService(kRDFServiceCID, &gRDFService);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
|
|
if (!gRDFContainerUtils) {
|
|
NS_DEFINE_CID(kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID);
|
|
rv = CallGetService(kRDFContainerUtilsCID, &gRDFContainerUtils);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
|
|
if (!kNC_BookmarkSeparator) {
|
|
gRDFService->GetResource(
|
|
NS_LITERAL_CSTRING(NC_NAMESPACE_URI "BookmarkSeparator"),
|
|
&kNC_BookmarkSeparator);
|
|
}
|
|
|
|
if (!kRDF_type) {
|
|
gRDFService->GetResource(
|
|
NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "type"),
|
|
&kRDF_type);
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
//
|
|
// nsIXULTemplateQueryProcessor interface
|
|
//
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::GetDatasource(nsIArray* aDataSources,
|
|
nsIDOMNode* aRootNode,
|
|
bool aIsTrusted,
|
|
nsIXULTemplateBuilder* aBuilder,
|
|
bool* aShouldDelayBuilding,
|
|
nsISupports** aResult)
|
|
{
|
|
nsCOMPtr<nsIRDFCompositeDataSource> compDB;
|
|
nsCOMPtr<nsIContent> root = do_QueryInterface(aRootNode);
|
|
nsresult rv;
|
|
|
|
*aResult = nullptr;
|
|
*aShouldDelayBuilding = false;
|
|
|
|
NS_ENSURE_TRUE(root, NS_ERROR_UNEXPECTED);
|
|
|
|
// make sure the RDF service is set up
|
|
rv = InitGlobals();
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
// create a database for the builder
|
|
compDB = do_CreateInstance(NS_RDF_DATASOURCE_CONTRACTID_PREFIX
|
|
"composite-datasource");
|
|
if (!compDB) {
|
|
NS_ERROR("unable to construct new composite data source");
|
|
return NS_ERROR_UNEXPECTED;
|
|
}
|
|
|
|
// check for magical attributes. XXX move to ``flags''?
|
|
if (root->AttrValueIs(kNameSpaceID_None,
|
|
nsGkAtoms::coalesceduplicatearcs,
|
|
nsGkAtoms::_false, eCaseMatters))
|
|
compDB->SetCoalesceDuplicateArcs(false);
|
|
|
|
if (root->AttrValueIs(kNameSpaceID_None,
|
|
nsGkAtoms::allownegativeassertions,
|
|
nsGkAtoms::_false, eCaseMatters))
|
|
compDB->SetAllowNegativeAssertions(false);
|
|
|
|
if (aIsTrusted) {
|
|
// If we're a privileged (e.g., chrome) document, then add the
|
|
// local store as the first data source in the db. Note that
|
|
// we _might_ not be able to get a local store if we haven't
|
|
// got a profile to read from yet.
|
|
nsCOMPtr<nsIRDFDataSource> localstore;
|
|
rv = gRDFService->GetDataSource("rdf:local-store",
|
|
getter_AddRefs(localstore));
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
rv = compDB->AddDataSource(localstore);
|
|
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to add local store to db");
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
}
|
|
|
|
uint32_t length, index;
|
|
rv = aDataSources->GetLength(&length);
|
|
NS_ENSURE_SUCCESS(rv,rv);
|
|
|
|
for (index = 0; index < length; index++) {
|
|
|
|
nsCOMPtr<nsIURI> uri = do_QueryElementAt(aDataSources, index);
|
|
if (!uri) // we ignore other datasources than uri
|
|
continue;
|
|
|
|
nsCOMPtr<nsIRDFDataSource> ds;
|
|
nsAutoCString uristrC;
|
|
uri->GetSpec(uristrC);
|
|
|
|
rv = gRDFService->GetDataSource(uristrC.get(), getter_AddRefs(ds));
|
|
|
|
if (NS_FAILED(rv)) {
|
|
// This is only a warning because the data source may not
|
|
// be accessible for any number of reasons, including
|
|
// security, a bad URL, etc.
|
|
#ifdef DEBUG
|
|
nsAutoCString msg;
|
|
msg.AppendLiteral("unable to load datasource '");
|
|
msg.Append(uristrC);
|
|
msg.Append('\'');
|
|
NS_WARNING(msg.get());
|
|
#endif
|
|
continue;
|
|
}
|
|
|
|
compDB->AddDataSource(ds);
|
|
}
|
|
|
|
|
|
// check if we were given an inference engine type
|
|
nsAutoString infer;
|
|
nsCOMPtr<nsIRDFDataSource> db;
|
|
root->GetAttr(kNameSpaceID_None, nsGkAtoms::infer, infer);
|
|
if (!infer.IsEmpty()) {
|
|
nsCString inferCID(NS_RDF_INFER_DATASOURCE_CONTRACTID_PREFIX);
|
|
AppendUTF16toUTF8(infer, inferCID);
|
|
nsCOMPtr<nsIRDFInferDataSource> inferDB =
|
|
do_CreateInstance(inferCID.get());
|
|
|
|
if (inferDB) {
|
|
inferDB->SetBaseDataSource(compDB);
|
|
db = do_QueryInterface(inferDB);
|
|
}
|
|
else {
|
|
NS_WARNING("failed to construct inference engine specified on template");
|
|
}
|
|
}
|
|
|
|
if (!db)
|
|
db = compDB;
|
|
|
|
return CallQueryInterface(db, aResult);
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::InitializeForBuilding(nsISupports* aDatasource,
|
|
nsIXULTemplateBuilder* aBuilder,
|
|
nsIDOMNode* aRootNode)
|
|
{
|
|
if (!mQueryProcessorRDFInited) {
|
|
nsresult rv = InitGlobals();
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
mQueryProcessorRDFInited = true;
|
|
}
|
|
|
|
// don't do anything if generation has already been done
|
|
if (mGenerationStarted)
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
mDB = do_QueryInterface(aDatasource);
|
|
mBuilder = aBuilder;
|
|
|
|
ComputeContainmentProperties(aRootNode);
|
|
|
|
// Add ourselves as a datasource observer
|
|
if (mDB)
|
|
mDB->AddObserver(this);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::Done()
|
|
{
|
|
if (!mQueryProcessorRDFInited)
|
|
return NS_OK;
|
|
|
|
if (mDB)
|
|
mDB->RemoveObserver(this);
|
|
|
|
mDB = nullptr;
|
|
mBuilder = nullptr;
|
|
mRefVariable = nullptr;
|
|
mLastRef = nullptr;
|
|
|
|
mGenerationStarted = false;
|
|
mUpdateBatchNest = 0;
|
|
|
|
mContainmentProperties.Clear();
|
|
|
|
for (ReteNodeSet::Iterator node = mAllTests.First();
|
|
node != mAllTests.Last(); ++node)
|
|
delete *node;
|
|
|
|
mAllTests.Clear();
|
|
mRDFTests.Clear();
|
|
mQueries.Clear();
|
|
|
|
mSimpleRuleMemberTest = nullptr;
|
|
|
|
mBindingDependencies.Clear();
|
|
|
|
mMemoryElementToResultMap.Clear();
|
|
|
|
mRuleToBindingsMap.Clear();
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::CompileQuery(nsIXULTemplateBuilder* aBuilder,
|
|
nsIDOMNode* aQueryNode,
|
|
nsIAtom* aRefVariable,
|
|
nsIAtom* aMemberVariable,
|
|
nsISupports** _retval)
|
|
{
|
|
nsRefPtr<nsRDFQuery> query = new nsRDFQuery(this);
|
|
if (!query)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
query->mRefVariable = aRefVariable;
|
|
if (!mRefVariable)
|
|
mRefVariable = aRefVariable;
|
|
|
|
if (!aMemberVariable)
|
|
query->mMemberVariable = do_GetAtom("?");
|
|
else
|
|
query->mMemberVariable = aMemberVariable;
|
|
|
|
nsresult rv;
|
|
TestNode *lastnode = nullptr;
|
|
|
|
nsCOMPtr<nsIContent> content = do_QueryInterface(aQueryNode);
|
|
|
|
if (content->NodeInfo()->Equals(nsGkAtoms::_template, kNameSpaceID_XUL)) {
|
|
// simplified syntax with no rules
|
|
|
|
query->SetSimple();
|
|
NS_ASSERTION(!mSimpleRuleMemberTest,
|
|
"CompileQuery called twice with the same template");
|
|
if (!mSimpleRuleMemberTest)
|
|
rv = CompileSimpleQuery(query, content, &lastnode);
|
|
else
|
|
rv = NS_ERROR_FAILURE;
|
|
}
|
|
else if (content->NodeInfo()->Equals(nsGkAtoms::rule, kNameSpaceID_XUL)) {
|
|
// simplified syntax with at least one rule
|
|
query->SetSimple();
|
|
rv = CompileSimpleQuery(query, content, &lastnode);
|
|
}
|
|
else {
|
|
rv = CompileExtendedQuery(query, content, &lastnode);
|
|
}
|
|
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
query->SetQueryNode(aQueryNode);
|
|
|
|
nsInstantiationNode* instnode = new nsInstantiationNode(this, query);
|
|
if (!instnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
// this and other functions always add nodes to mAllTests first. That
|
|
// way if something fails, the node will just sit harmlessly in mAllTests
|
|
// where it can be deleted later.
|
|
rv = mAllTests.Add(instnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete instnode;
|
|
return rv;
|
|
}
|
|
|
|
rv = lastnode->AddChild(instnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
mQueries.AppendElement(query);
|
|
|
|
*_retval = query;
|
|
NS_ADDREF(*_retval);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::GenerateResults(nsISupports* aDatasource,
|
|
nsIXULTemplateResult* aRef,
|
|
nsISupports* aQuery,
|
|
nsISimpleEnumerator** aResults)
|
|
{
|
|
nsCOMPtr<nsITemplateRDFQuery> rdfquery = do_QueryInterface(aQuery);
|
|
if (! rdfquery)
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
mGenerationStarted = true;
|
|
|
|
// should be safe to cast here since the query is a
|
|
// non-scriptable nsITemplateRDFQuery
|
|
nsRDFQuery* query = static_cast<nsRDFQuery *>(aQuery);
|
|
|
|
*aResults = nullptr;
|
|
|
|
nsCOMPtr<nsISimpleEnumerator> results;
|
|
|
|
if (aRef) {
|
|
// make sure that cached results were generated for this ref, and if not,
|
|
// regenerate them. Otherwise, things will go wrong for templates bound to
|
|
// an HTML element as they are not generated lazily.
|
|
if (aRef == mLastRef) {
|
|
query->UseCachedResults(getter_AddRefs(results));
|
|
}
|
|
else {
|
|
// clear the cached results
|
|
int32_t count = mQueries.Length();
|
|
for (int32_t r = 0; r < count; r++) {
|
|
mQueries[r]->ClearCachedResults();
|
|
}
|
|
}
|
|
|
|
if (! results) {
|
|
if (! query->mRefVariable)
|
|
query->mRefVariable = do_GetAtom("?uri");
|
|
|
|
nsCOMPtr<nsIRDFResource> refResource;
|
|
aRef->GetResource(getter_AddRefs(refResource));
|
|
if (! refResource)
|
|
return NS_ERROR_FAILURE;
|
|
|
|
// Propagate the assignments through the network
|
|
TestNode* root = query->GetRoot();
|
|
|
|
if (query->IsSimple() && mSimpleRuleMemberTest) {
|
|
// get the top node in the simple rule tree
|
|
root = mSimpleRuleMemberTest->GetParent();
|
|
mLastRef = aRef;
|
|
}
|
|
|
|
#ifdef PR_LOGGING
|
|
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
|
nsAutoString id;
|
|
aRef->GetId(id);
|
|
|
|
nsAutoString rvar;
|
|
query->mRefVariable->ToString(rvar);
|
|
nsAutoString mvar;
|
|
query->mMemberVariable->ToString(mvar);
|
|
|
|
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
|
|
("QueryProcessor::GenerateResults using ref %s and vars [ ref: %s member: %s]",
|
|
NS_ConvertUTF16toUTF8(id).get(),
|
|
NS_ConvertUTF16toUTF8(rvar).get(),
|
|
NS_ConvertUTF16toUTF8(mvar).get()));
|
|
}
|
|
#endif
|
|
|
|
if (root) {
|
|
// the seed is the initial instantiation, which has a single
|
|
// assignment holding the reference point
|
|
Instantiation seed;
|
|
seed.AddAssignment(query->mRefVariable, refResource);
|
|
|
|
InstantiationSet* instantiations = new InstantiationSet();
|
|
if (!instantiations)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
instantiations->Append(seed);
|
|
|
|
// if the propagation caused a match, then the results will be
|
|
// cached in the query, retrieved below by calling
|
|
// UseCachedResults. The matching result set owns the
|
|
// instantiations and will delete them when results have been
|
|
// iterated over. If the propagation did not match, the
|
|
// instantiations need to be deleted.
|
|
bool owned = false;
|
|
nsresult rv = root->Propagate(*instantiations, false, owned);
|
|
if (! owned)
|
|
delete instantiations;
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
query->UseCachedResults(getter_AddRefs(results));
|
|
}
|
|
}
|
|
}
|
|
|
|
if (! results) {
|
|
// no results were found so create an empty set
|
|
results = new nsXULTemplateResultSetRDF(this, query, nullptr);
|
|
if (! results)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
|
|
results.swap(*aResults);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::AddBinding(nsIDOMNode* aRuleNode,
|
|
nsIAtom* aVar,
|
|
nsIAtom* aRef,
|
|
const nsAString& aExpr)
|
|
{
|
|
// add a <binding> to a rule. When a result is matched, the bindings are
|
|
// examined to add additional variable assignments
|
|
|
|
// bindings can't be added once result generation has started, otherwise
|
|
// the array sizes will get out of sync
|
|
if (mGenerationStarted)
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
nsCOMPtr<nsIRDFResource> property;
|
|
nsresult rv = gRDFService->GetUnicodeResource(aExpr, getter_AddRefs(property));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
nsRefPtr<RDFBindingSet> bindings = mRuleToBindingsMap.GetWeak(aRuleNode);
|
|
if (!bindings) {
|
|
bindings = new RDFBindingSet();
|
|
mRuleToBindingsMap.Put(aRuleNode, bindings);
|
|
}
|
|
|
|
return bindings->AddBinding(aVar, aRef, property);
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::TranslateRef(nsISupports* aDatasource,
|
|
const nsAString& aRefString,
|
|
nsIXULTemplateResult** aRef)
|
|
{
|
|
// make sure the RDF service is set up
|
|
nsresult rv = InitGlobals();
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
nsCOMPtr<nsIRDFResource> uri;
|
|
gRDFService->GetUnicodeResource(aRefString, getter_AddRefs(uri));
|
|
|
|
nsXULTemplateResultRDF* refresult = new nsXULTemplateResultRDF(uri);
|
|
if (! refresult)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
*aRef = refresult;
|
|
NS_ADDREF(*aRef);
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::CompareResults(nsIXULTemplateResult* aLeft,
|
|
nsIXULTemplateResult* aRight,
|
|
nsIAtom* aVar,
|
|
uint32_t aSortHints,
|
|
int32_t* aResult)
|
|
{
|
|
NS_ENSURE_ARG_POINTER(aLeft);
|
|
NS_ENSURE_ARG_POINTER(aRight);
|
|
|
|
*aResult = 0;
|
|
|
|
// for natural order sorting, use the index in the RDF container for the
|
|
// order. If there is no container, just sort them arbitrarily.
|
|
if (!aVar) {
|
|
// if a result has a negative index, just sort it first
|
|
int32_t leftindex = GetContainerIndexOf(aLeft);
|
|
int32_t rightindex = GetContainerIndexOf(aRight);
|
|
*aResult = leftindex == rightindex ? 0 :
|
|
leftindex > rightindex ? 1 :
|
|
-1;
|
|
return NS_OK;
|
|
}
|
|
|
|
nsDependentAtomString sortkey(aVar);
|
|
|
|
nsCOMPtr<nsISupports> leftNode, rightNode;
|
|
|
|
if (!sortkey.IsEmpty() && sortkey[0] != '?' &&
|
|
!StringBeginsWith(sortkey, NS_LITERAL_STRING("rdf:")) &&
|
|
mDB) {
|
|
// if the sort key is not a template variable, it should be an RDF
|
|
// predicate. Get the targets and compare those instead.
|
|
nsCOMPtr<nsIRDFResource> predicate;
|
|
nsresult rv = gRDFService->GetUnicodeResource(sortkey, getter_AddRefs(predicate));
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
// create a predicate with '?sort=true' appended. This special
|
|
// predicate may be used to have a different sort value than the
|
|
// displayed value
|
|
sortkey.AppendLiteral("?sort=true");
|
|
|
|
nsCOMPtr<nsIRDFResource> sortPredicate;
|
|
rv = gRDFService->GetUnicodeResource(sortkey, getter_AddRefs(sortPredicate));
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
rv = GetSortValue(aLeft, predicate, sortPredicate, getter_AddRefs(leftNode));
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
rv = GetSortValue(aRight, predicate, sortPredicate, getter_AddRefs(rightNode));
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
}
|
|
else {
|
|
// get the values for the sort key from the results
|
|
aLeft->GetBindingObjectFor(aVar, getter_AddRefs(leftNode));
|
|
aRight->GetBindingObjectFor(aVar, getter_AddRefs(rightNode));
|
|
}
|
|
|
|
{
|
|
// Literals?
|
|
nsCOMPtr<nsIRDFLiteral> l = do_QueryInterface(leftNode);
|
|
if (l) {
|
|
nsCOMPtr<nsIRDFLiteral> r = do_QueryInterface(rightNode);
|
|
if (r) {
|
|
const char16_t *lstr, *rstr;
|
|
l->GetValueConst(&lstr);
|
|
r->GetValueConst(&rstr);
|
|
|
|
*aResult = XULSortServiceImpl::CompareValues(
|
|
nsDependentString(lstr),
|
|
nsDependentString(rstr), aSortHints);
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
}
|
|
|
|
{
|
|
// Dates?
|
|
nsCOMPtr<nsIRDFDate> l = do_QueryInterface(leftNode);
|
|
if (l) {
|
|
nsCOMPtr<nsIRDFDate> r = do_QueryInterface(rightNode);
|
|
if (r) {
|
|
PRTime ldate, rdate;
|
|
l->GetValue(&ldate);
|
|
r->GetValue(&rdate);
|
|
|
|
int64_t delta = ldate - rdate;
|
|
if (delta == 0)
|
|
*aResult = 0;
|
|
else if (delta >= 0)
|
|
*aResult = 1;
|
|
else
|
|
*aResult = -1;
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
}
|
|
|
|
{
|
|
// Integers?
|
|
nsCOMPtr<nsIRDFInt> l = do_QueryInterface(leftNode);
|
|
if (l) {
|
|
nsCOMPtr<nsIRDFInt> r = do_QueryInterface(rightNode);
|
|
if (r) {
|
|
int32_t lval, rval;
|
|
l->GetValue(&lval);
|
|
r->GetValue(&rval);
|
|
|
|
*aResult = lval - rval;
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
}
|
|
|
|
nsICollation* collation = nsXULContentUtils::GetCollation();
|
|
if (collation) {
|
|
// Blobs? (We can only compare these reasonably if we have a
|
|
// collation object.)
|
|
nsCOMPtr<nsIRDFBlob> l = do_QueryInterface(leftNode);
|
|
if (l) {
|
|
nsCOMPtr<nsIRDFBlob> r = do_QueryInterface(rightNode);
|
|
if (r) {
|
|
const uint8_t *lval, *rval;
|
|
int32_t llen, rlen;
|
|
l->GetValue(&lval);
|
|
l->GetLength(&llen);
|
|
r->GetValue(&rval);
|
|
r->GetLength(&rlen);
|
|
|
|
collation->CompareRawSortKey(lval, llen, rval, rlen, aResult);
|
|
}
|
|
}
|
|
}
|
|
|
|
// if the results are none of the above, just pretend that they are equal
|
|
return NS_OK;
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
//
|
|
// nsIRDFObserver interface
|
|
//
|
|
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::OnAssert(nsIRDFDataSource* aDataSource,
|
|
nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aTarget)
|
|
{
|
|
// Ignore updates if we're batching
|
|
if (mUpdateBatchNest)
|
|
return(NS_OK);
|
|
|
|
if (! mBuilder)
|
|
return NS_OK;
|
|
|
|
LOG("onassert", aSource, aProperty, aTarget);
|
|
|
|
Propagate(aSource, aProperty, aTarget);
|
|
SynchronizeAll(aSource, aProperty, nullptr, aTarget);
|
|
return NS_OK;
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::OnUnassert(nsIRDFDataSource* aDataSource,
|
|
nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aTarget)
|
|
{
|
|
// Ignore updates if we're batching
|
|
if (mUpdateBatchNest)
|
|
return NS_OK;
|
|
|
|
if (! mBuilder)
|
|
return NS_OK;
|
|
|
|
LOG("onunassert", aSource, aProperty, aTarget);
|
|
|
|
Retract(aSource, aProperty, aTarget);
|
|
SynchronizeAll(aSource, aProperty, aTarget, nullptr);
|
|
return NS_OK;
|
|
}
|
|
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::OnChange(nsIRDFDataSource* aDataSource,
|
|
nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aOldTarget,
|
|
nsIRDFNode* aNewTarget)
|
|
{
|
|
// Ignore updates if we're batching
|
|
if (mUpdateBatchNest)
|
|
return NS_OK;
|
|
|
|
if (! mBuilder)
|
|
return NS_OK;
|
|
|
|
LOG("onchange", aSource, aProperty, aNewTarget);
|
|
|
|
if (aOldTarget) {
|
|
// Pull any old results that were relying on aOldTarget
|
|
Retract(aSource, aProperty, aOldTarget);
|
|
}
|
|
|
|
if (aNewTarget) {
|
|
// Fire any new results that are activated by aNewTarget
|
|
Propagate(aSource, aProperty, aNewTarget);
|
|
}
|
|
|
|
// Synchronize any of the content model that may have changed.
|
|
SynchronizeAll(aSource, aProperty, aOldTarget, aNewTarget);
|
|
return NS_OK;
|
|
}
|
|
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::OnMove(nsIRDFDataSource* aDataSource,
|
|
nsIRDFResource* aOldSource,
|
|
nsIRDFResource* aNewSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aTarget)
|
|
{
|
|
// Ignore updates if we're batching
|
|
if (mUpdateBatchNest)
|
|
return NS_OK;
|
|
|
|
NS_NOTYETIMPLEMENTED("write me");
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
}
|
|
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::OnBeginUpdateBatch(nsIRDFDataSource* aDataSource)
|
|
{
|
|
mUpdateBatchNest++;
|
|
return NS_OK;
|
|
}
|
|
|
|
|
|
NS_IMETHODIMP
|
|
nsXULTemplateQueryProcessorRDF::OnEndUpdateBatch(nsIRDFDataSource* aDataSource)
|
|
{
|
|
NS_ASSERTION(mUpdateBatchNest > 0, "badly nested update batch");
|
|
if (--mUpdateBatchNest <= 0) {
|
|
mUpdateBatchNest = 0;
|
|
|
|
if (mBuilder)
|
|
mBuilder->Rebuild();
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::Propagate(nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aTarget)
|
|
{
|
|
// When a new assertion is added to the graph, determine any new matches
|
|
// that must be added to the template builder. First, iterate through all
|
|
// the RDF tests (<member> and <triple> tests), and find the topmost test
|
|
// that would be affected by the new assertion.
|
|
nsresult rv;
|
|
|
|
ReteNodeSet livenodes;
|
|
|
|
#ifdef PR_LOGGING
|
|
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
|
const char* sourceStr;
|
|
aSource->GetValueConst(&sourceStr);
|
|
const char* propertyStr;
|
|
aProperty->GetValueConst(&propertyStr);
|
|
nsAutoString targetStr;
|
|
nsXULContentUtils::GetTextForNode(aTarget, targetStr);
|
|
|
|
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
|
|
("nsXULTemplateQueryProcessorRDF::Propagate: [%s] -> [%s] -> [%s]\n",
|
|
sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get()));
|
|
}
|
|
#endif
|
|
|
|
{
|
|
ReteNodeSet::Iterator last = mRDFTests.Last();
|
|
for (ReteNodeSet::Iterator i = mRDFTests.First(); i != last; ++i) {
|
|
nsRDFTestNode* rdftestnode = static_cast<nsRDFTestNode*>(*i);
|
|
|
|
Instantiation seed;
|
|
if (rdftestnode->CanPropagate(aSource, aProperty, aTarget, seed)) {
|
|
rv = livenodes.Add(rdftestnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Now, we'll go through each, and any that aren't dominated by
|
|
// another live node will be used to propagate the assertion
|
|
// through the rule network
|
|
{
|
|
ReteNodeSet::Iterator last = livenodes.Last();
|
|
for (ReteNodeSet::Iterator i = livenodes.First(); i != last; ++i) {
|
|
nsRDFTestNode* rdftestnode = static_cast<nsRDFTestNode*>(*i);
|
|
|
|
// What happens here is we create an instantiation as if we were
|
|
// at the found test in the rule network. For example, if the
|
|
// found test was a member test (parent => child), the parent
|
|
// and child variables are assigned the values provided by the new
|
|
// RDF assertion in the graph. The Constrain call is used to go
|
|
// up to earlier RDF tests, filling in variables as it goes.
|
|
// Constrain will eventually get up to the top node, an
|
|
// nsContentTestNode, which takes the value of the reference
|
|
// variable and calls the template builder to see if a result has
|
|
// been generated already for the reference value. If it hasn't,
|
|
// the new assertion couldn't cause a new match. If the result
|
|
// exists, call Propagate to continue to the later RDF tests to
|
|
// fill in the rest of the variable assignments.
|
|
|
|
// Bogus, to get the seed instantiation
|
|
Instantiation seed;
|
|
rdftestnode->CanPropagate(aSource, aProperty, aTarget, seed);
|
|
|
|
InstantiationSet* instantiations = new InstantiationSet();
|
|
if (!instantiations)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
instantiations->Append(seed);
|
|
|
|
rv = rdftestnode->Constrain(*instantiations);
|
|
if (NS_FAILED(rv)) {
|
|
delete instantiations;
|
|
return rv;
|
|
}
|
|
|
|
bool owned = false;
|
|
if (!instantiations->Empty())
|
|
rv = rdftestnode->Propagate(*instantiations, true, owned);
|
|
|
|
// owned should always be false in update mode, but check just
|
|
// to be sure
|
|
if (!owned)
|
|
delete instantiations;
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::Retract(nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aTarget)
|
|
{
|
|
|
|
#ifdef PR_LOGGING
|
|
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
|
const char* sourceStr;
|
|
aSource->GetValueConst(&sourceStr);
|
|
const char* propertyStr;
|
|
aProperty->GetValueConst(&propertyStr);
|
|
nsAutoString targetStr;
|
|
nsXULContentUtils::GetTextForNode(aTarget, targetStr);
|
|
|
|
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
|
|
("nsXULTemplateQueryProcessorRDF::Retract: [%s] -> [%s] -> [%s]\n",
|
|
sourceStr, propertyStr, NS_ConvertUTF16toUTF8(targetStr).get()));
|
|
}
|
|
#endif
|
|
|
|
// Retract any currently active rules that will no longer be matched.
|
|
ReteNodeSet::ConstIterator lastnode = mRDFTests.Last();
|
|
for (ReteNodeSet::ConstIterator node = mRDFTests.First(); node != lastnode; ++node) {
|
|
const nsRDFTestNode* rdftestnode = static_cast<const nsRDFTestNode*>(*node);
|
|
|
|
rdftestnode->Retract(aSource, aProperty, aTarget);
|
|
|
|
// Now fire any newly revealed rules
|
|
// XXXwaterson yo. write me.
|
|
// The intent here is to handle any rules that might be
|
|
// "revealed" by the removal of an assertion from the datasource.
|
|
// Waterson doesn't think we support negated conditions in a rule.
|
|
// Nor is he sure that this is currently useful.
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::SynchronizeAll(nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aOldTarget,
|
|
nsIRDFNode* aNewTarget)
|
|
{
|
|
// Update each match that contains <aSource, aProperty, aOldTarget>.
|
|
|
|
// Get all the matches whose assignments are currently supported
|
|
// by aSource and aProperty: we'll need to recompute them.
|
|
ResultArray* results;
|
|
if (!mBindingDependencies.Get(aSource, &results) || !mBuilder)
|
|
return NS_OK;
|
|
|
|
uint32_t length = results->Length();
|
|
|
|
for (uint32_t r = 0; r < length; r++) {
|
|
nsXULTemplateResultRDF* result = (*results)[r];
|
|
if (result) {
|
|
// synchronize the result's bindings and then update the builder
|
|
// so that content can be updated
|
|
if (result->SyncAssignments(aSource, aProperty, aNewTarget)) {
|
|
nsITemplateRDFQuery* query = result->Query();
|
|
if (query) {
|
|
nsCOMPtr<nsIDOMNode> querynode;
|
|
query->GetQueryNode(getter_AddRefs(querynode));
|
|
|
|
mBuilder->ResultBindingChanged(result);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
#ifdef PR_LOGGING
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::Log(const char* aOperation,
|
|
nsIRDFResource* aSource,
|
|
nsIRDFResource* aProperty,
|
|
nsIRDFNode* aTarget)
|
|
{
|
|
if (PR_LOG_TEST(gXULTemplateLog, PR_LOG_DEBUG)) {
|
|
nsresult rv;
|
|
|
|
const char* sourceStr;
|
|
rv = aSource->GetValueConst(&sourceStr);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
|
("xultemplate[%p] %8s [%s]--", this, aOperation, sourceStr));
|
|
|
|
const char* propertyStr;
|
|
rv = aProperty->GetValueConst(&propertyStr);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
nsAutoString targetStr;
|
|
rv = nsXULContentUtils::GetTextForNode(aTarget, targetStr);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
nsAutoCString targetstrC;
|
|
targetstrC.AssignWithConversion(targetStr);
|
|
PR_LOG(gXULTemplateLog, PR_LOG_DEBUG,
|
|
(" --[%s]-->[%s]",
|
|
propertyStr,
|
|
targetstrC.get()));
|
|
}
|
|
return NS_OK;
|
|
}
|
|
#endif
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CheckContainer(nsIRDFResource* aResource,
|
|
bool* aIsContainer)
|
|
{
|
|
NS_ENSURE_ARG_POINTER(aIsContainer);
|
|
NS_ENSURE_STATE(mDB);
|
|
|
|
// We have to look at all of the arcs extending out of the
|
|
// resource: if any of them are that "containment" property, then
|
|
// we know we'll have children.
|
|
bool isContainer = false;
|
|
|
|
for (nsResourceSet::ConstIterator property = mContainmentProperties.First();
|
|
property != mContainmentProperties.Last();
|
|
property++) {
|
|
bool hasArc = false;
|
|
mDB->HasArcOut(aResource, *property, &hasArc);
|
|
|
|
if (hasArc) {
|
|
// Well, it's a container...
|
|
isContainer = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
// If we get here, and we're still not sure if it's a container,
|
|
// then see if it's an RDF container
|
|
if (! isContainer) {
|
|
gRDFContainerUtils->IsContainer(mDB, aResource, &isContainer);
|
|
}
|
|
|
|
*aIsContainer = isContainer;
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CheckEmpty(nsIRDFResource* aResource,
|
|
bool* aIsEmpty)
|
|
{
|
|
NS_ENSURE_STATE(mDB);
|
|
*aIsEmpty = true;
|
|
|
|
for (nsResourceSet::ConstIterator property = mContainmentProperties.First();
|
|
property != mContainmentProperties.Last();
|
|
property++) {
|
|
|
|
nsCOMPtr<nsIRDFNode> dummy;
|
|
mDB->GetTarget(aResource, *property, true, getter_AddRefs(dummy));
|
|
|
|
if (dummy) {
|
|
*aIsEmpty = false;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (*aIsEmpty){
|
|
return nsXULTemplateQueryProcessorRDF::gRDFContainerUtils->
|
|
IsEmpty(mDB, aResource, aIsEmpty);
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CheckIsSeparator(nsIRDFResource* aResource,
|
|
bool* aIsSeparator)
|
|
{
|
|
NS_ENSURE_STATE(mDB);
|
|
return mDB->HasAssertion(aResource, kRDF_type, kNC_BookmarkSeparator,
|
|
true, aIsSeparator);
|
|
}
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::ComputeContainmentProperties(nsIDOMNode* aRootNode)
|
|
{
|
|
// The 'containment' attribute on the root node is a
|
|
// whitespace-separated list that tells us which properties we
|
|
// should use to test for containment.
|
|
nsresult rv;
|
|
|
|
mContainmentProperties.Clear();
|
|
|
|
nsCOMPtr<nsIContent> content = do_QueryInterface(aRootNode);
|
|
|
|
nsAutoString containment;
|
|
content->GetAttr(kNameSpaceID_None, nsGkAtoms::containment, containment);
|
|
|
|
uint32_t len = containment.Length();
|
|
uint32_t offset = 0;
|
|
while (offset < len) {
|
|
while (offset < len && nsCRT::IsAsciiSpace(containment[offset]))
|
|
++offset;
|
|
|
|
if (offset >= len)
|
|
break;
|
|
|
|
uint32_t end = offset;
|
|
while (end < len && !nsCRT::IsAsciiSpace(containment[end]))
|
|
++end;
|
|
|
|
nsAutoString propertyStr;
|
|
containment.Mid(propertyStr, offset, end - offset);
|
|
|
|
nsCOMPtr<nsIRDFResource> property;
|
|
rv = gRDFService->GetUnicodeResource(propertyStr, getter_AddRefs(property));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
rv = mContainmentProperties.Add(property);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
offset = end;
|
|
}
|
|
|
|
#define TREE_PROPERTY_HACK 1
|
|
#if defined(TREE_PROPERTY_HACK)
|
|
if (! len) {
|
|
// Some ever-present membership tests.
|
|
mContainmentProperties.Add(nsXULContentUtils::NC_child);
|
|
mContainmentProperties.Add(nsXULContentUtils::NC_Folder);
|
|
}
|
|
#endif
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CompileExtendedQuery(nsRDFQuery* aQuery,
|
|
nsIContent* aConditions,
|
|
TestNode** aLastNode)
|
|
{
|
|
// Compile an extended query's children
|
|
|
|
nsContentTestNode* idnode =
|
|
new nsContentTestNode(this, aQuery->mRefVariable);
|
|
if (! idnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
aQuery->SetRoot(idnode);
|
|
nsresult rv = mAllTests.Add(idnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete idnode;
|
|
return rv;
|
|
}
|
|
|
|
TestNode* prevnode = idnode;
|
|
|
|
for (nsIContent* condition = aConditions->GetFirstChild();
|
|
condition;
|
|
condition = condition->GetNextSibling()) {
|
|
|
|
// the <content> condition should always be the first child
|
|
if (condition->Tag() == nsGkAtoms::content) {
|
|
if (condition != aConditions->GetFirstChild()) {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_CONTENT_NOT_FIRST);
|
|
continue;
|
|
}
|
|
|
|
// check for <content tag='tag'/> which indicates that matches
|
|
// should only be generated for items inside content with that tag
|
|
nsAutoString tagstr;
|
|
condition->GetAttr(kNameSpaceID_None, nsGkAtoms::tag, tagstr);
|
|
|
|
nsCOMPtr<nsIAtom> tag;
|
|
if (! tagstr.IsEmpty()) {
|
|
tag = do_GetAtom(tagstr);
|
|
}
|
|
|
|
nsCOMPtr<nsIDOMDocument> doc = do_QueryInterface(condition->GetComposedDoc());
|
|
if (! doc)
|
|
return NS_ERROR_FAILURE;
|
|
|
|
idnode->SetTag(tag, doc);
|
|
continue;
|
|
}
|
|
|
|
TestNode* testnode = nullptr;
|
|
nsresult rv = CompileQueryChild(condition->Tag(), aQuery, condition,
|
|
prevnode, &testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
if (testnode) {
|
|
rv = prevnode->AddChild(testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
prevnode = testnode;
|
|
}
|
|
}
|
|
|
|
*aLastNode = prevnode;
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CompileQueryChild(nsIAtom* aTag,
|
|
nsRDFQuery* aQuery,
|
|
nsIContent* aCondition,
|
|
TestNode* aParentNode,
|
|
TestNode** aResult)
|
|
{
|
|
nsresult rv;
|
|
|
|
if (aTag == nsGkAtoms::triple) {
|
|
rv = CompileTripleCondition(aQuery, aCondition, aParentNode, aResult);
|
|
}
|
|
else if (aTag == nsGkAtoms::member) {
|
|
rv = CompileMemberCondition(aQuery, aCondition, aParentNode, aResult);
|
|
}
|
|
else {
|
|
#ifdef PR_LOGGING
|
|
nsAutoString tagstr;
|
|
aTag->ToString(tagstr);
|
|
|
|
nsAutoCString tagstrC;
|
|
tagstrC.AssignWithConversion(tagstr);
|
|
PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS,
|
|
("xultemplate[%p] unrecognized condition test <%s>",
|
|
this, tagstrC.get()));
|
|
#endif
|
|
|
|
rv = NS_OK;
|
|
}
|
|
|
|
return rv;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::ParseLiteral(const nsString& aParseType,
|
|
const nsString& aValue,
|
|
nsIRDFNode** aResult)
|
|
{
|
|
nsresult rv = NS_OK;
|
|
*aResult = nullptr;
|
|
|
|
if (aParseType.EqualsLiteral(PARSE_TYPE_INTEGER)) {
|
|
nsCOMPtr<nsIRDFInt> intLiteral;
|
|
nsresult errorCode;
|
|
int32_t intValue = aValue.ToInteger(&errorCode);
|
|
if (NS_FAILED(errorCode))
|
|
return NS_ERROR_FAILURE;
|
|
rv = gRDFService->GetIntLiteral(intValue, getter_AddRefs(intLiteral));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
rv = CallQueryInterface(intLiteral, aResult);
|
|
}
|
|
else {
|
|
nsCOMPtr<nsIRDFLiteral> literal;
|
|
rv = gRDFService->GetLiteral(aValue.get(), getter_AddRefs(literal));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
rv = CallQueryInterface(literal, aResult);
|
|
}
|
|
return rv;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CompileTripleCondition(nsRDFQuery* aQuery,
|
|
nsIContent* aCondition,
|
|
TestNode* aParentNode,
|
|
TestNode** aResult)
|
|
{
|
|
// Compile a <triple> condition, which must be of the form:
|
|
//
|
|
// <triple subject="?var1|resource"
|
|
// predicate="resource"
|
|
// object="?var2|resource|literal" />
|
|
//
|
|
// XXXwaterson Some day it would be cool to allow the 'predicate'
|
|
// to be bound to a variable.
|
|
|
|
// subject
|
|
nsAutoString subject;
|
|
aCondition->GetAttr(kNameSpaceID_None, nsGkAtoms::subject, subject);
|
|
|
|
nsCOMPtr<nsIAtom> svar;
|
|
nsCOMPtr<nsIRDFResource> sres;
|
|
if (subject.IsEmpty()) {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_TRIPLE_BAD_SUBJECT);
|
|
return NS_OK;
|
|
}
|
|
if (subject[0] == char16_t('?'))
|
|
svar = do_GetAtom(subject);
|
|
else
|
|
gRDFService->GetUnicodeResource(subject, getter_AddRefs(sres));
|
|
|
|
// predicate
|
|
nsAutoString predicate;
|
|
aCondition->GetAttr(kNameSpaceID_None, nsGkAtoms::predicate, predicate);
|
|
|
|
nsCOMPtr<nsIRDFResource> pres;
|
|
if (predicate.IsEmpty() || predicate[0] == char16_t('?')) {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_TRIPLE_BAD_PREDICATE);
|
|
return NS_OK;
|
|
}
|
|
gRDFService->GetUnicodeResource(predicate, getter_AddRefs(pres));
|
|
|
|
// object
|
|
nsAutoString object;
|
|
aCondition->GetAttr(kNameSpaceID_None, nsGkAtoms::object, object);
|
|
|
|
nsCOMPtr<nsIAtom> ovar;
|
|
nsCOMPtr<nsIRDFNode> onode;
|
|
if (object.IsEmpty()) {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_TRIPLE_BAD_OBJECT);
|
|
return NS_OK;
|
|
}
|
|
|
|
if (object[0] == char16_t('?')) {
|
|
ovar = do_GetAtom(object);
|
|
}
|
|
else if (object.FindChar(':') != -1) { // XXXwaterson evil.
|
|
// treat as resource
|
|
nsCOMPtr<nsIRDFResource> resource;
|
|
gRDFService->GetUnicodeResource(object, getter_AddRefs(resource));
|
|
onode = do_QueryInterface(resource);
|
|
}
|
|
else {
|
|
nsAutoString parseType;
|
|
aCondition->GetAttr(kNameSpaceID_None, nsGkAtoms::parsetype, parseType);
|
|
nsresult rv = ParseLiteral(parseType, object, getter_AddRefs(onode));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
|
|
nsRDFPropertyTestNode* testnode = nullptr;
|
|
|
|
if (svar && ovar) {
|
|
testnode = new nsRDFPropertyTestNode(aParentNode, this, svar, pres, ovar);
|
|
}
|
|
else if (svar) {
|
|
testnode = new nsRDFPropertyTestNode(aParentNode, this, svar, pres, onode);
|
|
}
|
|
else if (ovar) {
|
|
testnode = new nsRDFPropertyTestNode(aParentNode, this, sres, pres, ovar);
|
|
}
|
|
else {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_TRIPLE_NO_VAR);
|
|
return NS_OK;
|
|
}
|
|
|
|
if (! testnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
// add testnode to mAllTests first. If adding to mRDFTests fails, just
|
|
// leave it in the list so that it can be deleted later.
|
|
nsresult rv = mAllTests.Add(testnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete testnode;
|
|
return rv;
|
|
}
|
|
|
|
rv = mRDFTests.Add(testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
*aResult = testnode;
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CompileMemberCondition(nsRDFQuery* aQuery,
|
|
nsIContent* aCondition,
|
|
TestNode* aParentNode,
|
|
TestNode** aResult)
|
|
{
|
|
// Compile a <member> condition, which must be of the form:
|
|
//
|
|
// <member container="?var1" child="?var2" />
|
|
//
|
|
|
|
// container
|
|
nsAutoString container;
|
|
aCondition->GetAttr(kNameSpaceID_None, nsGkAtoms::container, container);
|
|
|
|
if (!container.IsEmpty() && container[0] != char16_t('?')) {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_MEMBER_NOCONTAINERVAR);
|
|
return NS_OK;
|
|
}
|
|
|
|
nsCOMPtr<nsIAtom> containervar = do_GetAtom(container);
|
|
|
|
// child
|
|
nsAutoString child;
|
|
aCondition->GetAttr(kNameSpaceID_None, nsGkAtoms::child, child);
|
|
|
|
if (!child.IsEmpty() && child[0] != char16_t('?')) {
|
|
nsXULContentUtils::LogTemplateError(ERROR_TEMPLATE_MEMBER_NOCHILDVAR);
|
|
return NS_OK;
|
|
}
|
|
|
|
nsCOMPtr<nsIAtom> childvar = do_GetAtom(child);
|
|
|
|
TestNode* testnode =
|
|
new nsRDFConMemberTestNode(aParentNode,
|
|
this,
|
|
containervar,
|
|
childvar);
|
|
|
|
if (! testnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
// add testnode to mAllTests first. If adding to mRDFTests fails, just
|
|
// leave it in the list so that it can be deleted later.
|
|
nsresult rv = mAllTests.Add(testnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete testnode;
|
|
return rv;
|
|
}
|
|
|
|
rv = mRDFTests.Add(testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
*aResult = testnode;
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::AddDefaultSimpleRules(nsRDFQuery* aQuery,
|
|
TestNode** aChildNode)
|
|
{
|
|
// XXXndeakin should check for tag in query processor instead of builder?
|
|
nsContentTestNode* idnode =
|
|
new nsContentTestNode(this,
|
|
aQuery->mRefVariable);
|
|
if (! idnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
// Create (?container ^member ?member)
|
|
nsRDFConMemberTestNode* membernode =
|
|
new nsRDFConMemberTestNode(idnode,
|
|
this,
|
|
aQuery->mRefVariable,
|
|
aQuery->mMemberVariable);
|
|
|
|
if (! membernode) {
|
|
delete idnode;
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
}
|
|
|
|
// add nodes to mAllTests first. If later calls fail, just leave them in
|
|
// the list so that they can be deleted later.
|
|
nsresult rv = mAllTests.Add(idnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete idnode;
|
|
delete membernode;
|
|
return rv;
|
|
}
|
|
|
|
rv = mAllTests.Add(membernode);
|
|
if (NS_FAILED(rv)) {
|
|
delete membernode;
|
|
return rv;
|
|
}
|
|
|
|
rv = mRDFTests.Add(membernode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
rv = idnode->AddChild(membernode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
mSimpleRuleMemberTest = membernode;
|
|
*aChildNode = membernode;
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::CompileSimpleQuery(nsRDFQuery* aQuery,
|
|
nsIContent* aQueryElement,
|
|
TestNode** aLastNode)
|
|
{
|
|
// Compile a "simple" (or old-school style) <template> query.
|
|
nsresult rv;
|
|
|
|
TestNode* parentNode;
|
|
|
|
if (! mSimpleRuleMemberTest) {
|
|
rv = AddDefaultSimpleRules(aQuery, &parentNode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
|
|
bool hasContainerTest = false;
|
|
|
|
TestNode* prevnode = mSimpleRuleMemberTest;
|
|
|
|
// Add constraints for the LHS
|
|
const nsAttrName* name;
|
|
for (uint32_t i = 0; (name = aQueryElement->GetAttrNameAt(i)); ++i) {
|
|
// Note: some attributes must be skipped on XUL template query subtree
|
|
|
|
// never compare against rdf:property, rdf:instanceOf, {}:id or {}:parsetype attribute
|
|
if (name->Equals(nsGkAtoms::property, kNameSpaceID_RDF) ||
|
|
name->Equals(nsGkAtoms::instanceOf, kNameSpaceID_RDF) ||
|
|
name->Equals(nsGkAtoms::id, kNameSpaceID_None) ||
|
|
name->Equals(nsGkAtoms::parsetype, kNameSpaceID_None)) {
|
|
continue;
|
|
}
|
|
|
|
int32_t attrNameSpaceID = name->NamespaceID();
|
|
if (attrNameSpaceID == kNameSpaceID_XMLNS)
|
|
continue;
|
|
nsIAtom* attr = name->LocalName();
|
|
|
|
nsAutoString value;
|
|
aQueryElement->GetAttr(attrNameSpaceID, attr, value);
|
|
|
|
TestNode* testnode = nullptr;
|
|
|
|
if (name->Equals(nsGkAtoms::iscontainer, kNameSpaceID_None) ||
|
|
name->Equals(nsGkAtoms::isempty, kNameSpaceID_None)) {
|
|
// Tests about containerhood and emptiness. These can be
|
|
// globbed together, mostly. Check to see if we've already
|
|
// added a container test: we only need one.
|
|
if (hasContainerTest)
|
|
continue;
|
|
|
|
nsRDFConInstanceTestNode::Test iscontainer =
|
|
nsRDFConInstanceTestNode::eDontCare;
|
|
|
|
static nsIContent::AttrValuesArray strings[] =
|
|
{&nsGkAtoms::_true, &nsGkAtoms::_false, nullptr};
|
|
switch (aQueryElement->FindAttrValueIn(kNameSpaceID_None,
|
|
nsGkAtoms::iscontainer,
|
|
strings, eCaseMatters)) {
|
|
case 0: iscontainer = nsRDFConInstanceTestNode::eTrue; break;
|
|
case 1: iscontainer = nsRDFConInstanceTestNode::eFalse; break;
|
|
}
|
|
|
|
nsRDFConInstanceTestNode::Test isempty =
|
|
nsRDFConInstanceTestNode::eDontCare;
|
|
|
|
switch (aQueryElement->FindAttrValueIn(kNameSpaceID_None,
|
|
nsGkAtoms::isempty,
|
|
strings, eCaseMatters)) {
|
|
case 0: isempty = nsRDFConInstanceTestNode::eTrue; break;
|
|
case 1: isempty = nsRDFConInstanceTestNode::eFalse; break;
|
|
}
|
|
|
|
testnode = new nsRDFConInstanceTestNode(prevnode,
|
|
this,
|
|
aQuery->mMemberVariable,
|
|
iscontainer,
|
|
isempty);
|
|
|
|
if (! testnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
rv = mAllTests.Add(testnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete testnode;
|
|
return rv;
|
|
}
|
|
|
|
rv = mRDFTests.Add(testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
else if (attrNameSpaceID != kNameSpaceID_None || attr != nsGkAtoms::parent) {
|
|
// It's a simple RDF test
|
|
nsCOMPtr<nsIRDFResource> property;
|
|
rv = nsXULContentUtils::GetResource(attrNameSpaceID, attr, getter_AddRefs(property));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
// XXXwaterson this is so manky
|
|
nsCOMPtr<nsIRDFNode> target;
|
|
if (value.FindChar(':') != -1) { // XXXwaterson WRONG WRONG WRONG!
|
|
nsCOMPtr<nsIRDFResource> resource;
|
|
rv = gRDFService->GetUnicodeResource(value, getter_AddRefs(resource));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
target = do_QueryInterface(resource);
|
|
}
|
|
else {
|
|
nsAutoString parseType;
|
|
aQueryElement->GetAttr(kNameSpaceID_None, nsGkAtoms::parsetype, parseType);
|
|
rv = ParseLiteral(parseType, value, getter_AddRefs(target));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
|
|
testnode = new nsRDFPropertyTestNode(prevnode, this,
|
|
aQuery->mMemberVariable, property, target);
|
|
if (! testnode)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
rv = mAllTests.Add(testnode);
|
|
if (NS_FAILED(rv)) {
|
|
delete testnode;
|
|
return rv;
|
|
}
|
|
|
|
rv = mRDFTests.Add(testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
|
|
if (testnode) {
|
|
if (prevnode) {
|
|
rv = prevnode->AddChild(testnode);
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
else {
|
|
aQuery->SetRoot(testnode);
|
|
}
|
|
|
|
prevnode = testnode;
|
|
}
|
|
}
|
|
|
|
*aLastNode = prevnode;
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
RDFBindingSet*
|
|
nsXULTemplateQueryProcessorRDF::GetBindingsForRule(nsIDOMNode* aRuleNode)
|
|
{
|
|
return mRuleToBindingsMap.GetWeak(aRuleNode);
|
|
}
|
|
|
|
void
|
|
nsXULTemplateQueryProcessorRDF::AddBindingDependency(nsXULTemplateResultRDF* aResult,
|
|
nsIRDFResource* aResource)
|
|
{
|
|
ResultArray* arr;
|
|
if (!mBindingDependencies.Get(aResource, &arr)) {
|
|
arr = new ResultArray();
|
|
|
|
mBindingDependencies.Put(aResource, arr);
|
|
}
|
|
|
|
int32_t index = arr->IndexOf(aResult);
|
|
if (index == -1)
|
|
arr->AppendElement(aResult);
|
|
}
|
|
|
|
void
|
|
nsXULTemplateQueryProcessorRDF::RemoveBindingDependency(nsXULTemplateResultRDF* aResult,
|
|
nsIRDFResource* aResource)
|
|
{
|
|
ResultArray* arr;
|
|
if (mBindingDependencies.Get(aResource, &arr)) {
|
|
int32_t index = arr->IndexOf(aResult);
|
|
if (index >= 0)
|
|
arr->RemoveElementAt(index);
|
|
}
|
|
}
|
|
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::AddMemoryElements(const Instantiation& aInst,
|
|
nsXULTemplateResultRDF* aResult)
|
|
{
|
|
// Add the result to a table indexed by supporting MemoryElement
|
|
MemoryElementSet::ConstIterator last = aInst.mSupport.Last();
|
|
for (MemoryElementSet::ConstIterator element = aInst.mSupport.First();
|
|
element != last; ++element) {
|
|
|
|
PLHashNumber hash = (element.operator->())->Hash();
|
|
|
|
nsCOMArray<nsXULTemplateResultRDF>* arr;
|
|
if (!mMemoryElementToResultMap.Get(hash, &arr)) {
|
|
arr = new nsCOMArray<nsXULTemplateResultRDF>();
|
|
if (!arr)
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
mMemoryElementToResultMap.Put(hash, arr);
|
|
}
|
|
|
|
// results may be added more than once so they will all get deleted properly
|
|
arr->AppendObject(aResult);
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::RemoveMemoryElements(const Instantiation& aInst,
|
|
nsXULTemplateResultRDF* aResult)
|
|
{
|
|
// Remove the results mapped by the supporting MemoryElement
|
|
MemoryElementSet::ConstIterator last = aInst.mSupport.Last();
|
|
for (MemoryElementSet::ConstIterator element = aInst.mSupport.First();
|
|
element != last; ++element) {
|
|
|
|
PLHashNumber hash = (element.operator->())->Hash();
|
|
|
|
nsCOMArray<nsXULTemplateResultRDF>* arr;
|
|
if (mMemoryElementToResultMap.Get(hash, &arr)) {
|
|
int32_t index = arr->IndexOf(aResult);
|
|
if (index >= 0)
|
|
arr->RemoveObjectAt(index);
|
|
|
|
uint32_t length = arr->Count();
|
|
if (! length)
|
|
mMemoryElementToResultMap.Remove(hash);
|
|
}
|
|
}
|
|
|
|
return NS_OK;
|
|
}
|
|
|
|
void
|
|
nsXULTemplateQueryProcessorRDF::RetractElement(const MemoryElement& aMemoryElement)
|
|
{
|
|
if (! mBuilder)
|
|
return;
|
|
|
|
// when an assertion is removed, look through the memory elements and
|
|
// find results that are associated with them. Those results will need
|
|
// to be removed because they no longer match.
|
|
PLHashNumber hash = aMemoryElement.Hash();
|
|
|
|
nsCOMArray<nsXULTemplateResultRDF>* arr;
|
|
if (mMemoryElementToResultMap.Get(hash, &arr)) {
|
|
uint32_t length = arr->Count();
|
|
|
|
for (int32_t r = length - 1; r >= 0; r--) {
|
|
nsXULTemplateResultRDF* result = (*arr)[r];
|
|
if (result) {
|
|
// because the memory elements are hashed by an integer,
|
|
// sometimes two different memory elements will have the same
|
|
// hash code. In this case we check the result to make sure
|
|
// and only remove those that refer to that memory element.
|
|
if (result->HasMemoryElement(aMemoryElement)) {
|
|
nsITemplateRDFQuery* query = result->Query();
|
|
if (query) {
|
|
nsCOMPtr<nsIDOMNode> querynode;
|
|
query->GetQueryNode(getter_AddRefs(querynode));
|
|
|
|
mBuilder->RemoveResult(result);
|
|
}
|
|
|
|
// a call to RemoveMemoryElements may have removed it
|
|
if (!mMemoryElementToResultMap.Get(hash, nullptr))
|
|
return;
|
|
|
|
// the array should have been reduced by one, but check
|
|
// just to make sure
|
|
uint32_t newlength = arr->Count();
|
|
if (r > (int32_t)newlength)
|
|
r = newlength;
|
|
}
|
|
}
|
|
}
|
|
|
|
// if there are no items left, remove the memory element from the hashtable
|
|
if (!arr->Count())
|
|
mMemoryElementToResultMap.Remove(hash);
|
|
}
|
|
}
|
|
|
|
int32_t
|
|
nsXULTemplateQueryProcessorRDF::GetContainerIndexOf(nsIXULTemplateResult* aResult)
|
|
{
|
|
// get the reference variable and look up the container in the result
|
|
nsCOMPtr<nsISupports> ref;
|
|
nsresult rv = aResult->GetBindingObjectFor(mRefVariable,
|
|
getter_AddRefs(ref));
|
|
if (NS_FAILED(rv) || !mDB)
|
|
return -1;
|
|
|
|
nsCOMPtr<nsIRDFResource> container = do_QueryInterface(ref);
|
|
if (container) {
|
|
// if the container is an RDF Seq, return the index of the result
|
|
// in the container.
|
|
bool isSequence = false;
|
|
gRDFContainerUtils->IsSeq(mDB, container, &isSequence);
|
|
if (isSequence) {
|
|
nsCOMPtr<nsIRDFResource> resource;
|
|
aResult->GetResource(getter_AddRefs(resource));
|
|
if (resource) {
|
|
int32_t index;
|
|
gRDFContainerUtils->IndexOf(mDB, container, resource, &index);
|
|
return index;
|
|
}
|
|
}
|
|
}
|
|
|
|
// if the container isn't a Seq, or the result isn't in the container,
|
|
// return -1 indicating no index.
|
|
return -1;
|
|
}
|
|
|
|
nsresult
|
|
nsXULTemplateQueryProcessorRDF::GetSortValue(nsIXULTemplateResult* aResult,
|
|
nsIRDFResource* aPredicate,
|
|
nsIRDFResource* aSortPredicate,
|
|
nsISupports** aResultNode)
|
|
{
|
|
nsCOMPtr<nsIRDFResource> source;
|
|
nsresult rv = aResult->GetResource(getter_AddRefs(source));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
nsCOMPtr<nsIRDFNode> value;
|
|
if (source && mDB) {
|
|
// first check predicate?sort=true so that datasources may use a
|
|
// custom value for sorting
|
|
rv = mDB->GetTarget(source, aSortPredicate, true,
|
|
getter_AddRefs(value));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
|
|
if (!value) {
|
|
rv = mDB->GetTarget(source, aPredicate, true,
|
|
getter_AddRefs(value));
|
|
if (NS_FAILED(rv))
|
|
return rv;
|
|
}
|
|
}
|
|
|
|
*aResultNode = value;
|
|
NS_IF_ADDREF(*aResultNode);
|
|
return NS_OK;
|
|
}
|