Bug 1307816 - 2. Make clearSpans call go through Gekco; r=esawin

Currently, clearSpans calls are carried out immediately, but that makes
it out of order in relation to other calls, which have to go through
Gecko. This patch fixes this issue.
This commit is contained in:
Jim Chen 2016-10-25 12:28:53 -04:00
Родитель db7d4844ae
Коммит 8ad0835dc6
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -838,7 +838,11 @@ final class GeckoEditable extends JNIObject
break;
case Action.TYPE_REMOVE_SPAN:
mText.removeSpan(action.mSpanObject);
if (action.mSpanObject != null) {
mText.removeSpan(action.mSpanObject);
} else {
mText.clearSpans();
}
break;
case Action.TYPE_SET_HANDLER:
@ -1258,6 +1262,10 @@ final class GeckoEditable extends JNIObject
@Override
public void removeSpan(Object what) {
if (what == null) {
return;
}
if (what == Selection.SELECTION_START ||
what == Selection.SELECTION_END) {
Log.w(LOGTAG, "selection removed with removeSpan()");
@ -1318,7 +1326,8 @@ final class GeckoEditable extends JNIObject
/* XXX this clears the selection spans too,
but there is no way to clear the corresponding selection in Gecko */
Log.w(LOGTAG, "selection cleared with clearSpans()");
mText.clearSpans();
mActionQueue.offer(Action.newRemoveSpan(/* what */ null, /* update */ true));
mNeedCompositionUpdate = true;
}
@Override