Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java |
| index 75c8bd841deba1ddb41d9b5db317a682e308232b..7afd1a184d71f78acd481210613144bec9d39e7a 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java |
| @@ -488,17 +488,26 @@ public class AdapterInputConnection extends BaseInputConnection { |
| if (a > textLength) a = textLength; |
| if (b > textLength) b = textLength; |
| + CharSequence regionText = null; |
| if (a == b) { |
| removeComposingSpans(mEditable); |
| } else { |
| + if (a == 0 && b == mEditable.length()) { |
| + regionText = mEditable.subSequence(a, b); |
| + // If setting composing region that matches, at least in length, of the entire |
| + // editable region then check it for image placeholders. If any are found, |
| + // don't continue this operation. |
| + // This fixes the problem where, on Android 4.3, pasting an image is followed |
|
aurimas (slooooooooow)
2015/05/27 20:28:13
What does keyboard do if we do not set the composi
bcwhite
2015/05/28 11:18:15
I can find no difference in the behavior of the ke
|
| + // by setting the composing region which then causes the image to be deleted. |
| + // http://crbug.com/466755 |
| + for (int i = a; i < b; ++i) { |
| + if (regionText.charAt(i) == '\uFFFC') return true; |
| + } |
| + } |
| super.setComposingRegion(a, b); |
| } |
| updateSelectionIfRequired(); |
| - CharSequence regionText = null; |
| - if (b > a) { |
| - regionText = mEditable.subSequence(a, b); |
| - } |
| return mImeAdapter.setComposingRegion(regionText, a, b); |
| } |