Here's a test case: http://plexode.com/eval3/#ht=%3Ctable%20contenteditable%3Dtrue%3E%0A%3Ctr%3E%3Ctd%3E%3Cpre%20id%3D'p'%3Eline%201%0Aline%202%3C%2Fpre%3E%3C%2Ftd%3E%3C%2Ftr%3E%0A%3C%2Ftable%3E&ohh=1&ohj=1&jt=var%20p%20%3D%20document.getElementById(%22p%22)%3B%0Avar%20selection%20%3D%20window.getSelection()%3B%0Aselection.setBaseAndExtent(p%2C%200%2C%20p%2C%200)%3B%0Aselection.modify(%22extend%22%2C%20%22forward%22%2C%20%22line%22)%3B%0Aselection.modify(%22extend%22%2C%20%22forward%22%2C%20%22line%22)%3B%0Adocument.execCommand(%22indent%22)%3B&ojh=1&ojj=1&ms=100&oth=0&otj=0&cex=1 The test case should indent the 2 lines of text, but instead it indents the 2 lines but leaves a duplicate of the second line. After fixing bug 38231, the correct lines get indented, but there are extra blank lines between the indented lines.
Hi Tony, This bug doesn't reproduce on WebKit nightly build as far as I checked. Could you verify that this bug has been fixed?
It no longer duplicates the second line, but the second line doesn't seem to get indented. The resulting html in the table cell is: <td><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><pre id="p">line 1</pre></blockquote><pre id="p">line 2</pre></td> I would expect both <pre> tags to be in the blockquote or separate blockquote elements around each pre.
see also http://jsfiddle.net/5ft7U/, not sure if it is related to this bug. the 'line1' should not be duplicated. this happens when "white-space: pre" style is specified. Without "white-space: pre", there is no duplication of line1 (http://jsfiddle.net/5ft7U/1/)
I am not sure on expected behavior across browsers or web-spec but this is Current result across all browsers: *** Safari 15.6 on macOS *** On Test case from Comment 0 - It shows 'line 1' as indented while 'line 2' as not. On Test case from Comment 3 - It shows only one line *** Firefox Nightly 104 *** On Test case from Comment 0 - It shows 'line 1' as indented while 'line 2' as not. On Test case from Comment 3 - It shows only one line *** Chrome Canary 106 *** On Test case from Comment 0 - It shows both line non-intended On Test case from Comment 3 - It shows two lines _____ Just wanted to share updated results, please mark this bug resolved etc. Thanks!
<rdar://problem/97621013>