Bug 28968

Summary: execCommand("fontsize") on certain selected html generates too many SPAN tags.
Product: WebKit Reporter: Dan POPA <dpopa>
Component: HTML EditingAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, enrica, jparent, ojan, rniwa, tony, webkit
Priority: P2 Keywords: HasReduction
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 45008, 45026    
Bug Blocks: 27818    
Attachments:
Description Flags
work in progress
none
Patch eric: review+

Dan POPA
Reported 2009-09-04 04:16:32 PDT
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>
Attachments
work in progress (39.20 KB, patch)
2010-08-31 16:26 PDT, Ryosuke Niwa
no flags
Patch (2.60 KB, patch)
2010-09-10 15:13 PDT, Ryosuke Niwa
eric: review+
Ryosuke Niwa
Comment 1 2010-07-26 15:33:40 PDT
This bug seems to be related to https://bugs.webkit.org/show_bug.cgi?id=30836.
Ryosuke Niwa
Comment 2 2010-08-31 16:26:31 PDT
Created attachment 66135 [details] work in progress
Ryosuke Niwa
Comment 3 2010-08-31 16:28:48 PDT
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.
Ryosuke Niwa
Comment 4 2010-09-10 14:58:43 PDT
Very interesting. This bug has magically been fixed! Will add a test. Probably http://trac.webkit.org/changeset/67170 fixed it.
Ryosuke Niwa
Comment 5 2010-09-10 15:13:21 PDT
Eric Seidel (no email)
Comment 6 2010-09-10 15:16:14 PDT
Ryosuke Niwa
Comment 7 2010-09-10 15:26:56 PDT
Note You need to log in before you can comment on or make changes to this bug.