Bug 83240 - Provide a separate editing command to cleanup of redundant markup
Summary: Provide a separate editing command to cleanup of redundant markup
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 18:16 PDT by Enrica Casucci
Modified: 2012-04-05 13:32 PDT (History)
6 users (show)

See Also:


Attachments
Patch (20.06 KB, patch)
2012-04-04 18:24 PDT, Enrica Casucci
pnormand: commit-queue-
Details | Formatted Diff | Diff
Patch2 (20.97 KB, patch)
2012-04-04 19:12 PDT, Enrica Casucci
rniwa: review+
pnormand: commit-queue-
Details | Formatted Diff | Diff
Patch to check builds (21.50 KB, patch)
2012-04-05 11:17 PDT, Enrica Casucci
no flags Details | Formatted Diff | Diff
One more (21.50 KB, patch)
2012-04-05 11:24 PDT, Enrica Casucci
no flags Details | Formatted Diff | Diff
Resolved conflict (21.61 KB, patch)
2012-04-05 13:12 PDT, Enrica Casucci
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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