DomMapper is a lightweight rule engine that maps attributes onto a semantic structure.
The code in this repository is under development and not intended for production use at this time.
DomMapper is open-source software licensed under the BSD 3-clause license. The full text of the license may be found in the LICENSE file.
DomMapper is developed and maintained by Eric Bollens.
DomMapper leverages several open-source components, including Specificity and ES5 array polyfills on the Mozilla Developer Network. A sincere thanks is extended to the authors of these fine projects.
To pull dependencies required to build:
npm install
To generate a build:
node_modules/grunt-cli/bin/grunt
This will produce several files into dist
(and their minified .min.js
equivalent):
dom_mapper-core.js
- DomMapper class definition (must be included)dom_mapper-polyfills.js
- ES5 Array polyfill (for Internte Explorer 7 & 8)dom_mapper-rules-aria_mappings.js
- Common ARIA rulesets
DomMapper.run(AriaMappings.Html5.All);
var rules = [].concat(
AriaMappings.Html5.Landmarks,
{ type: "role", role: "search", selector: "nav.search" },
{ type: "role", role: null, selector: ".no-role", specificity: "1,0,0,0" }
);
DomMapper.run(rules);
var factory = new DomMapper.RulesFactory();
factory.append(AriaMappings.Html5);
factory.append([
{ type: "role", role: "search", selector: "nav.search" },
{ type: "role", role: null, selector: ".no-role" }
]);
factory.generate().run();
To pull dependencies required to test:
npm install
To run the jshint and qunit tests:
node_modules/grunt-cli/bin/grunt test
To view qunit test results through an interface, go to test/index.html
.