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
parent b934e6f1de
commit 99bb96fc84
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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);