This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: https://html.spec.whatwg.org/multipage/forms.html Multipage: https://html.spec.whatwg.org/multipage/#textFieldSelection Complete: https://html.spec.whatwg.org/#textFieldSelection Referrer: https://html.spec.whatwg.org/multipage/embedded-content.html Comment: Do we really want getting <input type=image>.selectionDirection to throw? [[ For input elements, calling these methods while they don't apply, and getting or setting these attributes while they don't apply, must throw an InvalidStateError exception. ]] I noticed this because w(<input type=image>) in Live DOM Viewer hits this exception since it enumerates the attributes and prints the values. The forms API in general is pretty lenient for this kind of thing, so you can check an attribute for any control in a collection without first checking that the control is one where the attribute applies (e.g. type on textarea). Posted from: 94.234.170.175 by simonp@opera.com User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.74 Safari/537.36 OPR/28.0.1750.36 (Edition beta)
Yeah there's an API subset that's intentionally supported on everything in form.elements. But I'm not sure what it would mean for selectionDirection to work on everything. In particular, I think people would find it weirder that it returned something but didn't match reality on <input type=number>, than if it threw.
How about making it return null when it does not apply?
I guess that could work.
This already works across Firefox and Chrome, do we really want to rock the boat here?
https://github.com/nwjs/nw.js/issues/2934 https://bugs.webkit.org/show_bug.cgi?id=111476 (tangentially related but changing to null would make this moot) https://bugzilla.mozilla.org/show_bug.cgi?id=746906 http://stackoverflow.com/questions/13997203/qunit-comparing-hidden-inputs-typeerror-selectiondirection-on-input It appears that throwing is both surprising and causes problems, so I think would be good to change.
I guess, if we can get implementers on board. Mounir seemed pretty skeptical.
https://github.com/whatwg/html/pull/1006