Bug 109463

Summary: Add ENABLE_DELETION_UI to control the use of the deletion UI.
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: HTML EditingAssignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, ddkilzer, mifenton, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 109517    
Attachments:
Description Flags
Patch
none
Patch2 rniwa: review+

Enrica Casucci
Reported 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.
Attachments
Patch (4.18 KB, patch)
2013-02-11 11:31 PST, Enrica Casucci
no flags
Patch2 (20.55 KB, patch)
2013-02-11 15:15 PST, Enrica Casucci
rniwa: review+
Enrica Casucci
Comment 1 2013-02-11 11:31:50 PST
WebKit Review Bot
Comment 2 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.
Ryosuke Niwa
Comment 3 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?
Enrica Casucci
Comment 4 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.
Enrica Casucci
Comment 5 2013-02-11 15:15:18 PST
Ryosuke Niwa
Comment 6 2013-02-11 15:19:15 PST
Comment on attachment 187691 [details] Patch2 rs=me.
Benjamin Poulain
Comment 7 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.
Enrica Casucci
Comment 8 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.
Enrica Casucci
Comment 9 2013-02-11 15:51:14 PST
Committed revision 142533.
Note You need to log in before you can comment on or make changes to this bug.