Bug 109463 - Add ENABLE_DELETION_UI to control the use of the deletion UI.
Summary: Add ENABLE_DELETION_UI to control the use of the deletion UI.
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: 109517
  Show dependency treegraph
 
Reported: 2013-02-11 11:02 PST by Enrica Casucci
Modified: 2013-02-12 02:52 PST (History)
5 users (show)

See Also:


Attachments
Patch (4.18 KB, patch)
2013-02-11 11:31 PST, Enrica Casucci
no flags Details | Formatted Diff | Diff
Patch2 (20.55 KB, patch)
2013-02-11 15:15 PST, Enrica Casucci
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2013-02-11 11:02:44 PST
Platforms like iOS don't use DeleteButton ui at all. It doesn't make sense to use the current implementation that does quite a bit of work before calling into the client to find out there is nothing to do.
Comment 1 Enrica Casucci 2013-02-11 11:31:50 PST
Created attachment 187629 [details]
Patch
Comment 2 WebKit Review Bot 2013-02-11 11:38:19 PST
Attachment 187629 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/editing/DeleteButtonController.cpp', u'Source/WebCore/editing/DeleteButtonController.h']" exit_code: 1
Source/WebCore/editing/DeleteButtonController.h:64:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Ryosuke Niwa 2013-02-11 13:32:30 PST
Comment on attachment 187629 [details]
Patch

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

> Source/WebCore/editing/DeleteButtonController.h:42
> +#if !PLATFORM(IOS)

Why don't we add ENABLE_DELETE_BUTTON_CONTROLLER instead?
Comment 4 Enrica Casucci 2013-02-11 14:09:38 PST
After discussing this topic with a number of people, I decided to go for a different approach. I'm adding ENABLE_DELETION_UI to control the use of this feature.
I will initially enabled it by default for all the ports to avoid breaking other ports, since I don't know for sure if and how they use it.
Comment 5 Enrica Casucci 2013-02-11 15:15:18 PST
Created attachment 187691 [details]
Patch2
Comment 6 Ryosuke Niwa 2013-02-11 15:19:15 PST
Comment on attachment 187691 [details]
Patch2

rs=me.
Comment 7 Benjamin Poulain 2013-02-11 15:25:29 PST
View in context: https://bugs.webkit.org/attachment.cgi?id=187691&action=review

> Source/WebCore/dom/ContainerNode.cpp:31
> +#if ENABLE(DELETION_UI)
>  #include "DeleteButtonController.h"
> +#endif

Since it is an ENABLE(), I would have the #ifdef in the header file instead of around the #include.

> Source/WebCore/editing/Editor.cpp:861
> +#if ENABLE(DELETION_UI)
> +    m_deleteButtonController = adoptPtr(new DeleteButtonController(frame));
> +#endif

Node sure why you moved this out of the initialization.
Comment 8 Enrica Casucci 2013-02-11 15:51:04 PST
(In reply to comment #7)
> View in context: https://bugs.webkit.org/attachment.cgi?id=187691&action=review
> 
> > Source/WebCore/dom/ContainerNode.cpp:31
> > +#if ENABLE(DELETION_UI)
> >  #include "DeleteButtonController.h"
> > +#endif
> 
> Since it is an ENABLE(), I would have the #ifdef in the header file instead of around the #include.
> 
> > Source/WebCore/editing/Editor.cpp:861
> > +#if ENABLE(DELETION_UI)
> > +    m_deleteButtonController = adoptPtr(new DeleteButtonController(frame));
> > +#endif
> 
> Node sure why you moved this out of the initialization.

(In reply to comment #7)
> View in context: https://bugs.webkit.org/attachment.cgi?id=187691&action=review
> 
> > Source/WebCore/dom/ContainerNode.cpp:31
> > +#if ENABLE(DELETION_UI)
> >  #include "DeleteButtonController.h"
> > +#endif
> 
> Since it is an ENABLE(), I would have the #ifdef in the header file instead of around the #include.
> 
> > Source/WebCore/editing/Editor.cpp:861
> > +#if ENABLE(DELETION_UI)
> > +    m_deleteButtonController = adoptPtr(new DeleteButtonController(frame));
> > +#endif
> 
> Node sure why you moved this out of the initialization.

I don't like the #ifdef in the initialization list.
Comment 9 Enrica Casucci 2013-02-11 15:51:14 PST
Committed revision 142533.