Bug 928163 - Allow or disallow proper text selection caret display based on HTML <input> type, r=margaret

This commit is contained in:
Mark Capella 2013-10-22 18:46:43 -04:00
Родитель 87cdb639f2
Коммит ffe96c09df
2 изменённых файлов: 4 добавлений и 3 удалений

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

@ -13,7 +13,7 @@ var InputWidgetHelper = {
handleClick: function(aTarget) {
// if we're busy looking at a InputWidget we want to eat any clicks that
// come to us, but not to process them
if (this._uiBusy || !this._isValidInput(aTarget))
if (this._uiBusy || !this.hasInputWidget(aTarget))
return;
this._uiBusy = true;
@ -60,7 +60,7 @@ var InputWidgetHelper = {
}).bind(this));
},
_isValidInput: function(aElement) {
hasInputWidget: function(aElement) {
if (!aElement instanceof HTMLInputElement)
return false;

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

@ -4308,8 +4308,9 @@ var BrowserEventHandler = {
this._sendMouseEvent("mousedown", element, x, y);
this._sendMouseEvent("mouseup", element, x, y);
// See if its an input element, and it isn't disabled
// See if its an input element, and it isn't disabled, nor handled by Android native dialog
if (!element.disabled &&
!InputWidgetHelper.hasInputWidget(element) &&
((element instanceof HTMLInputElement && element.mozIsTextField(false)) ||
(element instanceof HTMLTextAreaElement)))
SelectionHandler.attachCaret(element);