Repository navigation
Releases
1.4.0
1.3.0
1.2.0
- 1.2.0 (#43) (9c29201)
- Publish to npm from GitHub Actions with trusted publishing (#42) (b92ee9d)
- Babel 8 (js-build-tools 8.0.0) (#41) (253b418)
- js-build-tools 7.0.0 (#40) (1c250f0)
- js-build-tools 6.9.0 (#39) (e6f3bdc)
- Lockfile: si-funciona 2.8.0 -> 2.8.2 (drops TypeDoc from the runtime tree) (#38) (aae600e)
- Stop tracking generated build output (
dist/,browser/) in git (#37) (faae6dd) - Generate docs at release, not on every build; add .gitattributes (#36) (7fbbc08)
- Adopt js-build-tools 6.4.1: npm 12 install-script choices and a lint script (#35) (67964c0)
1.1.0
- Sync the class attribute with className, flat browser global, 1.x status (#33) (b96031a)
- bump collect-your-stuff, core-js, si-funciona, js-build-tools, test-filesystem (#34) (aec7815)
- Add copyFiles, release-it (#32) (d28b0f3)
- Chore/update dependencies (#31) (9eea493)
- Chore/bump more dependencies (#30) (ee0b500)
- Bump js-build-tools to 6.1.0 (#29) (91aa2eb)
1.0.1
installGlobal now installs a working global Event class too - a bare new Event(...) + dispatchEvent previously fell through to Node's own incompatible native Event outside a browser or jsdom. Patch release: bug fix, no API change.
0.17.1
Documentation generated by TypeDoc, short README, redundant JSDoc removed. The types come from the signatures now, so @module, @memberOf, @function, @typedef, @class, @augments, @author and the {Type} of @param/@returns are removed. Described @property tags moved onto the members they describe instead of being dropped.
0.17.0
input/textarea/select/button/option/output now have a real value, and input a real checked, like the DOM's: they start from the value/checked attributes (a checkbox or radio with no value reads 'on'), and once set they stop following the attribute without ever changing it. value is always a string, so parseInt(input.value) works on a number attribute. cloneNode keeps them.
Before this, input.value and input.checked were undefined, so code such as parseInt(form.querySelector('input').value) produced NaN - which made battleship's player-count loop never terminate when run headlessly.
0.16.0
getAttributeNode/setAttributeNode/removeAttributeNode give and take real Attr nodes (AttrService) instead of plain strings. setAttributeNode returns the previous Attr with that name, or null when it's new; removeAttributeNode throws when the element has no matching attribute, like the real DOM's.
AttrService's ownerElement is set once at construction and never reassigned, so setAttributeNode/removeAttributeNode work by name-based lookup and replacement in the element's own attribute list rather than transferring ownership of the passed-in node. Every *NS variant (getAttributeNS, hasAttributeNS, setAttributeNS, ...) added too.
0.15.0
All 37 aria* reflected properties (ariaAtomic, ariaLabel, ariaValueNow, ...) are real now, on ElementService (matching the DOM's ARIAMixin). Each is a thin reflection onto its real aria-* attribute through the existing getAttribute/setAttribute, so they need no special-casing in serialization or in getAttributeNames/hasAttributes.
The property-to-attribute-name mapping is not a naive camelCase-to-kebab-case conversion (that would give wrong names like aria-col-count): it's just the aria prefix, lowercased, then the rest of the property name lowercased with no extra hyphens. Verified against the real ARIAMixin mapping for all 37. An unset property reads as '', not undefined/null, matching the rest of this library's string conventions.
0.13.0
Found by actually wiring installGlobal into battleship (a real downstream consumer) and running its game logic in Node: generateDocument assigned INSTANCES to window.Node/window.Element/window.HTMLElement, not the classes themselves. The right-hand side of instanceof must be a constructor, so any code doing x instanceof Element threw "Right-hand side of 'instanceof' is not callable" - a real DOM's window.Element etc. are the classes, not instances. Fixed: Node/Element/HTMLElement now resolve to the service classes themselves. Also adds HTMLDocument, since document instanceof HTMLDocument is a common real-DOM-detection check.
installGlobal also now sets window as a self-reference to its target (matching a real browser's global scope, where window === globalThis).