WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
25315
Outdenting a line following a BR tag inside an indented block moves that line above preceding content
https://bugs.webkit.org/show_bug.cgi?id=25315
Summary
Outdenting a line following a BR tag inside an indented block moves that line...
Marcos Almeida
Reported
2009-04-21 16:09:37 PDT
1) go to
http://www.mozilla.org/editor/midasdemo/
2) check View HTML 3) enter "one<br>two" 4) uncheck View HTML 5) select all text inside the editable area 6) press the indent button --> both lines are indented. if you check View HTML, you'll see a blockquote with some styles was created wrapping the original HTML 7) put the cursor at the beginning of "two" 8) press the outdent button --> the "two" line is outdented, but also moved up above the "one" line. it should stay below.
Attachments
Add attachment
proposed patch, testcase, etc.
Julie Parent
Comment 1
2009-04-29 11:47:48 PDT
Plexode demo:
http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contentEditable%20id%3D'ce'%3E%3Cblockquote%20class%3D%22webkit-indent-blockquote%22%20style%3D%22margin%3A%200%200%200%2040px%3B%20border%3A%20none%3B%20padding%3A%200px%3B%22%3Eone%3Cbr%3Etwo%3C%2Fblockquote%3E%3C%2Fdiv%3E&ohh=1&ohj=0&jt=var%20ce%20%3D%20gebi('ce')%3B%0Avar%20sel%20%3D%20window.getSelection()%3B%0Asel.setPosition(ce.firstChild.childNodes%5B2%5D%2C%200)%3B%0Adocument.execCommand('outdent'%2C%20false%2C%20null)%3B%0A%0Ace.innerHTML&ojh=0&ojj=0&ms=100&oth=0&otj=0&cex=1
Just click "eval js now". I'll turn this into a layout test.
Julie Parent
Comment 2
2009-04-29 13:44:20 PDT
This issue isn't limited to BR's. If you replace one<br>two with <div>one</div><div>two</div> it also repros.
Julie Parent
Comment 3
2009-04-29 14:20:30 PDT
Other notes - also happens for non collapsed selections, and for selections anywhere inside of "two", so this isn't just a small broken edge case.
Julie Parent
Comment 4
2009-04-29 14:41:33 PDT
And it get worse. If the selection is inside the first div ('one'), then everything inside the blockquote gets indented.
Julie Parent
Comment 5
2009-04-29 15:46:45 PDT
A couple questions - * I've got a bunch of layout tests written for this - is there any value in getting them checked in without a fix? Or do you usually wait to add tests until you have a fix? * Should this be separated out into separate bug reports? It is hitting different code branches and one fix probably won't fix both issues, but both broken cases (moving outdented content to the wrong location and outdenting subsequent non selected blocks) seem related.
Julie Parent
Comment 6
2009-04-29 17:56:46 PDT
I've got a fix for the second issue, so I've separated that out into another bug:
https://bugs.webkit.org/show_bug.cgi?id=25473
Ryosuke Niwa
Comment 7
2009-07-09 16:51:38 PDT
My patch for
https://bugs.webkit.org/show_bug.cgi?id=25316
will fix this issue as well.
Ryosuke Niwa
Comment 8
2009-07-20 16:21:40 PDT
This problem has been fixed by
http://trac.webkit.org/changeset/45886
.
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