Bug 24439
Summary: | Outdenting invalid html doesn't work as expected | ||
---|---|---|---|
Product: | WebKit | Reporter: | Annie Sullivan <sullivan> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ayg, eric, jparent, michaelthomas |
Priority: | P5 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
URL: | http://www.mozilla.org/editor/midasdemo/ |
Annie Sullivan
I came across this by accident, but it works as expected in Firefox so I thought I'd file it. Definitely low priority, since the html is invalid. Steps to reproduce:
1. Go to midas demo and enter the following html:
<ul><li><b><i>a</b></i></li></ul>
(Note </b> and </i> are in wrong order)
2. Uncheck "View HTML Source" and put the cursor before the 'a'
3. Click "outdent" button.
Actual result:
'a' is moved to next line and empty list item remains. Resulting HTML:
<ul><li><i></i></li></ul><span class="Apple-style-span" style="font-style: italic; font-weight: bold; ">a</span>
Expected result:
Firefox 3 behavior is really nice. It removes the list and fixes your html:
<b><i>a</i></b>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Aryeh Gregor
When you give the browser HTML input, it gets converted to a DOM, and then editing operates only on the DOM. So misnested tags etc. shouldn't be relevant, the question is what DOM is produced. That DOM can almost certainly be produced by valid markup too.
So this behavior difference might have been due to parsing differences anyway, not editing differences. In any event, it seems to work fine now in Chrome 15.0.849.0 dev, just like Firefox. I'm guessing it was fixed by the HTML5 parser.