Given the following (bad) html: <ul><li>one</li><li>two</li>selection</ul> 1. Select the text "selection". 2. execCommand('removeFormat', false, null') Result: html is "selection" (Where did "one" and "two" go???) Expected result: <ul><li>one</li><li>two</li>selection</ul> (no change) Use the provided url for a demo, just click "eval once". Also seen in Chrome.
Entertainingly if you start with: <ul><li>one</li><li>two</li>selection</ul> and hit enter with your cursor just before "selection", then you get: <ul><li>one</li><li>two</li><ul><br></ul>selection</ul> I'm not sure what we're supposed to do here. Maybe we're supposed to make the HTML valid before we perform any operations on it?
Wow this is an interesting bug. I'll add a test for it since this bug has been fixed since http://trac.webkit.org/changeset/70283.
Created attachment 71794 [details] Patch
Committed r70500: <http://trac.webkit.org/changeset/70500>