Update DataTransfer.prototype.types to a frozen array that updates on changes |
|||
Issue descriptionIn https://github.com/whatwg/html/issues/11#issuecomment-249155408 we discussed aligning all browsers on a new model for DataTransfer.prototype.types. It has the following changes from Chrome's model: - Return a FrozenArray, instead of an array - Keep returning the same object until changes are made, instead of returning a new object each time. (This helps make dataTransfer.types === dataTransfer.types, which is false in Chrome currently.) The spec pull request is up at https://github.com/whatwg/html/pull/1860, with web platform tests (unfortunately manual) available at https://github.com/w3c/web-platform-tests/pull/3871
,
May 12 2017
,
May 16 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fb8089d1d38e7573bbf99ea1828425bc25630c3d commit fb8089d1d38e7573bbf99ea1828425bc25630c3d Author: raphael.kubo.da.costa <raphael.kubo.da.costa@intel.com> Date: Tue May 16 13:07:26 2017 DataTransfer: Make |types| be a FrozenArray<DOMString>. Fix a TODO item: https://github.com/whatwg/html/issues/11 was solved several months ago by https://github.com/whatwg/html/commit/466379ade56b8ba18584057085443844f4df5669, so we can finally use a FrozenArray here. Due to the way |types| is spec'ed, we need to use the [CachedAttribute] custom extended attribute so that we can tell the bindings layer when a new FrozenArray must be returned. Since the data store item list can change via calls to DataTransfer's setData() and DataTransfer.clearData(), as well as DataTransfer.items' add(), remove() clear(), DataTransfer itself is notified of changes via the newly-added DataObject::Observer whenever DataObject's underlying |item_list_| is modified. A new test has been added to verify this behavior. BUG= 652815 R=foolip@chromium.org,jsbell@chromium.org Review-Url: https://codereview.chromium.org/2875013002 Cr-Commit-Position: refs/heads/master@{#472072} [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/LayoutTests/external/wpt/html/editing/dnd/datastore/datatransfer-constructor-001.html [add] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/LayoutTests/external/wpt/html/editing/dnd/datastore/datatransfer-types.html [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/LayoutTests/external/wpt/interfaces/html.idl [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/Source/core/clipboard/DataObject.cpp [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/Source/core/clipboard/DataObject.h [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/Source/core/clipboard/DataObjectTest.cpp [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/Source/core/clipboard/DataTransfer.h [modify] https://crrev.com/fb8089d1d38e7573bbf99ea1828425bc25630c3d/third_party/WebKit/Source/core/clipboard/DataTransfer.idl
,
May 16 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by pwnall@chromium.org
, Oct 31 2016Status: Available (was: Untriaged)