<?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>29532</bug_id>
          
          <creation_ts>2016-03-15 15:23:41 +0000</creation_ts>
          <short_desc>The CSS &quot;counter-reset&quot; in nested lists does not follow expected numeration in certain situations.</short_desc>
          <delta_ts>2016-03-15 15:37:43 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>Lists and Counters</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tom">iamio</reporter>
          <assigned_to name="Tab Atkins Jr.">jackalmage</assigned_to>
          
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>125503</commentid>
    <comment_count>0</comment_count>
    <who name="Tom">iamio</who>
    <bug_when>2016-03-15 15:23:41 +0000</bug_when>
    <thetext>Steps to reproduce:

I tried to use the CSS Counter property to format the numbering of a nested ordered list. However, because the order list had slightly improper formatting, the numbering is wrong.

Because the nested OL is generated in a content-editable &lt;div&gt;, the ordered list is not properly formatted. The sublist &lt;ol&gt; are direct children of the parent &lt;ol&gt;, instead of being of sublists being children of &lt;li&gt; elements.
Proper formatting of the list would appear as follows:
   &lt;ol&gt;
     &lt;li&gt;item
       &lt;ol&gt;
         &lt;li&gt;subitem&lt;/li&gt;
       &lt;/ol&gt;
     &lt;/li&gt;
   &lt;/ol&gt;

The improper html generated from manipulating lists in a content-editable div is as follows:

&lt;ol&gt;
   &lt;li&gt;item&lt;/li&gt;
   &lt;ol&gt;
     &lt;li&gt;subitem&lt;/li&gt;
   &lt;/ol&gt;
&lt;/ol&gt;


ACTUAL RESULTS

In poorly formatted lists, the CSS counter does coincide with the expected list numeration.

(1) expected value: (1)
      (1.1) expected value: (1.1)
      (1.2) expected value: (1.2)
             (1.2.1) expected value: (1.2.1)
      (1.2.2) WRONG VALUE. expected value: (1.3)
      (1.2.3) WRONG VALUE. expected value: (1.4)
(1.3) WRONG VALUE. expected value: (2)

EXPLANATION

This result happens because the scope of CSS counter-reset affects both descendant elements and subsequent sibling elements. The sublist counter-reset scope takes precedence over higher-level counter-reset.

SCOPE OF PROBLEM

This numeration issue doesn&apos;t only affect invalid HTML lists. It would also affect any HTML representation of nested elements. I want to create a visual representation of set theory by using nested div elements that are labeled with counter-reset values.

&lt;div id=&quot;whole set&quot;&gt; 1
    &lt;div id=&quot;first subset&quot;&gt;  1.1
       &lt;div id=&quot;first sub-subset&quot;&gt;  1.1.1
&lt;/div&gt;
    &lt;div&gt;
    &lt;div id=&quot;second subset&quot;&gt;1.1.2&lt;/div&gt;
&lt;/div&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125504</commentid>
    <comment_count>1</comment_count>
    <who name="Tom">iamio</who>
    <bug_when>2016-03-15 15:37:43 +0000</bug_when>
    <thetext>I am really sorry. I was working on reporting a possible issue, but I accidentally submitted this bug. Please disregard and close this issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>