Formatting tags converted to spans with styles on cut/paste
Reported by
aaron.na...@pearson.com,
Aug 4 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 Steps to reproduce the problem: 1. Open the attached pasteTransform.html in Chrome. 2. Look at the source of the document. Notice that the formatting has B elements. 3. Select all the text in the contenteditable and cut it using Ctrl/Meta+A, Ctrl/Meta+X 4. Paste it back into the contenteditable using Ctrl/Meta+V 5. Look at the HTML now. Notice the B elements have been replaced with SPAN elements with styles. What is the expected behavior? The pasted HTML should be the same as the cut HTML. What went wrong? All formatting tags (B, I, U) are converted to SPAN elements with style attributes. The HTML should not be transformed in this manner. Did this work before? N/A Chrome version: 52.0.2743.82 Channel: stable OS Version: OS X 10.11.5 Flash Version: Shockwave Flash 22.0 r0 The HTML in my example file is what I get from using standard execCommand statements and typing. No special code was used to modify what Chrome created. Before I cut the HTML the contenteditable contains: <div><b><br></b></div><b>aaaa</b> After the cut/paste operation this is the result: Mac: <br class="Apple-interchange-newline"><span style="font-weight: bold">aaaa</span> Windows: <div><br></div><div><span style="font-weight: bold;">aaaa</span><br></div> The formatting tags shouldn't be transformed in this manner by a simple cut/paste operation.
,
Aug 5 2016
,
Aug 5 2016
Yes, this is a bit surprising. From memory this is actually caused when the content is *cut*, not when it is pasted.
,
Aug 13 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f77d0eaedb2787483c147b973bcf7e7de82bf0f3 commit f77d0eaedb2787483c147b973bcf7e7de82bf0f3 Author: joone.hur <joone.hur@intel.com> Date: Sat Aug 13 06:47:05 2016 Keep formatting tags included when it is cut or copied. When we copy/cut a formatting tag without the highest node. the formatting tag's text can be wrapped by <span> tag instead of the formatting tag. This CL allows to keep formatting tags included when it is cut or copied. BUG= 634482 TEST=editing/pasteboard/cut-paste-formatting-tag.html Review-Url: https://codereview.chromium.org/2229703004 Cr-Commit-Position: refs/heads/master@{#411883} [add] https://crrev.com/f77d0eaedb2787483c147b973bcf7e7de82bf0f3/third_party/WebKit/LayoutTests/editing/pasteboard/cut-paste-formatting-tag.html [modify] https://crrev.com/f77d0eaedb2787483c147b973bcf7e7de82bf0f3/third_party/WebKit/Source/core/editing/EditingUtilities.cpp [modify] https://crrev.com/f77d0eaedb2787483c147b973bcf7e7de82bf0f3/third_party/WebKit/Source/core/editing/EditingUtilities.h [modify] https://crrev.com/f77d0eaedb2787483c147b973bcf7e7de82bf0f3/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp [modify] https://crrev.com/f77d0eaedb2787483c147b973bcf7e7de82bf0f3/third_party/WebKit/Source/core/editing/serializers/StyledMarkupSerializer.cpp
,
Oct 17 2016
,
Oct 18 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by msrchandra@chromium.org
, Aug 5 2016Components: Blink>HTML
Labels: M-54 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)