New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 652815 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
OoO until Feb 4th
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Update DataTransfer.prototype.types to a frozen array that updates on changes

Project Member Reported by domenic@chromium.org, Oct 4 2016

Issue description

In 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
 

Comment 1 by pwnall@chromium.org, Oct 31 2016

Labels: -Type-Bug Type-Feature
Status: Available (was: Untriaged)
Owner: raphael....@intel.com
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Labels: M-60
Status: Fixed (was: Started)

Sign in to add a comment