Bug 25315
Summary: | Outdenting a line following a BR tag inside an indented block moves that line above preceding content | ||
---|---|---|---|
Product: | WebKit | Reporter: | Marcos Almeida <marcosalmeida> |
Component: | HTML Editing | Assignee: | Ryosuke Niwa <rniwa> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | eric, jparent, justin.garcia, rniwa |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Windows XP |
Marcos Almeida
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
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
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
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
And it get worse. If the selection is inside the first div ('one'), then everything inside the blockquote gets indented.
Julie Parent
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
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
My patch for https://bugs.webkit.org/show_bug.cgi?id=25316 will fix this issue as well.
Ryosuke Niwa
This problem has been fixed by http://trac.webkit.org/changeset/45886.