mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1725806
- Part 6. Support autocorrect on UIKit backend. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D221574
This commit is contained in:
parent
68729cfdbb
commit
0f838e0695
@ -3,6 +3,9 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_widget_UIKitUtils_h__
|
||||
#define mozilla_widget_UIKitUtils_h__
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#include "IMEData.h"
|
||||
@ -18,6 +21,10 @@ class UIKitUtils final {
|
||||
static UIReturnKeyType GetUIReturnKeyType(const InputContext& aContext);
|
||||
static UITextAutocapitalizationType GetUITextAutocapitalizationType(
|
||||
const InputContext& aContext);
|
||||
static UITextAutocorrectionType GetUITextAutocorrectionType(
|
||||
const InputContext& aContext);
|
||||
};
|
||||
|
||||
} // namespace mozilla::widget
|
||||
|
||||
#endif
|
||||
|
@ -86,4 +86,11 @@ UITextAutocapitalizationType UIKitUtils::GetUITextAutocapitalizationType(
|
||||
return UITextAutocapitalizationTypeNone;
|
||||
}
|
||||
|
||||
// static
|
||||
UITextAutocorrectionType UIKitUtils::GetUITextAutocorrectionType(
|
||||
const InputContext& aContext) {
|
||||
return aContext.mAutocorrect ? UITextAutocorrectionTypeYes
|
||||
: UITextAutocorrectionTypeNo;
|
||||
}
|
||||
|
||||
} // namespace mozilla::widget
|
||||
|
@ -552,6 +552,15 @@ class nsAutoRetainUIKitObject {
|
||||
mGeckoChild->GetInputContext());
|
||||
}
|
||||
|
||||
- (UITextAutocorrectionType)autocorrectionType {
|
||||
if (!mGeckoChild || mGeckoChild->Destroyed()) {
|
||||
return UITextAutocorrectionTypeDefault;
|
||||
}
|
||||
|
||||
return UIKitUtils::GetUITextAutocorrectionType(
|
||||
mGeckoChild->GetInputContext());
|
||||
}
|
||||
|
||||
- (BOOL)isSecureTextEntry {
|
||||
if (!mGeckoChild || mGeckoChild->Destroyed()) {
|
||||
return NO;
|
||||
|
Loading…
Reference in New Issue
Block a user