Commits on May 27, 2019
Commits on Apr 21, 2019
-
Fix HTML serialization breaking after setting certain properties
Various properties that reflect HTML attributes, e.g. <progress>'s value and max properties, would cause HTML serialization (e.g. via innerHTML) to break after they were set, due to a missing conversion causing jsdom to store the attribute's value as a non-string. This fixes the problem in one central location for robustness, even if it may be more per-spec to fix it all the entry points. Fixes #2554.
Commits on Apr 20, 2019
-
Verify that attributes don't have namespaces
Follows the discussion in #2546. This includes linting rules to prevent getAttribute(), setAttribute(), hasAttribute(), removeAttribute(), and toggleAttribute() from being used, in favor of their NS-alternatives. This also bumps the webidl2js minimum version, since that release fixed the same bug in [Reflect]-implemented properties.
Commits on Mar 28, 2019
-
Make innerHTML and outerHTML parsing spec compliant
This pull request fixes the issue discussed here: #2398 (comment). Before this change, innerHTML and outerHTML would directly manipulate their thisArg, using appendChild() and removeChild(), instead of instead of creating a fragment and inserting it in the DOM at the end of the parsing. Moving to the per-spec architecture fixes various correctness issues. Other changes: - Create a generic parser module exposing two methods: parseFragment and parseDocument. This abstracts over the HTML vs. XML distinction. - Migrate all the internal usages of the "htmltodom" module to use the new parser module. - Adjust the implementation of Element's innerHTML, outerHTML, and insertAdjacentHTML(), as well as ShadowRoot's innerHTML, to closer match to the spec. - Update saxes and w3c-xmlserializer to improve XML parsing/serialization.
Commits on Dec 2, 2018
Commits on Oct 29, 2018
-
Properly implement Node tree modification constraints
Most notably, the "ensure pre-insertion validity" algorithm, but also proper versions of all related concepts like "insert", "pre-insert", "append", "replace", ...
-
This finally gives us proper serialization for XML documents and the XMLSerializer interface.
Commits on Oct 8, 2018
Commits on Aug 13, 2018
-
Don't memoize qS()/qSA()/matches()
NWSAPI seems to be fast enough on its own. Includes a testcase in to-upstream. Fixes #1835.
Commits on Jul 26, 2018
Commits on May 23, 2018
-
This replaces nwmatcher with nwsapi which resolves many known issues, supports new selectors, and is significantly faster.
Commits on May 7, 2018
-
Introduce constants for namespaces
Mainly to improve readability in locations where brevity is desired, such as in comparisons.
Commits on Jan 22, 2018
-
Overhaul HTML parsing infrastructure
This changes the HTML parsing infrastructure, in particular how we interface with parse5. The original motivation for this change was increased performance; the new benchmark, which appends 65535 <tr>s, gets a speedup of ~3x from these changes. Other user-visible changes to script evaluation might be present. In particular, the tests revealed that one document.write-related test that used to somehow pass now fails, while another one succeeds (at least on Node 8). In most cases, however, behavior should be the same. While here, we also changed style sheets to reevaluate their rules and update styleEl.sheet or linkEl.sheet appropriately when their child text content changed. Behind the scenes details: - We now use a parse5 tree adapter directly for parsing, instead of using the htmlparser2 adapter layer (which had an O(n) insertion cost for new siblings) - SAX XML parsing code has been simplified by no longer being shared with parse5/htmlparser2 parsing code. - Nodes no longer have a reference to the "core" god-object. This was only used in a couple places, and was error prone because this reference was not available in cases such as document nodes created via the Document constructor. This removes a lot of code that threaded the object throughout everything. - We continued to use hacky workarounds for script evaluation, during parsing and elsewhere. Perhaps one day, inspired by #1316 and #1920, we can fix these.
Commits on Jan 2, 2018
Commits on Nov 19, 2017
-
Convert NamedNodeMap to use IDL
This also switches the ownership of "attribute list" and the associated cache to Element, which is a more literal reading of the spec and simplifies things here in jsdom. Part of #1129.
Commits on Sep 30, 2017
-
Update ESLint rules and pass all of them
This is done via a new script, npm run lint-is-complete, which finds any unset rules. The majority of changes are driven by preferring destructuring and spacing changes.
-
- Renames *.idl to *.webidl - Fixes a bug in HTMLOptionsCollection's IDL where it both inherited from and implemented HTMLCollection. - Updates uses of idlUtils.mixin to use a new copy of that function in jsdom's utils.js. While doing this update, fixed various require() statements to use destructuring more. - Enables a few formerly-disabled web platform tests.
-
Commits on Sep 8, 2017
Commits on Jul 3, 2017
-
Update nwmatcher, and tweak its options and usage
* Deduplicates the addNwmatcher function * Allows getComputedStyle to use an instance of nwmatcher which doesn't throw exceptions, which brings speed benefits. This closes #1560. * Fixes #1740 by pulling in the fix for dperini/nwmatcher#103. * Removes unnecessary "internal querySelector" functionality; we have the impl/wrapper split now to help with that sort of thing. * Adds package-lock.json.
Commits on May 21, 2017
-
Properly implement event handler properties/attributes
This exposes getters/setters for all the on[event] properties on the prototype, thus closing #1354. It also slots them into the correct place in the attribute list upon setting, thus closing #696. Along the way, it generally makes all the event handler processing per-spec; we pass many more web platform tests in this area.
Commits on May 14, 2017
-
-
Upgrade to latest webidl2js features
This also fixes the behavior of setting document.body to null: it should throw a DOMException, not a TypeError.
Commits on Apr 24, 2017
Commits on Feb 4, 2017
Commits on Dec 18, 2016
-
Allow insertAdjacentHTML without a parent element sometimes
That is, when using "afterbegin" and "beforeend", a parent element that is the document or is null should be allowed, per spec. This also refactors the algorithm to follow the spec more closely. Closes #1676.
Commits on Sep 3, 2016
-
The previous commit updated HTMLCollection to work on impls as input, to avoid a lot of confusing back and forth, but this necessitates a lot of code updates. Along the way, this gets rid of the inefficient/general-purpose mapper() utility in favor of more direct and specialized domSymbolTree manipulation. In the course of cleaning this all up, various collection-returning getters (such as `document.applets` or `table.cells`) were made slightly more spec-compliant and efficient. Also added `document.scripts`, `document.embeds`, and `document.plugins`.
-
Fix getElementsByTagName(NS) to return a HTMLCollection
Previously it would return a NodeList. This also updates the logic to be more exactly per-spec. Inspired by #1585, but that still has some fixes for collisions and the like that we do not yet have incorporated.
Commits on May 6, 2016
-
This completely removes mutation events from jsdom. (Fixes #295, finally.) Mutation events are no longer part of the DOM Standard, even though they are part of all existing browsers. They have been superceded by mutation observers. Our hope was to implement mutation observers before removing mutation events. However, recent performance testing reveals that mutation events cause a *massive* slowdown of common DOM operations (like adding nodes or attributes, including during parsing). For example, compiling the ECMAScript draft spec is done using jsdom; compilation time goes from over a minute to less than thirty seconds with this change. Thus, it is worthwhile to remove mutation events even without their replacement in sight yet.
Commits on May 1, 2016
-
Closes #1446. Apparently a lot of cases were not previously caught, and 2.x's "whole-program analysis" is able to catch them, so we fix them here, in addition to enforcing newly-introduced rules.