Paste from SpannableString lost text format |
|||
Issue descriptionWhat steps will reproduce the problem? (1) Send a SpannableString to Clipboard. (2) Paste into Gmail and observe. (3) What is the expected result? Text has format. What happens instead? Text has no format.
,
Apr 7 2017
There was a discussion on which of |getHtmlText| and |cocereToHtmlText| to use in Clipboard.java for |getHtmlText| method. The reason for using |getHtmlText| was to prevent promoting plain text to HTML text, however, it will break SpannableString paste.
,
Apr 7 2017
what is cocereToHtmlText?
,
Apr 7 2017
Sorry it is |coerceToHtmlText|, which is behavior differently from |getHtmlText|, it will try to coerce as much as it can from origin type of text to HTML including Intent and URI. On the other hand, getHtmlText will return null if origin source is not HTML type. https://developer.android.com/reference/android/content/ClipData.Item.html#coerceToHtmlText(android.content.Context)
,
Apr 11 2017
A simple replacement will break two bookmark tests, see crrev/2812933003, need to look into it.
,
Apr 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b65bc61d6aa279bc1012d33c55c0019c21abed6e commit b65bc61d6aa279bc1012d33c55c0019c21abed6e Author: ctzsm <ctzsm@chromium.org> Date: Thu Apr 13 22:47:49 2017 Support paste with style from Spanned Only coerce text to HTML when needed, since replace getHtmlText with coerceToHtmlText will break two bookmark tests. 1. if text is HTML. 2. if text is plain text and has style (Spanned). BUG= 709549 Review-Url: https://codereview.chromium.org/2812933003 Cr-Commit-Position: refs/heads/master@{#464584} [modify] https://crrev.com/b65bc61d6aa279bc1012d33c55c0019c21abed6e/ui/android/java/src/org/chromium/ui/base/Clipboard.java [modify] https://crrev.com/b65bc61d6aa279bc1012d33c55c0019c21abed6e/ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java
,
Apr 17 2017
,
Apr 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7076919baf44c4b45db4ea699b833c1485702506 commit 7076919baf44c4b45db4ea699b833c1485702506 Author: ctzsm <ctzsm@chromium.org> Date: Tue Apr 18 16:40:46 2017 Add ClipboardTest.java back ClipboardText.java got deleted due to crrev/2812773002. Some refactor because of new listener functions. BUG= 709549 Review-Url: https://codereview.chromium.org/2824593002 Cr-Commit-Position: refs/heads/master@{#465265} [modify] https://crrev.com/7076919baf44c4b45db4ea699b833c1485702506/base/android/java/src/org/chromium/base/ApiCompatibilityUtils.java [modify] https://crrev.com/7076919baf44c4b45db4ea699b833c1485702506/ui/android/BUILD.gn [modify] https://crrev.com/7076919baf44c4b45db4ea699b833c1485702506/ui/android/java/src/org/chromium/ui/base/Clipboard.java [add] https://crrev.com/7076919baf44c4b45db4ea699b833c1485702506/ui/android/junit/src/org/chromium/ui/base/ClipboardTest.java |
|||
►
Sign in to add a comment |
|||
Comment 1 by sgu...@chromium.org
, Apr 7 2017