WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
42009
indenting a pre inside a table doesn't indent all of the selection
https://bugs.webkit.org/show_bug.cgi?id=42009
Summary
indenting a pre inside a table doesn't indent all of the selection
Tony Chang
Reported
2010-07-09 17:33:27 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Ryosuke Niwa
Comment 1
2010-10-25 21:07:16 PDT
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?
Tony Chang
Comment 2
2010-10-26 13:37:24 PDT
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.
Shezan Baig
Comment 3
2012-05-08 13:16:39 PDT
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/
)
Ahmad Saleem
Comment 4
2022-07-26 12:19:14 PDT
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!
Radar WebKit Bug Importer
Comment 5
2022-07-26 12:33:39 PDT
<
rdar://problem/97621013
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug