<?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>20526</bug_id>
          
          <creation_ts>2012-12-27 18:16:04 +0000</creation_ts>
          <short_desc>This &quot;sorted&quot; attribute seems misleading to me, conveys a different meaning (a state, &quot;sorted&quot;)</short_desc>
          <delta_ts>2013-01-30 20:37:31 +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>WORKSFORME</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#table-sorting-model</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>duboisp2</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>pablocuadrado</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80644</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-12-27 18:16:04 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html
Multipage: http://www.whatwg.org/C#table-sorting-model
Complete: http://www.whatwg.org/c#table-sorting-model

Comment:
This &quot;sorted&quot; attribute seems misleading to me, conveys a different meaning (a
state, &quot;sorted&quot;).  Semantically innacurate. It also has two different
propiertes, a sorting type (&quot;reversed&quot;) and a sorting order (1, 2...N). IMHO,
that&apos;s misguided.

Posted from: 200.61.186.57
User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20121217 Firefox/19.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80645</commentid>
    <comment_count>1</comment_count>
    <who name="Pablo Cúbico">pablocuadrado</who>
    <bug_when>2012-12-27 18:30:36 +0000</bug_when>
    <thetext>Sorry, I wrote the previous comment, just wanted to add:

For example: a &quot;sorted&quot; attribute could be useful for conveying state, like a &quot;selected&quot; or &quot;disabled&quot; attribute.

I guess this could be splitted in something like sortorder=&quot;reversed&quot; and sortindex, or sortpriority for the &gt;= 1 value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80647</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-12-27 21:37:04 +0000</bug_when>
    <thetext>Well, it _is_ a state, in that once the attribute is set, the column is sorted by the user agent.

I don&apos;t think splitting the attribute is a good idea since it makes defining the semantics somewhat more complicated (what if you only have the reversed attribute, for instance? When you click, does it change both? In what order? etc).

Assuming it&apos;s just one attribute, what would be a better name than &quot;sorted&quot;?

I wanted to call it just &quot;sort&quot;, but that conflicts with the method name sort().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80648</commentid>
    <comment_count>3</comment_count>
    <who name="Pablo Cúbico">pablocuadrado</who>
    <bug_when>2012-12-27 21:53:22 +0000</bug_when>
    <thetext>- what would be a better name than &quot;sorted&quot;?
Good question! :) 

As you say, if you consider it to be a state, &quot;sorted&quot; could be the way to go to stick with a single attribute. Unless someone comes up with a better choice.

However, digging a little deeper, I was just thinking that I find the &quot;reversed&quot; keyword a little confusing or &quot;non-standardy&quot;. I prefer &quot;ASCending&quot; or &quot;DESCending&quot; as a directional property (as in SQL), rather than &quot;reversed&quot; vs. &quot;normal&quot;. Defaulting to &quot;ascending&quot; when absent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80722</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-12-30 19:10:02 +0000</bug_when>
    <thetext>The reason it&apos;s &quot;reversed&quot; and not &quot;ascending&quot;/&quot;descending&quot; is that sometimes &quot;reversed&quot; means &quot;ascending&quot;.

Consider this case:

   &lt;table&gt;
    &lt;tr&gt;&lt;th sorted=&quot;reversed 1&quot;&gt;A &lt;th sorted=&quot;2&quot;&gt;N
    &lt;tr&gt;&lt;td&gt;A &lt;td&gt;1
    &lt;tr&gt;&lt;td&gt;A &lt;td&gt;2
    &lt;tr&gt;&lt;td&gt;A &lt;td&gt;3
   &lt;/table&gt;

The result is:

   A N
   A 3
   A 2
   A 1

The primary key is reversed, which flips the sort order of the secondary key, so even though the secondary key is &quot;ascending&quot;, the data is still actually descending. You need this because otherwise clicking the A column to flip the sort order would actually leave the rows in the same sort order in both directions.

But if you want to discuss that further please file a separate bug. This bug is about the naming of the &quot;sorted&quot; attribute.

In the absence of a better suggestion for the name, I can&apos;t really change it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82344</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-01-30 20:37:31 +0000</bug_when>
    <thetext>In the absence of a better name, I am leaving it as &quot;sorted&quot;. Please do reopen the bug if you can come up with a better name soon, though.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>