Paste command should not ignore text-decoration:none
Reported by
badalsur...@gmail.com,
Sep 28 2017
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Example URL: Steps to reproduce the problem: 1. Go to https://codepen.io/Badal/pen/vemQEo?editors=1000 2. Select “Test Link” and copy it.(bottom one html preview) 3. Go to in web based rich text editor in chrome (Google docs, google forum new post etc.) 4. Paste it and right click on “Test Link” and inspect element, it will not have the text-decoration:none; css rule What is the expected behavior? Hyperlinks should keep the text-decoration:none css rule. Check out this google doc url for more detail https://docs.google.com/document/d/1rtX8_Es6lzKXalIPqcuF0vqiELPzns08QSVXfxv36NI/edit What went wrong? text-decoration:none got removed from the css Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 61.0.3163.100 Channel: stable OS Version: OS X 10.13.0 Flash Version:
,
Sep 28 2017
,
Sep 28 2017
,
Sep 29 2017
Tested on latest Chrome Canary #63.0.3227.0 and Stable #61.0.3163.100 on Windows 10, Ubuntu 14.04, Mac 10.12.6 and able to reproduce the issue. Please find the bisect info below: Chrome Good Build - 57.0.2926.0 (433437) Chrome Bad Build - 57.0.2928.0 (433845) You are probably looking for a change made after 433538 (known good), but no later than 433539 (first known bad). CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/b3857608c8682df22c86ea1820a761a319cec541..da8225b9b7de29db904e7a130a8591c2e0c2ffce Review-On: https://codereview.chromium.org/2516333002 @drott -- Could you please look into the issue, pardon me if it has nothing to do with your changes and if possible please assign it to concern owner. Thanks.
,
Oct 2 2017
,
Oct 3 2017
Mark WontFix since I could not reproduce this, M61/stable and M63/canary Here is clipboard data when after copying selecting "Test Link" containing "text-decoration: none" Note: Select and copy partial anchor text also contains "text-decoration:none" Version:0.9 StartHTML:0000000218 EndHTML:0000000704 StartFragment:0000000254 EndFragment:0000000668 SourceURL:https://s.codepen.io/boomerang/iFrameKey-79097087-a449-acbe-c6e1-6466c4a13d79/index.html?editors=1000 <html> <body> <!--StartFragment--><a href="https://www.google.com/" style="font-family: " Times New Roman" ; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; ">Test Link</a><!--EndFragment--> </body> </html>
,
Oct 3 2017
@yosin -- "text-decoration:none" is missing only when you paste it inside chrome not outside it. Issue is not with copying its when you paste it. if you copy from chrome and paste it in Firefox(or any other browser) it works fine but when you paste it in chrome it will not have "text-decoration:none" Please reopen the issue.
,
Oct 3 2017
#c8, thanks for explanation! Reopen and change component to Blink>Editing>Command. This is "paste" command issue instead of "copy", aka serialization, issue.
,
Oct 7 2017
any update on this?
,
Oct 7 2017
Note: This doesn't repro if you just paste in a generic contenteditable element (e.g. if you navigate to the URL "data:text/html, <div contenteditable>" and paste it there). It does repro if you paste into Google Docs.
,
Oct 7 2017
#c11 i tested it on contenteditable element and when i checked the source code i got this
<div contenteditable="" style="width:200px;height:50px;border: 1px solid ">
<a href="https://www.google.com/" style="text-decoration-line: none;">Test Link</a>
</div>
it replaces "text-decoration: none;" to "text-decoration-line: none;"
just copy and paste "Test Link" on this page https://codepen.io/Badal/pen/BwYGYO?editors=1000 into black bordered contenteditable div and check source code.
,
Oct 7 2017
We don't guarantee that the markup is exactly the same if you copy and paste it. The code works by looking at the existing computed style on the element, and determining what style needs to be applied to the new element to get it to look the same after it's pasted. In some cases (e.g. it would pick up a different style from surrounding elements), we need to add extra CSS. In this case, the <a> element only changed text-decoration-line, not text-decoration-style or text-decoration-color (text-decoration is shorthand for these three properties), so there's no need to also set those properties to none.
,
Jan 10 2018
,
Mar 5 2018
,
Sep 18
I have a similar issue copying and pasting posts from a WordPress plugin to a Constant Contact template. Firefox leaves the CSS style properties alone so everything copies perfect. Chrome will remove style properties with default values and will change the color to rgb(68,68,68) instead of leaving it alone with the intended values. Switching to hex colors had the same result. Furthermore, the tags are changed on copy and not on paste. I can copy from Firefox and paste into Chrome. The reverse is not true. I can't copy with Chrome and paste with Firefox. Chrome mangles the style properties before it gets pasted.
,
Sep 18
Tested with Chrome 68 and 69 on Windows 10. My guess is that the color isn't even being copied and Constant Contact is setting a default color value. Example HTML: <span style="font-size: 16px; color: rgb(66, 33, 11); text-decoration: none; font-weight: bold; font-style: normal;">Test Post</span> <a href="https://google.com" style="font-size: 12px; color: rgb(51, 89, 117); text-decoration: none; font-weight: bold; font-style: normal;">Continue Reading</a> HTML after Copy/Paste with Chrome: <span style="font-size: 16px; color: rgb(68, 68, 68); font-weight: bold;">Test Post</span> <a href="https://google.com" style="font-size: 12px; color: rgb(68, 68, 68);">Continue Reading</a> |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by badalsur...@gmail.com
, Sep 28 2017