Bug 23463

Summary: WebKit leaves 'style=""' attribute turds after some editing commands
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jparent, justin.garcia
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Remove the style='' turds left by some editing commmands justin.garcia: review+

Eric Seidel (no email)
Reported 2009-01-21 14:56:59 PST
WebKit leaves 'style=""' attribute turds after some editing commands An example: http://trac.webkit.org/browser/trunk/LayoutTests/editing/execCommand/toggle-styles-expected.txt?rev=40097
Attachments
Remove the style='' turds left by some editing commmands (5.62 KB, patch)
2009-01-21 15:04 PST, Eric Seidel (no email)
justin.garcia: review+
Eric Seidel (no email)
Comment 1 2009-01-21 15:04:33 PST
Created attachment 26908 [details] Remove the style='' turds left by some editing commmands LayoutTests/ChangeLog | 9 +++++++++ .../editing/execCommand/toggle-styles-expected.txt | 18 +++++++++--------- WebCore/ChangeLog | 14 ++++++++++++++ WebCore/editing/ApplyStyleCommand.cpp | 8 ++++++-- WebCore/editing/CompositeEditCommand.cpp | 2 +- 5 files changed, 39 insertions(+), 12 deletions(-)
Eric Seidel (no email)
Comment 2 2009-01-21 15:06:14 PST
Justin, I would like to know from you if I should be using "removeNodeAttribute" or if I should just be removing the attribute from the element directly (without going through all the compositEditCommand stuff). What's the benefit of removeNodeAttribute?
Justin Garcia
Comment 3 2009-01-21 15:11:59 PST
> "removeNodeAttribute" or if I should just be removing the attribute from the > element directly (without going through all the compositEditCommand stuff). > What's the benefit of removeNodeAttribute? removeNodeAttribute is the Undo-able operation. I think you need to use that one, since later on Undo we might try to add property/values to the style attribute, and if it's not there we could run into trouble.
Justin Garcia
Comment 4 2009-01-21 15:14:39 PST
Comment on attachment 26908 [details] Remove the style='' turds left by some editing commmands r=me assuming you leave removeNodeAttribute in there as-is.
Eric Seidel (no email)
Comment 5 2009-01-21 15:50:00 PST
Note You need to log in before you can comment on or make changes to this bug.