execCommand("fontsize") on certain selected html generates too many SPAN tags. 1. Have this HTML code inside a contentEditable DIV: (code beautified, class="Apple-span-style" removed) A man with 2 <span style="font-family: Courier New, Courier"> font faces </span> <br /> Death comes in all <span style="font-size: large"> font sizes </span> 2. Select all and apply execCommand("fontsize", false, 7) Actual results: <span style="font-size: -webkit-xxx-large;"> A man with 2 </span> <span style="font-family: Courier New, Courier"> <span style="font-size: -webkit-xxx-large;"> font faces </span> </span> <span style="font-size: -webkit-xxx-large;"> <br> Death comes in all font sizes </span> Expected results: <span style="font-size: -webkit-xxx-large;"> A man with 2 <span style="font-family: Courier New, Courier"> font faces </span> <br> Death comes in all font sizes </span>
This bug seems to be related to https://bugs.webkit.org/show_bug.cgi?id=30836.
Created attachment 66135 [details] work in progress
Work in progress requires rebaselines for editing/execCommand/toggle-compound-styles.html editing/inserting/insert-3659587-fix.html editing/style/style-3690704-fix.html as well even though they are not included in the patch. Fixing this bug ended up revealing a lot of bugs around remove/apply inline styles. I'll file a bug and do some cleanup on applyInlineStyleToRange to reduce the size of patch.
Very interesting. This bug has magically been fixed! Will add a test. Probably http://trac.webkit.org/changeset/67170 fixed it.
Created attachment 67246 [details] Patch
Comment on attachment 67246 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=67246&action=prettypatch LGTM.
Committed r67243: <http://trac.webkit.org/changeset/67243>