RESOLVED FIXED 23466
WebKit editing commands should remove empty (attribute-less) span tags (like FF does)
https://bugs.webkit.org/show_bug.cgi?id=23466
Summary WebKit editing commands should remove empty (attribute-less) span tags (like ...
Eric Seidel (no email)
Reported 2009-01-21 16:16:45 PST
WebKit editing commands should remove empty (attribute-less) span tags (like FF does) Right now we do something like this: <span style="font-weight: bold">test</span> document.execCommand("bold", false, null); <span>test</span> where as FF would remove the same <span> tags. After talking with Ojan and Julie here @ the Goog (who have both written a lot of JS HTML Editing code), we agree that FF's behavior is more what authors will like. Authors can trivially cause us to leave the <span> tags, but adding any attribute. For example <span a> would cause us to leave the span tag instead of removing it (after my fix). Test case (and fix) forthcoming.
Attachments
Remove <span> turds left by editing commands (11.45 KB, patch)
2009-01-22 16:34 PST, Eric Seidel (no email)
justin.garcia: review+
Eric Seidel (no email)
Comment 1 2009-01-22 16:34:13 PST
Created attachment 26946 [details] Remove <span> turds left by editing commands LayoutTests/ChangeLog | 12 ++++++ .../execCommand/empty-span-removal-expected.txt | 14 +++++++ .../editing/execCommand/empty-span-removal.html | 13 ++++++ .../execCommand/resources/empty-span-removal.js | 40 ++++++++++++++++++++ .../editing/execCommand/toggle-styles-expected.txt | 12 +++--- WebCore/ChangeLog | 21 ++++++++++ WebCore/editing/ApplyStyleCommand.cpp | 28 +++++++++++--- 7 files changed, 128 insertions(+), 12 deletions(-)
Eric Seidel (no email)
Comment 2 2009-02-03 17:37:09 PST
Already landed.
Note You need to log in before you can comment on or make changes to this bug.