Bug 83240

Summary: Provide a separate editing command to cleanup of redundant markup
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: HTML EditingAssignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, gustavo, pnormand, rakuco, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
pnormand: commit-queue-
Patch2
rniwa: review+, pnormand: commit-queue-
Patch to check builds
none
One more
none
Resolved conflict none

Description Enrica Casucci 2012-04-04 18:16:48 PDT
The markup cleanup is currently implemented as part of the ReplaceSelection command.
We want to move it into a separate command so that it can be performed independently from ReplaceSelection.
Comment 1 Enrica Casucci 2012-04-04 18:24:00 PDT
Created attachment 135738 [details]
Patch
Comment 2 Philippe Normand 2012-04-04 18:28:24 PDT
Comment on attachment 135738 [details]
Patch

Attachment 135738 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12338039
Comment 3 Build Bot 2012-04-04 18:47:49 PDT
Comment on attachment 135738 [details]
Patch

Attachment 135738 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/12336064
Comment 4 Build Bot 2012-04-04 18:50:26 PDT
Comment on attachment 135738 [details]
Patch

Attachment 135738 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/12337071
Comment 5 WebKit Review Bot 2012-04-04 18:58:51 PDT
Comment on attachment 135738 [details]
Patch

Attachment 135738 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12337078
Comment 6 Enrica Casucci 2012-04-04 19:12:59 PDT
Created attachment 135745 [details]
Patch2

Attempting to fix build issues.
Comment 7 Philippe Normand 2012-04-04 19:16:53 PDT
Comment on attachment 135745 [details]
Patch2

Attachment 135745 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/12335085
Comment 8 Ryosuke Niwa 2012-04-05 10:34:44 PDT
Comment on attachment 135745 [details]
Patch2

View in context: https://bugs.webkit.org/attachment.cgi?id=135745&action=review

Please fix the gtk build before you land. Also, you probably need to modify EditorAllInOne.cpp for Windows.

> Source/WebCore/editing/ReplaceSelectionCommand.cpp:1023
> -        removeRedundantMarkup(insertedNodes);
> +        applyCommandToComposite(SimplifyMarkupCommand::create(document(), insertedNodes.firstNodeInserted(), insertedNodes.pastLastLeaf()));

You should add simplifyMarkup() to CompositeEditCommand.

> Source/WebCore/editing/SimplifyMarkupCommand.cpp:2
> + * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.

Maybe you should add 2011 here?
Comment 9 Enrica Casucci 2012-04-05 11:10:05 PDT
(In reply to comment #8)
> (From update of attachment 135745 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=135745&action=review
> 
> Please fix the gtk build before you land.
I don't believe I broke it. The message is obscure.
I'll post another patch and watch the bots to make sure.

 Also, you probably need to modify EditorAllInOne.cpp for Windows.
Ok
> 
> You should add simplifyMarkup() to CompositeEditCommand.
I can do that in a later patch.
> 
> > Source/WebCore/editing/SimplifyMarkupCommand.cpp:2
> > + * Copyright (C) 2005, 2006 Apple Computer, Inc.  All rights reserved.
> 
> Maybe you should add 2011 here?
Actually 2012! Good catch.
Comment 10 Enrica Casucci 2012-04-05 11:17:56 PDT
Created attachment 135863 [details]
Patch to check builds
Comment 11 Enrica Casucci 2012-04-05 11:24:59 PDT
Created attachment 135865 [details]
One more
Comment 12 Enrica Casucci 2012-04-05 13:12:11 PDT
Created attachment 135886 [details]
Resolved conflict
Comment 13 Enrica Casucci 2012-04-05 13:32:23 PDT
http://trac.webkit.org/changeset/113369