Closed Bug 941367 Opened 7 years ago Closed 7 years ago

Fix JavaScript assertions in dom/inputmethod/forms.js caused by trying to get the selection of non-text controls

Categories

(Firefox OS Graveyard :: Gaia, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file)

I'm seeing JavaScript assertions in dom/inputmethod/forms.js that are caused by the code trying to get the selection range of non-text controls. Specifically:

  System JS : ERROR chrome://global/content/forms.js:935 - NS_ERROR_FAILURE:

This is happening with various patches that I have waiting to land to implement <input type=number>, and is the final thing blocking landing of that work. This assertion is preventing the number pad from coming up.
Attached patch patchSplinter Review
Attachment #8335714 - Flags: review?(fabrice)
With this patch the number pad correctly opens without any errors in the console when an <input type=number> is focused.

The mozIsTextField() function is from here:

https://mxr.mozilla.org/mozilla-central/source/dom/webidl/HTMLInputElement.webidl?rev=6be9a40c54b6#157

Hopefully this review should be trivial and obviously correct.
And in cases it's a concern, mozIsTextField has existed since way before gecko 18:

http://hg.mozilla.org/releases/mozilla-b2g18/file/tip/dom/interfaces/html/nsIDOMHTMLInputElement.idl#l102
Comment on attachment 8335714 [details] [diff] [review]
patch

Review of attachment 8335714 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8335714 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/8899f01fcd04

Thanks for the speedy review, Fabrice!
https://hg.mozilla.org/mozilla-central/rev/8899f01fcd04
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.