<?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>11937</bug_id>
          
          <creation_ts>2011-02-01 11:48:56 +0000</creation_ts>
          <short_desc>Progress element should be indeterminate if the value attribute isn&apos;t a valid float</short_desc>
          <delta_ts>2013-09-12 20:17:24 +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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NEEDSINFO</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>blocked awaiting response from mounir to comment 14 (please remove this when replying)</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mounir Lamouri">mounir</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>eoconnor</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44936</commentid>
    <comment_count>0</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2011-02-01 11:48:56 +0000</bug_when>
    <thetext>The specs currently says:
&quot;User agent requirements: If the value attribute is omitted, then the progress bar is an indeterminate progress bar. Otherwise, it is a determinate progress bar.&quot;

I think this should be changed to:
&quot;User agent requirements: If the value attribute is omitted or parsing the value attribute&apos;s value according to the rules for parsing floating point number values results in an error, then the progress bar is an indeterminate progress bar. Otherwise, it is a determinate progress bar.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44944</commentid>
    <comment_count>1</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2011-02-01 14:00:14 +0000</bug_when>
    <thetext>data:text/html,&lt;progress value=&apos;foo&apos;&gt;&lt;/progress&gt;&lt;script&gt;alert(document.getElementsByTagName(&apos;progress&apos;)[0].position)&lt;/script&gt;

Opera: 0
Webkit: 0
Specs: 0

I think we should change that for -1 because the progress element should be considered in an indeterminate mode if @value isn&apos;t a valid foat.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46033</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-25 07:59:15 +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: Rejected
Change Description: no spec change
Rationale: The idea is you can trivially determine what kind of progress bar it is using a simple attribute selector rule, which makes doing things like mapping bindings easier.

If there&apos;s a compelling reason to do otherwise, though, please feel free to reopen the bug (you don&apos;t actually give a reason in the comments above at all).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>46052</commentid>
    <comment_count>3</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2011-02-25 14:18:45 +0000</bug_when>
    <thetext>&gt; Rationale: The idea is you can trivially determine what kind of progress bar it
&gt; is using a simple attribute selector rule, which makes doing things like
&gt; mapping bindings easier.

Oh... My current implementation is using the :indeterminate pseudo-class. It seems simpler. I should probably open a bug for that actually. 

&gt; If there&apos;s a compelling reason to do otherwise, though, please feel free to
&gt; reopen the bug (you don&apos;t actually give a reason in the comments above at all).

The reasons are multiple actually. First of all, it seems to make more sense to make the progress indeterminate when you can&apos;t do anything with the value. That would mean &lt;progress value=&quot;&quot;&gt;&lt;/progress&gt; and &lt;progress&gt;&lt;/progress&gt; are different: the first is determinate and the second isn&apos;t. In addition, that way, progress.position != -1 would be a guarantee that progress @value is a number which could save a few lines of JS, I guess.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48061</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-05 08:01:55 +0000</bug_when>
    <thetext>Well don&apos;t forget that all those cases where value=&quot;&quot; is present but you&apos;re saying should be treated as indeterminate are cases where the element is invalid anyway, so authors really shouldn&apos;t be doing any of them anyway.

Re :indeterminate, it seems easier to define :indeterminate just as a matter of whether an attribute is present or not than require that the UA parse the attribute to determine it.

Plus, Opera and WebKit already do this...

I dunno, it doesn&apos;t seem very compelling to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48355</commentid>
    <comment_count>5</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2011-05-09 10:44:53 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Well don&apos;t forget that all those cases where value=&quot;&quot; is present but you&apos;re
&gt; saying should be treated as indeterminate are cases where the element is
&gt; invalid anyway, so authors really shouldn&apos;t be doing any of them anyway.

But they are going to do that :)

&gt; Re :indeterminate, it seems easier to define :indeterminate just as a matter of
&gt; whether an attribute is present or not than require that the UA parse the
&gt; attribute to determine it.

We are already requesting that kind of stuff for :in-range and :out-of-range which only apply if min and max have a valid value. In addition, for the ease of implementation, .value is a double so it&apos;s very likely that the UA knows if the value is a valid double or not.

&gt; Plus, Opera and WebKit already do this...

The progress element isn&apos;t used that much and Opera and Webkit implementations already have a few differences with the current specifications. I do not think we should worry about that.

&gt; I dunno, it doesn&apos;t seem very compelling to me.

Actually, now that :indeterminate is in the specifications, I wonder why we still need the current behavior. You said it was useful to check if the progress is indeterminate but now, why is it? I do not believe changing the specs would cost anything at this point so being conservative seems worthless.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>48384</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-05-09 22:49:49 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; &gt; Well don&apos;t forget that all those cases where value=&quot;&quot; is present but you&apos;re
&gt; &gt; saying should be treated as indeterminate are cases where the element is
&gt; &gt; invalid anyway, so authors really shouldn&apos;t be doing any of them anyway.
&gt; 
&gt; But they are going to do that :)

Sure, but probably not intentionally. I don&apos;t see why we&apos;d try to second-guess what they mean here; they are as likely to want a value=0 determinate bar as an indeterminate one, IMHO.


&gt; &gt; Re :indeterminate, it seems easier to define :indeterminate just as a matter of
&gt; &gt; whether an attribute is present or not than require that the UA parse the
&gt; &gt; attribute to determine it.
&gt; 
&gt; We are already requesting that kind of stuff for :in-range and :out-of-range
&gt; which only apply if min and max have a valid value. In addition, for the ease
&gt; of implementation, .value is a double so it&apos;s very likely that the UA knows if
&gt; the value is a valid double or not.

Granted.


&gt; &gt; Plus, Opera and WebKit already do this...
&gt; 
&gt; The progress element isn&apos;t used that much and Opera and Webkit implementations
&gt; already have a few differences with the current specifications. I do not think
&gt; we should worry about that.

I do worry about it. Nobody is bug free, but adding more bugs isn&apos;t a way to get to a bug-free state.


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: Rejected
Change Description: no spec change
Rationale: 

&gt; Actually, now that :indeterminate is in the specifications, I wonder why we
&gt; still need the current behavior. You said it was useful to check if the
&gt; progress is indeterminate but now, why is it? I do not believe changing the
&gt; specs would cost anything at this point so being conservative seems worthless.

I don&apos;t see any value in the change you are asking for. It doesn&apos;t simplify life for authors, it doesn&apos;t simplify life for implementors, it doesn&apos;t simplify life for spec writers, and it isn&apos;t more &quot;pure&quot;. There are no use cases for it, the cases where it would happen are all cases that are non-conforming anyway, it doesn&apos;t add any new features, it doesn&apos;t seem to solve any problems... I just don&apos;t see the point. It&apos;s not a matter of being conservative, it&apos;s just that I don&apos;t see what&apos;s wrong with what we have now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>53421</commentid>
    <comment_count>7</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2011-08-04 05:13:42 +0000</bug_when>
    <thetext>mass-move component to LC1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80836</commentid>
    <comment_count>8</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-01-02 16:17:47 +0000</bug_when>
    <thetext>I happened to came back to that bug today.

I think the issue I have is that we have two default values for the &quot;current value&quot;. The first one is when there is no @value and the second one is when @value is set to an invalid value (ie. can&apos;t be parsed as a float). It seems weird that we have two default values and AFAICT, it is not a common pattern. I think having one default value would make things simpler to understand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80967</commentid>
    <comment_count>9</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-01-06 19:10:19 +0000</bug_when>
    <thetext>Re-opening, per Hixie&apos;s comment on IRC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84150</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-08 23:52:39 +0000</bug_when>
    <thetext>&gt; I think the issue I have is that we have two default values for the &quot;current
&gt; value&quot;. The first one is when there is no @value and the second one is when
&gt; @value is set to an invalid value (ie. can&apos;t be parsed as a float).

Both are zero, no? I mean, progress.value returns zero whether the attribute is missing or whether it has an invalid value like &quot;foo&quot; or &quot;-5&quot;.

What do you see as being the two default values?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86624</commentid>
    <comment_count>11</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-04-23 21:23:50 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; &gt; I think the issue I have is that we have two default values for the &quot;current
&gt; &gt; value&quot;. The first one is when there is no @value and the second one is when
&gt; &gt; @value is set to an invalid value (ie. can&apos;t be parsed as a float).
&gt; 
&gt; Both are zero, no? I mean, progress.value returns zero whether the attribute
&gt; is missing or whether it has an invalid value like &quot;foo&quot; or &quot;-5&quot;.
&gt; 
&gt; What do you see as being the two default values?

You are right. I have no idea why I wrote that...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86913</commentid>
    <comment_count>12</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-26 23:36:24 +0000</bug_when>
    <thetext>Ok. Back to WONTFIX, then, unless you disagree. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86935</commentid>
    <comment_count>13</comment_count>
    <who name="Mounir Lamouri">mounir</who>
    <bug_when>2013-04-28 23:31:05 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Ok. Back to WONTFIX, then, unless you disagree. :-)

Actually not. And sorry for wasting your time with my previous comment...

We recently got a feedback from our Firefox OS frontend team that wanted to make a progress element indeterminate using `progress.value = undefined;` [1]. They said that using .removeAttribute(&apos;value&apos;) is ackward because they wanted to modify the internal state of the element, not the DOM. Given that those people are frontend developers, I believe it is an interesting feedback and maybe this use case should be considered.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=842500</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87019</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-30 17:39:38 +0000</bug_when>
    <thetext>Well setting .value does the same as setting setAttribute(&apos;value&apos;), there&apos;s no internal state. :-)

We could have a .indeterminate IDL attribute that returns true if the value attribute is absent and false if it&apos;s present, and when you set it to true it removes the attribute and when you set it to false it sets it to zero. Purely a convenience thing, but if you want tot implement it, I&apos;m game. :-)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>