<?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>10354</bug_id>
          
          <creation_ts>2010-08-12 20:32:47 +0000</creation_ts>
          <short_desc>What happens if you do an IDL get on size for &lt;select size=0&gt;?  Does it return 0 or 1?</short_desc>
          <delta_ts>2010-10-04 13:57:18 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML5 spec (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#reflecting-content-attributes-in-idl-attributes</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>ayg</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37375</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-08-12 20:32:47 +0000</bug_when>
    <thetext>Section: http://www.whatwg.org/specs/web-apps/current-work/#reflecting-content-attributes-in-idl-attributes

Comment:
&quot;Zero is not allowed&quot; is unclear as normative text.  What happens if you do an
IDL get on size for &lt;select size=0&gt;?  Does it return 0 or 1?  Browsers
disagree: Gecko and WebKit return 1, IE and Opera return 0.  At least in the
case of &lt;select size=0&gt;, returning 1 makes more sense, since that&apos;s how it&apos;s
displayed in all browsers.  Maybe you could also update the section on select
to say that the display size is 1 if it would otherwise be 0, or make a new
algorithm &quot;rules for parsing positive integers&quot; and use that.  Test case:
&lt;!doctype html&gt;&lt;script&gt;var el = document.createElement(&quot;select&quot;);
el.setAttribute(&quot;size&quot;, &quot;0&quot;); alert(el.size);&lt;/script&gt; 

Posted from: 68.175.61.233</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37376</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-08-12 20:53:41 +0000</bug_when>
    <thetext>To be clear, I&apos;m talking about unsigned longs that are limited to only non-negative numbers greater than zero.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37417</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2010-08-14 16:41:30 +0000</bug_when>
    <thetext>&quot;Zero is not allowed&quot; isn&apos;t normative text. The IDL attribute should return 0. (See &lt;http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#rules-for-parsing-non-negative-integers&gt;, which doesn&apos;t fail on 0, so

&gt; ... must first be parsed according to the rules for parsing non-negative
&gt; integers [and] the resulting value must be returned.

applies.) It probably makes sense to change

&gt; and if that is successful, and the value is in the range of the IDL
&gt; attribute&apos;s type,

to

&gt; and if that is successful, the value is not zero and in the range of the IDL
&gt; attribute&apos;s type,

or something like that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37430</commentid>
    <comment_count>3</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-08-15 17:19:19 +0000</bug_when>
    <thetext>Yeah, I think the current spec is reasonably clear that it returns 0, but maybe it should be changed to return 1, at least for select.size.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38351</commentid>
    <comment_count>4</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2010-08-31 20:47:57 +0000</bug_when>
    <thetext>Just to be clear, since the preceding discussion was somewhat confused, the problem is 1) browsers disagree on whether to return 1 or 0 by default for select.size, 2) the spec mandates 0, but 3) 1 makes more sense in this case, so I don&apos;t want to file bugs against browsers without at least suggesting that the spec be changed.  I don&apos;t really care how this is worded in the spec, if it&apos;s changed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39387</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-09-25 18:55:38 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: The interoperability here is nil, especially when you also look at how browsers handle size=&quot;&quot; missing altogether, or size=&quot;a&quot; (i.e. being set to an invalid value), and even more so when you start looking at other attributes with similar rules. So I&apos;ve moved away from IE compat here (which is what I had been trying to go for earlier with these rules) and have specified this somewhat more sanely, such that it never returns 0.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39388</commentid>
    <comment_count>6</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-09-25 18:56:23 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r5495.
Check-in comment: select.size should never return 0 (also affects other attributes)
http://html5.org/tools/web-apps-tracker?from=5494&amp;to=5495</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>