WebKit execCommand bold/italic should remove strong/em tags (since IE inserts them) Our current behavior can be seen here: http://trac.webkit.org/browser/trunk/LayoutTests/editing/execCommand/toggle-styles-expected.txt?rev=40139 FAIL italic removing em -- <em><span class="Apple-style-span" style="font-style: normal;">test</span></em> The problem is that IE inserts <em> for the "italic" execCommand and <strong> for the "bold" command. So we should remove them if we want to interoperate nicely. FF3 does not remove either of these tags. Ojan has strongly recommended that we diverge from FF here and remove the tags just like we currently remove <b> and <i>.
Created attachment 26948 [details] Remove <strong>/<em> when toggling bold/italic to match IE (not FF) LayoutTests/ChangeLog | 9 +++++++++ .../editing/execCommand/toggle-styles-expected.txt | 4 ++-- WebCore/ChangeLog | 12 ++++++++++++ WebCore/editing/ApplyStyleCommand.cpp | 6 ++++-- 4 files changed, 27 insertions(+), 4 deletions(-)
Why do we want to diverge from ffx? "<insert name here> recommends" is not valid justification
Actually, I didn't give the right information. FF's current behavior is clearly wrong IMO. So we're not really diverging. We're diverging from our old behavior, which if you're a semantic web lover, is possibly more "correct" than this new behavior... but less useful, and less IE-compatible. <strong>foo</strong> document.execCommand("bold") produces: WebKit trunk: <strong><span class="Apple-style-span" style="font-weight: normal;">test</span></strong> IE: test FF <strong>test</strong> // clearly wrong IMO after patch: test
Comment on attachment 26948 [details] Remove <strong>/<em> when toggling bold/italic to match IE (not FF) Seems OK. r=me
Landed.