Attributes on drag&drop are lost
Reported by
sombra2e...@gmail.com,
Feb 29 2016
|
||||||
Issue descriptionChrome Version : 47.0.2526.73 (Build para desarrolladores) Ubuntu 15.04 (64 bits) URLs (if applicable) : https://jsfiddle.net/sombra2eternity/2bLcs91y/2/ Other browsers tested: have tested this issue: Firefox: OK What steps will reproduce the problem? 1. Drop the image, you will get "test" 2. Drop the anchor, you should get "test" 3. It should work with any other attributes like data-* What is the expected result? The attributes are preserved in both cases What happens instead? The attributes are lost in anchor case but ok on image case A javascript workaround: ondragstart="event.dataTransfer.setData('text/html',this.outerHTML);"
,
Mar 1 2016
The attached video shows the correct procedure :-) The second alert should be 'test' too. The problem here is that chrome/chromium strips the attributes when dropping an anchor text and recovering through 'text/html'. They are still available when an image is dropped instead an anchor. In this case I tried to read the "class" attribute, but you could try with "id" or any "data-*", they are stripped too. If the element is "<a class="test" id="foo" data-foo="lalala" href="http://google.es">drop this link</a>" then it comes as "<a href="http://google.es">drop this link</a>" only "href" is preserved. Firefox preserve all attributes in both cases.
,
Mar 24 2016
,
Mar 25 2016
Thank you for providing more feedback. Adding requester "rnimmagadda@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 29 2016
Able to repro this issue on Windows 7, MAC (10.11.3) & Ubuntu Trusty (14.04) for Google Chrome Stable Version - 49.0.2623.110 This is a Non-Regression issue existing from M30 - # 30.0.1549.0
,
Apr 5 2016
Firefox does this so we should match them. Edge doesn't appear to have enough DnD support for the test case to work.
,
Apr 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3accf1e624bb65f3c4b594e646b54b28dab05c21 commit 3accf1e624bb65f3c4b594e646b54b28dab05c21 Author: dcheng <dcheng@chromium.org> Date: Wed Apr 06 03:25:55 2016 Serialize original node when dragging a link instead of synthesizing HTML. This preserves the original attributes, like what already happens for image and selection drags today. BUG= 590912 Review URL: https://codereview.chromium.org/1860293003 Cr-Commit-Position: refs/heads/master@{#385378} [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/LayoutTests/editing/pasteboard/dragstart-contains-default-content-expected.txt [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/LayoutTests/editing/pasteboard/drop-link.html [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/Source/core/clipboard/DataTransfer.h [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/Source/core/editing/serializers/Serialization.h [modify] https://crrev.com/3accf1e624bb65f3c4b594e646b54b28dab05c21/third_party/WebKit/Source/core/page/DragController.cpp
,
Apr 6 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by rnimmagadda@chromium.org
, Mar 1 2016Labels: Needs-Feedback
3.5 MB
3.5 MB Download