Bug 23463 - WebKit leaves 'style=""' attribute turds after some editing commands
Summary: WebKit leaves 'style=""' attribute turds after some editing commands
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-21 14:56 PST by Eric Seidel (no email)
Modified: 2009-01-21 15:50 PST (History)
2 users (show)

See Also:


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+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 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
Comment 1 Eric Seidel (no email) 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(-)
Comment 2 Eric Seidel (no email) 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?
Comment 3 Justin Garcia 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.
Comment 4 Justin Garcia 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.
Comment 5 Eric Seidel (no email) 2009-01-21 15:50:00 PST
Thanks!
http://trac.webkit.org/changeset/40101