<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>28225</bug_id>
          
          <creation_ts>2015-03-16 10:37:39 +0000</creation_ts>
          <short_desc>Do we really want getting &lt;input type=image&gt;.selectionDirection to throw?</short_desc>
          <delta_ts>2016-04-06 10:21:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>https://html.spec.whatwg.org/#textFieldSelection</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>118618</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2015-03-16 10:37:39 +0000</bug_when>
    <thetext>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 &lt;input type=image&gt;.selectionDirection to throw?

[[
For input elements, calling these methods while they don&apos;t apply, and getting
or setting these attributes while they don&apos;t apply, must throw an
InvalidStateError exception. 
]]

I noticed this because w(&lt;input type=image&gt;) 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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119098</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-03-30 23:08:18 +0000</bug_when>
    <thetext>Yeah there&apos;s an API subset that&apos;s intentionally supported on everything in form.elements. But I&apos;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&apos;t match reality on &lt;input type=number&gt;, than if it threw.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119138</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2015-03-31 14:21:51 +0000</bug_when>
    <thetext>How about making it return null when it does not apply?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119324</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-04-07 22:33:35 +0000</bug_when>
    <thetext>I guess that could work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125632</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-25 13:24:23 +0000</bug_when>
    <thetext>This already works across Firefox and Chrome, do we really want to rock the boat here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125732</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2016-04-06 08:46:37 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125733</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-04-06 08:50:15 +0000</bug_when>
    <thetext>I guess, if we can get implementers on board. Mounir seemed pretty skeptical.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125734</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2016-04-06 10:21:29 +0000</bug_when>
    <thetext>https://github.com/whatwg/html/pull/1006</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>