Skip to content

fix(js): expose DOMStringMap globally - #625

Open
lisa0314 wants to merge 1 commit into
h4ckf0r0day:mainfrom
lisa0314:fix/599-domstringmap-global
Open

fix(js): expose DOMStringMap globally#625
lisa0314 wants to merge 1 commit into
h4ckf0r0day:mainfrom
lisa0314:fix/599-domstringmap-global

Conversation

@lisa0314

@lisa0314 lisa0314 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What changed

  • expose DOMStringMap as a non-enumerable global WebIDL interface
  • use an internally constructed DOMStringMap instance as the dataset Proxy target
  • preserve live data-* property access while allowing prototype properties and symbols to resolve normally
  • keep direct DOMStringMap construction illegal while restoring constructor identity, instanceof, and [object DOMStringMap]

Previously, Element.dataset used a plain object as its Proxy target and the runtime did not define window.DOMStringMap. Dataset reads and writes worked, but constructor feature detection and prototype identity did not.

Validation

  • red baseline reproduced an undefined interface, false prototype checks, and [object Object]
  • cargo nextest run -p obscura-js: 281 passed
  • cargo build --release
  • issue reproduction now returns function for both global checks and true for instanceofResult
  • git diff --check

Rendering

Not applicable. The change is limited to the JavaScript DOM interface and does not affect layout, paint, screenshots, or rendering fixtures.

Performance

No standalone performance benchmark was run. The existing per-element dataset Proxy cache remains in place, and the change adds no work to layout, paint, network, or page task loops.

Checklist

  • The change is focused and preserves existing live data-* behavior.
  • Regression coverage includes the global constructor, branding, prototype identity, symbols, and reads and writes.
  • The complete obscura-js suite and release build passed.
  • Rendering behavior is unaffected.
  • Performance implications were reviewed without identifying a hot-path expansion.

Fixes #599.

Element.dataset used an ordinary object as its proxy target, so the DOMStringMap interface was absent and instanceof failed. Use an internally constructed DOMStringMap instance while preserving dynamic data-* reflection.

Fixes h4ckf0r0day#599.
@SGavrl SGavrl closed this Aug 14, 2026
@SGavrl SGavrl reopened this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DOMStringMap missing in global scope

2 participants