github capricorn86/happy-dom v7.0.0

latest releases: v14.7.1, v14.7.0, v14.6.2...
19 months ago

💣 Breaking Changes

  • Changes how CSS properties in CSSStyleDeclaration are parsed, which potentially can break applications (#344)
  • Window.innerWidth and Window.innerHeight is now set to 0 as it is possible to send in the values to the constructor (#344)

🎨 Features

  • Improves support for CSSStyleDeclaration (#344)
    • Parsing and validating of shorthand CSS properties (border, font, background etc.)
    • Parsing and validating of the most common CSS properties (width, height, visibility etc.)
    • Adds support for CSSStyleDeclaration.getPropertyPriority()
    • Adds a cache to improve performance
    • Adds typescript typing for all CSS properties
  • Improves support for Window.getComputedStyle() (#344)
    • Applies styles from <style> and <link> elements
    • Handles inherited properties
    • Handles default values for "display" and "direction"
    • Resolves CSS variables
    • Handles media queries
  • Improves support for CSSStyleSheet (#344)
    • Adds a cache to prevent re-parsing new CSS strings
    • Adds support for CSSContainerRule
    • Only create instances of CSSStyleDeclaration in CSS rules when accesing the "style" property
    • Makes CSSRule, CSSContainerRule, CSSFontFaceRule, CSSKeyframeRule, CSSKeyframesRule, CSSMediaRule and CSSStyleRule available on the Window instance
  • Improves support for Attr (#344)
    • It now extends Node
  • Improves support for HTMLElement.innerText (#344)
    • It will now render the text based on the computed style of the elements
  • Improves support for window.matchMedia() (#344)
    • It will now listen to the window resize event
    • Adds support for matching against "min-width", "max-width", "min-height" and "max-height"
  • Adds support for sending "innerWidth", "innerHeight" and "url" to the Window constructor. (#344)
  • Adds support for setting "innerWidth" and "innerHeight". (#344)
    • Example: window.happyDOM.setInnerWidth(1024)

👷‍♂️ Patch fixes

  • HTMLStyleElement.style no longer returns new instances of CSSStyleSheet (#344)
  • CSSStyleSheet.insertRule() did not insert the rule on the correct position when sending in an index (#344)
  • ChildNode.replaceWith() did not throw an exception when there was no parent, allowing the code to continue (#344)

Hello everyone! 👋

I'm sorry it's taken so long for this release. A lot has happened in my private and work life and I haven't been able to spend as much time on Happy DOM as I would have liked.

I will have more time to put on Happy DOM now again, so stay tuned for many more releases 😉

Don't miss a new happy-dom release

NewReleases is sending notifications on new releases.