Bug 136876 - Should have an editing behavior specific for IOS
Summary: Should have an editing behavior specific for IOS
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-16 17:15 PDT by Enrica Casucci
Modified: 2014-09-16 18:30 PDT (History)
3 users (show)

See Also:


Attachments
Patch (9.45 KB, patch)
2014-09-16 17:27 PDT, Enrica Casucci
sam: 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 2014-09-16 17:15:15 PDT
In order to avoid using PLATFORM guards to have different editing behaviors on iOS we should have an editing behavior that is specific to iOS.
Comment 1 Enrica Casucci 2014-09-16 17:27:44 PDT
Created attachment 238228 [details]
Patch
Comment 2 WebKit Commit Bot 2014-09-16 17:29:20 PDT
Attachment 238228 [details] did not pass style-queue:


ERROR: Source/WebCore/editing/DeleteSelectionCommand.cpp:868:  Consider using toText helper function in WebCore/dom/Text.h instead of static_cast<Text*>  [readability/check] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Sam Weinig 2014-09-16 17:42:32 PDT
Comment on attachment 238228 [details]
Patch

Looks good! Now that we have this as a behavior, can we add a test for it.
Comment 4 Ryosuke Niwa 2014-09-16 17:47:36 PDT
Comment on attachment 238228 [details]
Patch

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

> Source/WebCore/editing/FrameSelection.cpp:619
> -    if (m_frame && m_frame->settings().editingBehaviorType() == EditingMacBehavior)
> +    if (m_frame && (m_frame->settings().editingBehaviorType() == EditingMacBehavior || m_frame->settings().editingBehaviorType() == EditingIOSBehavior))

We should extract this into a helper function in EditingBehavior.h, not that you should do it in this patch.

> Source/WebCore/testing/InternalSettings.cpp:353
> +    else if (equalIgnoringCase(editingBehavior, "ios"))
> +        settings()->setEditingBehaviorType(EditingIOSBehavior);

Are you gonna update existing tests in a follow up patch?
Comment 5 Enrica Casucci 2014-09-16 17:50:37 PDT
> We should extract this into a helper function in EditingBehavior.h, not that you should do it in this patch.
> 
Agreed. This is the only place where we check the EditingBehaviorType directly.

> > Source/WebCore/testing/InternalSettings.cpp:353
> > +    else if (equalIgnoringCase(editingBehavior, "ios"))
> > +        settings()->setEditingBehaviorType(EditingIOSBehavior);
> 
> Are you gonna update existing tests in a follow up patch?
All the tests currently set the editing behavior as Mac and they should all continue to work.
We don't have any test that currently test the iOS behavior, but this change will allow us to have some.
Comment 6 Sam Weinig 2014-09-16 18:30:21 PDT
(In reply to comment #5)
> > We should extract this into a helper function in EditingBehavior.h, not that you should do it in this patch.
> > 
> Agreed. This is the only place where we check the EditingBehaviorType directly.
> 
> > > Source/WebCore/testing/InternalSettings.cpp:353
> > > +    else if (equalIgnoringCase(editingBehavior, "ios"))
> > > +        settings()->setEditingBehaviorType(EditingIOSBehavior);
> > 
> > Are you gonna update existing tests in a follow up patch?
> All the tests currently set the editing behavior as Mac and they should all continue to work.
> We don't have any test that currently test the iOS behavior, but this change will allow us to have some.

Hm, I probably should have had you break this up into two patches then, one to add the ability to test the iOS behavior, and one that actually changed the code and added a test.  Please do add a test though.