fix(js): expose DOMStringMap globally - #625
Open
lisa0314 wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
DOMStringMapas a non-enumerable global WebIDL interfaceDOMStringMapinstance as thedatasetProxy targetdata-*property access while allowing prototype properties and symbols to resolve normallyDOMStringMapconstruction illegal while restoring constructor identity,instanceof, and[object DOMStringMap]Previously,
Element.datasetused a plain object as its Proxy target and the runtime did not definewindow.DOMStringMap. Dataset reads and writes worked, but constructor feature detection and prototype identity did not.Validation
[object Object]cargo nextest run -p obscura-js: 281 passedcargo build --releasefunctionfor both global checks andtrueforinstanceofResultgit diff --checkRendering
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
datasetProxy cache remains in place, and the change adds no work to layout, paint, network, or page task loops.Checklist
data-*behavior.obscura-jssuite and release build passed.Fixes #599.