ReviewOS

stacks/very-happy-dom

Keep options off generic HTMLElement and expose it on its control interfaces

#1625
Closed chris opened this 6 days ago ·
6 days ago

VirtualElement.prototype.options exposes a select-only readonly getter through the generic HTMLElement base. An autonomous custom element therefore appears to inherit options, even though a browser's generic HTMLElement has no such member. Code preserving native DOM properties then cannot install its own object-valued options prop.

This blocks retained STX component library hydration and property-upgrade regressions while fixing stacksjs/stx#2129. The same getter also returns an empty list for datalist elements instead of their option descendants.

The HTML Standard defines options on select and datalist interfaces. Source regressions reproduce the generic base leak and the datalist failure, while the existing select lookup continues to pass.

Acceptance:

  • Keep options off generic HTMLElement and ordinary/custom element instances.
  • Expose it on select and datalist constructors and document-created elements.
  • Preserve readonly lookup behavior after option changes and cloning, plus select value behavior.
  • Preserve the current VirtualElement TypeScript surface while placing the runtime accessor on matching controls.
  • Pass relevant and full tests, lint, types, build and normal patch release checks.
  • Verify original publication and adopt it normally in STX, retaining its original hydration and upgrade tests.
6 days ago

The accessor now belongs to select and datalist interfaces. Generic elements can keep a custom object-valued options property, while both control types retain readonly option lookup after edits and cloning. Select value behavior is preserved.

Validation passed: 2,437 tests, lint, types, build and a built-package consumer check. Source CI passed, and the normal 0.4.1 patch publication is running. Acceptance remains open until the original npm archive is verified and STX adopts it through its dependency manifest and lockfile, with the existing hydration and property-upgrade tests retained.

6 days ago

Published in 0.4.1. Generic and custom elements retain their own options properties; select and datalist keep readonly option lookup, including after edits and cloning.

All 2,437 source tests, lint, types, build and the normally installed published consumer passed. The original npm archive matches its accepted upload receipt. STX adoption updates the manifest and lockfile and removes the obsolete preload polyfill. Its retained hydration and property-upgrade cases pass, and the release source gate is green.

Sign in to comment on this issue.