Skip to content

Commits on Apr 21, 2019

  1. 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.
    domenic committed Apr 21, 2019

Commits on Apr 20, 2019

  1. 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.
    Zirro authored and domenic committed Apr 20, 2019

Commits on Mar 28, 2019

  1. 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.
    pmdartus authored and domenic committed Mar 28, 2019

Commits on Oct 29, 2018

  1. 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", ...
    pmdartus authored and domenic committed Oct 29, 2018
  2. Move to w3c-xmlserializer

    This finally gives us proper serialization for XML documents and the
    XMLSerializer interface.
    Sebmaster authored and domenic committed Oct 29, 2018

Commits on Oct 8, 2018

  1. Implement toggleAttribute()

    Zirro authored and domenic committed Oct 8, 2018
  2. Add support for Shadow DOM

    Fixes #2343.
    pmdartus authored and domenic committed Oct 8, 2018

Commits on Aug 13, 2018

  1. Don't memoize qS()/qSA()/matches()

    NWSAPI seems to be fast enough on its own. Includes a testcase in to-upstream.
    
    Fixes #1835.
    Zirro authored and domenic committed Aug 13, 2018

Commits on Jul 26, 2018

  1. Implement Element.prototype.closest()

    caub authored and domenic committed Jul 26, 2018

Commits on May 23, 2018

  1. Use NWSAPI

    This replaces nwmatcher with nwsapi which resolves many known issues, supports new selectors, and is significantly faster.
    Zirro authored and domenic committed May 23, 2018

Commits on May 7, 2018

  1. Introduce constants for namespaces

    Mainly to improve readability in locations where brevity is desired, such as in comparisons.
    Zirro authored and domenic committed May 7, 2018

Commits on Jan 22, 2018

  1. 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.
    domenic committed Jan 22, 2018

Commits on Jan 2, 2018

Commits on Nov 19, 2017

  1. 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.
    TimothyGu authored and domenic committed Nov 19, 2017

Commits on Sep 30, 2017

  1. 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.
    domenic committed Sep 30, 2017
  2. Upgrade to webidl2js v8.0.0

    - 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.
    domenic committed Sep 30, 2017
  3. Convert DOMTokenList to IDL

    See #1129.
    TimothyGu authored and domenic committed Sep 30, 2017

Commits on Sep 8, 2017

  1. Use domexception module

    Fixes #1939.
    Sebmaster authored and domenic committed Sep 8, 2017

Commits on Jul 3, 2017

  1. 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.
    domenic committed Jul 3, 2017

Commits on May 21, 2017

  1. 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.
    Sebmaster authored and domenic committed May 21, 2017

Commits on May 14, 2017

  1. Remove support for custom parsers

    They have never been fully supported or tested properly, and are a maintenance burden.
    
    Closes #180. Closes #370.
    domenic committed May 14, 2017
  2. Upgrade to latest webidl2js features

    This also fixes the behavior of setting document.body to null: it should throw a DOMException, not a TypeError.
    TimothyGu authored and domenic committed May 14, 2017

Commits on Apr 24, 2017

Commits on Feb 4, 2017

  1. Set 0 defaults for element client and scroll properties

    Fixes #1711, and closes #980 although in a less-ambitious way than anticipated.
    alistairjcbrown authored and domenic committed Feb 4, 2017

Commits on Dec 18, 2016

  1. 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.
    domenic committed Dec 18, 2016

Commits on Sep 3, 2016

  1. Overhaul HTMLCollection usage

    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`.
    domenic committed Sep 3, 2016
  2. 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.
    domenic committed Sep 3, 2016

Commits on May 6, 2016

  1. Remove mutation events (!)

    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.
    domenic committed May 6, 2016

Commits on May 1, 2016

  1. Upgrade to ESLint 2.x

    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.
    domenic committed May 1, 2016

Commits on Mar 27, 2016

  1. Implement ChildNode.prototype.remove

    Sebmaster authored and domenic committed Mar 27, 2016
Older