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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>32003</bug_id>
          
          <creation_ts>2009-11-30 17:39:33 -0800</creation_ts>
          <short_desc>execCommand &quot;indent&quot; inside list causes incorrect positioning of the indented sub-list</short_desc>
          <delta_ts>2022-09-01 16:39:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Venkat Karun">vkarun</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>ayg</cc>
    
    <cc>bfulgham</cc>
    
    <cc>enrica</cc>
    
    <cc>rniwa</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>167485</commentid>
    <comment_count>0</comment_count>
    <who name="Venkat Karun">vkarun</who>
    <bug_when>2009-11-30 17:39:33 -0800</bug_when>
    <thetext>A reduction which shows the exact behavior is given below.

http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contenteditable%3D%22true%22%3E%0A%3Cul%3E%3Cli%20id%3D%22l%22%3Ea%3Cbr%3E%3Cbr%3E%3C%2Fli%3E%3Cli%3Eb%3C%2Fli%3E%3C%2Ful%3E%0A%3C%2Fdiv%3E&amp;ohh=1&amp;ohj=1&amp;jt=li%20%3D%20document.getElementById(%22l%22)%3B%0Ar%20%3D%20document.createRange()%3B%0Ar.setStart(li%2C%202)%3B%0Ar.setEnd(li%2C%202)%3B%0As%20%3D%20window.getSelection()%3B%0As.removeAllRanges()%3B%0As.addRange(r)%3B%0Adocument.execCommand(&apos;indent&apos;%2C%20false)%3B&amp;ojh=1&amp;ojj=1&amp;ms=100&amp;oth=0&amp;otj=0&amp;cex=1

The steps followed in the reduction are detailed below:-

1) Start with the following HTML 

&lt;div contenteditable=&quot;true&quot;&gt;
&lt;ul&gt;&lt;li id=&quot;l&quot;&gt;a&lt;br&gt;&lt;br&gt;&lt;/li&gt;&lt;li&gt;b&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;

2) Programatically create a range containing the last &lt;BR&gt; of &lt;LI id=&quot;l&quot;&gt;.

3) Invoke document.execCommand(&apos;indent&apos;, false)

Actual results:-

&lt;ul&gt;&lt;ul&gt;&lt;li&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;a&lt;br&gt;&lt;/li&gt;&lt;li&gt;b&lt;/li&gt;&lt;/ul&gt;

Expected results:-

&lt;ul&gt;&lt;li&gt;a&lt;br&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;b&lt;/li&gt;&lt;/ul&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453172</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-08-18 11:22:13 -0700</bug_when>
    <thetext>In WebKit, a Selection can&apos;t contain only the last &lt;br&gt; in &lt;li id=l&gt;.  If you try to create a selection like &lt;li&gt;a&lt;br&gt;{&lt;br&gt;}&lt;/li&gt;, it becomes &lt;li&gt;a&lt;br&gt;{}&lt;br&gt;&lt;/li&gt; (using { and } for selection endpoints).  That said, the result here seems to make no sense in WebKit, you&apos;re right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1895646</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-01 16:39:31 -0700</bug_when>
    <thetext>All browsers differ with each other:

*** Safari Technology Preview 152 ***

 Empty intend here
a (Indented)
b (Indented)

*** Firefox Nightly 106 **

    a (Indented)
         Caret here with space in between a &amp; b 
    b (Indented)

*** Chrome Canary 107 ***

    Empty intend here
b (Indented)

______

Just want to share updated testing evidence. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>