August brings HtmlUnit 5.5.0 with Firefox 154 and Chrome/Edge 151 support. This release marks another significant step in our journey toward full ECMAScript 6 specification compliance. Together with the Rhino team, we continue delivering critical JavaScript engine improvements while also fixing numerous edge cases across the stack.

🚀 Version 5.5.0 - August 30, 2026

JavaScript Engine: ES6 Compliance Push

The core focus of this release is advancing our JavaScript standards compliance. While we’re not there yet, we’re steadily closing the gap between HtmlUnit and real browser behavior.

new.target Support: Together with the Rhino team, we’ve implemented full support for the new.target keyword, a critical ES6 feature that enables constructor detection and sophisticated meta-programming patterns. This is the kind of fundamental JavaScript feature that many modern frameworks depend on.

Proxy Constructor Trap: Fixed parameter forwarding when the Proxy construct trap forwards its argument list to Reflect.construct(). Proper proxy support is essential for intercepting object creation patterns.

Memory Optimization: Improved slot implementation in the core-js to reduce memory used by function objects—important as we add more standards-compliant features.

CSS Selector and Media Query Fixes

We’ve also made significant improvements to CSS handling:

Selector Validation:

  • Fixed validation for nth-last-child, nth-of-type, and nth-last-of-type pseudo-classes
  • Fixed whitespace handling in one-of attribute selector (~=) to support tabs, newlines, and other whitespace characters
  • Fixed NullPointerException when evaluating relative selectors with next sibling combinator (+) on elements without a next sibling

Media Query Evaluation:

  • Fixed height-based media queries (min-height, max-height, min-device-height, max-device-height) to evaluate against height instead of width
  • Fixed centimeter unit conversion in media queries and CSS values
  • Made media query cache thread-safe
  • Optimized nth-child calculations with exact integer modulo arithmetic instead of floating-point division

CSS Parser Improvements:

  • Fixed @charset parsing to not require whitespace before the charset name
  • Fixed type enum: QUATER renamed to QUARTER (fixing a typo throughout)
  • Improved parser robustness and error handling
  • not and and are now correctly recognized as valid identifiers and media feature names

Range API Fixes

The DOM Range API received several important corrections:

Selection Operations:

  • selectNode() now correctly sets container to the node’s parent with offsets positioned among siblings
  • surroundContents() now correctly throws InvalidStateError when non-Text nodes are partially contained
  • insertNode() now uses DomText.splitText() for proper DOM compliance

Content Manipulation:

  • deleteContents() fixed for proper boundary node resolution
  • Off-by-one bug in text truncation corrected
  • Proper handling when start and end are the same

Fragment Operations:

  • cloneContents() returns empty fragment for collapsed ranges
  • Correctly appends child nodes to DocumentFragment instead of the container itself
  • Fixed node matching logic for same-node scenarios

URL and Bounding Box Improvements

RFC 3986 Compliance: Refactored dot-segment normalization to comply with RFC 3986 section 5.2.4, fixing edge cases with paths like “/a/./b”.

getBoundingClientRect() Fixes:

  • Height calculation now uses style height property if available
  • Fixed width for shrink-to-fit CSS keywords (max-content, min-content)
  • Fixed inline-block elements with width: auto to correctly shrink-wrap
  • Fixed regression where block elements incorrectly used shrink-wrapped width instead of filling the containing block

Testing Infrastructure

MockWebConnection is now more reliable under concurrent access:

  • requestCount_ is now an AtomicInteger
  • lastRequest_ declared volatile
  • Better error messages when methods are called before any request

WebAssert improvements:

  • Exception chaining preserved for better debugging
  • Distinct error messages for different validation failures

Crypto and Compression

SubtleCrypto now strictly validates keyUsages against algorithms and properly initializes DOMException instances in promise rejections.

Decompression improvements:

  • Consistent BOM processing for Brotli and deflate streams
  • Support for all standard zlib headers

Documentation

Added comprehensive Content Extraction guide covering text extraction, CSS visibility, form controls, tables, lists, and serializer formatting rules.

Browser Compatibility

  • Firefox 154 and Chrome/Edge 151 support
  • FontFaceSet now supported in Chrome/Edge
  • Track and source elements have correct default display

Version 5.5.0 is available on Maven Central. Check out the full changes report for the complete list of changes.

Special thanks the Rhino team for another great update.

Happy testing!

— RBRi


Resources: