WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
164114
DOMStringMap reports properties as non-enumerable
https://bugs.webkit.org/show_bug.cgi?id=164114
Summary
DOMStringMap reports properties as non-enumerable
Alexey Shvayka
Reported
2016-10-28 02:10:56 PDT
Consider the following HTML: `<div id=map data-size=16></div>`. In Chrome and Firefox, `Object.getOwnPropertyDescriptor(map.dataset, "zoom").enumerable` is `true`. In Safari it is `false`, but "zoom" gets listed by `Object.keys`. However, it does not work with `Object.assign` and also reports `false` in `propertyIsEnumerable` check. From user-land perspective, this disables neat `Object.assign(el1.dataset, el2.dataset)` trick. For the sake of web compatibility and developer experience, I think Safari should match behavior of other browsers.
Attachments
Patch
(4.98 KB, patch)
2016-10-28 15:54 PDT
,
Chris Dumez
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2016-10-28 15:28:40 PDT
Relevant specs: -
https://heycam.github.io/webidl/#getownproperty-guts
(2.7-9) """ If O implements an interface with a named property setter, then set desc.[[Writable]] to true, otherwise set it to false. If O implements an interface with the [LegacyUnenumerableNamedProperties] extended attribute, then set desc.[[Enumerable]] to false, otherwise set it to true. Set desc.[[Configurable]] to true. """ -
https://html.spec.whatwg.org/multipage/dom.html#domstringmap
Interface is not marked as [LegacyUnenumerableNamedProperties]. So I believe the DOMStringMap's named properties should be Configurable, Enumerable and Writable (because there is a named setter). We currently do the complete opposite.
Chris Dumez
Comment 2
2016-10-28 15:54:12 PDT
Created
attachment 293237
[details]
Patch
WebKit Commit Bot
Comment 3
2016-10-28 16:56:21 PDT
Comment on
attachment 293237
[details]
Patch Clearing flags on attachment: 293237 Committed
r208083
: <
http://trac.webkit.org/changeset/208083
>
WebKit Commit Bot
Comment 4
2016-10-28 16:56:25 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug