RESOLVED FIXED 21843
execCommand removeFormat is blowing away text outside the selection
https://bugs.webkit.org/show_bug.cgi?id=21843
Summary execCommand removeFormat is blowing away text outside the selection
Julie Parent
Reported 2008-10-23 16:55:48 PDT
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.
Attachments
Patch (2.54 KB, patch)
2010-10-25 14:21 PDT, Ryosuke Niwa
tony: review+
Eric Seidel (no email)
Comment 1 2009-03-10 13:46:18 PDT
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?
Ryosuke Niwa
Comment 2 2010-10-25 14:07:12 PDT
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.
Ryosuke Niwa
Comment 3 2010-10-25 14:21:06 PDT
Ryosuke Niwa
Comment 4 2010-10-25 16:03:39 PDT
Note You need to log in before you can comment on or make changes to this bug.