Diff
Modified: trunk/Source/WebCore/ChangeLog (228556 => 228557)
--- trunk/Source/WebCore/ChangeLog 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebCore/ChangeLog 2018-02-16 14:35:49 UTC (rev 228557)
@@ -1,3 +1,24 @@
+2018-02-16 Wenson Hsieh <[email protected]>
+
+ [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
+ https://bugs.webkit.org/show_bug.cgi?id=182847
+ <rdar://problem/35143111>
+
+ Reviewed by Tim Horton.
+
+ Add new localized strings for "month", "day" and "year" as they appear in the date picker.
+
+ * English.lproj/Localizable.strings:
+ * platform/LocalizedStrings.cpp:
+ (WebCore::textInputModeWriteButtonTitle):
+ (WebCore::textInputModeSpeechButtonTitle):
+ (WebCore::datePickerDayLabelTitle):
+ (WebCore::datePickerMonthLabelTitle):
+ (WebCore::datePickerYearLabelTitle):
+ (WebCore::textInputModeWriteButton): Deleted.
+ (WebCore::textInputModeSpeechButton): Deleted.
+ * platform/LocalizedStrings.h:
+
2018-02-16 Zan Dobersek <[email protected]>
HarfBuzzFace should operate with a FontPlatformData reference
Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (228556 => 228557)
--- trunk/Source/WebCore/English.lproj/Localizable.strings 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings 2018-02-16 14:35:49 UTC (rev 228557)
@@ -211,6 +211,9 @@
/* Undo action name */
"Cut (Undo action name)" = "Cut";
+/* Day label in date picker */
+"Day label in date picker" = "Day";
+
/* Default writing direction context menu item */
"Default" = "Default";
@@ -409,6 +412,9 @@
/* Label text to be used when a plugin is missing */
"Missing Plug-in" = "Missing Plug-in";
+/* Month label in date picker */
+"Month label in date picker" = "Month";
+
/* Media Mute context menu item */
"Mute" = "Mute";
@@ -817,6 +823,9 @@
/* Title of the writing button for zoomed form controls. */
"Write" = "Write";
+/* Year label in date picker */
+"Year label in date picker" = "Year";
+
/* message in authentication panel */
"Your login information will be sent securely." = "Your login information will be sent securely.";
Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (228556 => 228557)
--- trunk/Source/WebCore/platform/LocalizedStrings.cpp 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp 2018-02-16 14:35:49 UTC (rev 228557)
@@ -1056,16 +1056,31 @@
return WEB_UI_STRING("Search", "Title of the Search button for zoomed form controls.");
}
-String textInputModeWriteButton()
+String textInputModeWriteButtonTitle()
{
return WEB_UI_STRING("Write", "Title of the writing button for zoomed form controls.");
}
-String textInputModeSpeechButton()
+String textInputModeSpeechButtonTitle()
{
return WEB_UI_STRING("Speak", "Title of the dictation button for zoomed form controls.");
}
+String datePickerDayLabelTitle()
+{
+ return WEB_UI_STRING("Day label in date picker", "Day label in date picker");
+}
+
+String datePickerMonthLabelTitle()
+{
+ return WEB_UI_STRING("Month label in date picker", "Month label in date picker");
+}
+
+String datePickerYearLabelTitle()
+{
+ return WEB_UI_STRING("Year label in date picker", "Year label in date picker");
+}
+
#endif
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (228556 => 228557)
--- trunk/Source/WebCore/platform/LocalizedStrings.h 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h 2018-02-16 14:35:49 UTC (rev 228557)
@@ -321,8 +321,11 @@
WEBCORE_EXPORT String formControlHideButtonTitle();
WEBCORE_EXPORT String formControlGoButtonTitle();
WEBCORE_EXPORT String formControlSearchButtonTitle();
- WEBCORE_EXPORT String textInputModeWriteButton();
- WEBCORE_EXPORT String textInputModeSpeechButton();
+ WEBCORE_EXPORT String textInputModeWriteButtonTitle();
+ WEBCORE_EXPORT String textInputModeSpeechButtonTitle();
+ WEBCORE_EXPORT String datePickerDayLabelTitle();
+ WEBCORE_EXPORT String datePickerMonthLabelTitle();
+ WEBCORE_EXPORT String datePickerYearLabelTitle();
#endif
#if USE(GLIB) && defined(GETTEXT_PACKAGE)
Modified: trunk/Source/WebKit/ChangeLog (228556 => 228557)
--- trunk/Source/WebKit/ChangeLog 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebKit/ChangeLog 2018-02-16 14:35:49 UTC (rev 228557)
@@ -1,3 +1,35 @@
+2018-02-16 Wenson Hsieh <[email protected]>
+
+ [Extra zoom mode] Add basic support for <input type='date'> using date picker UI
+ https://bugs.webkit.org/show_bug.cgi?id=182847
+ <rdar://problem/35143111>
+
+ Reviewed by Tim Horton.
+
+ Add support for presenting date pickers when focusing a date input.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _stopAssistingNode]):
+ (-[WKContentView dismissAllInputViewControllers]):
+
+ Pull logic to dismiss input view controllers into a single helper.
+
+ (-[WKContentView presentDatePickerViewController:]):
+ (-[WKContentView dismissDatePickerViewController:]):
+ (-[WKContentView presentViewControllerForAssistedNode:]):
+ (-[WKContentView textInputController:didCommitText:]):
+ (-[WKContentView _wheelChangedWithEvent:]):
+
+ Delegate wheel events to the date picker.
+
+ * UIProcess/ios/forms/WKDatePickerViewController.h: Added.
+ * UIProcess/ios/forms/WKDatePickerViewController.mm: Added.
+
+ Add harness files for the WKDatePickerViewController implementation in WebKitAdditions.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2018-02-15 Youenn Fablet <[email protected]>
Resources loaded from service workers are not downloadable
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (228556 => 228557)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-02-16 14:35:49 UTC (rev 228557)
@@ -84,6 +84,7 @@
@class _UIWebHighlightLongPressGestureRecognizer;
#if ENABLE(EXTRA_ZOOM_MODE)
+@class WKDatePickerViewController;
@class WKFocusedFormControlViewController;
@class WKNumberPadViewController;
@class WKSelectMenuViewController;
@@ -246,6 +247,7 @@
#endif
#if ENABLE(EXTRA_ZOOM_MODE)
+ RetainPtr<WKDatePickerViewController> _datePickerViewController;
RetainPtr<WKTextInputViewController> _textInputViewController;
RetainPtr<WKFocusedFormControlViewController> _focusedFormControlViewController;
RetainPtr<WKNumberPadViewController> _numberPadViewController;
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (228556 => 228557)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-02-16 14:35:49 UTC (rev 228557)
@@ -40,6 +40,7 @@
#import "TextInputSPI.h"
#import "UIKitSPI.h"
#import "WKActionSheetAssistant.h"
+#import "WKDatePickerViewController.h"
#import "WKError.h"
#import "WKFocusedFormControlViewController.h"
#import "WKFormInputControl.h"
@@ -4088,10 +4089,7 @@
[_webSelectionAssistant resignedFirstResponder];
#if ENABLE(EXTRA_ZOOM_MODE)
- [self dismissTextInputViewController:YES];
- [self dismissNumberPadViewController:YES];
- [self dismissSelectMenuViewController:YES];
- [self dismissTimePickerViewController:YES];
+ [self dismissAllInputViewControllers];
if (!_isChangingFocus)
[self dismissFocusedFormControlViewController:[_focusedFormControlViewController isVisible]];
#endif
@@ -4105,6 +4103,34 @@
#if ENABLE(EXTRA_ZOOM_MODE)
+- (void)dismissAllInputViewControllers
+{
+ [self dismissTextInputViewController:YES];
+ [self dismissNumberPadViewController:YES];
+ [self dismissSelectMenuViewController:YES];
+ [self dismissTimePickerViewController:YES];
+ [self dismissDatePickerViewController:YES];
+}
+
+- (void)presentDatePickerViewController:(BOOL)animated
+{
+ if (_datePickerViewController)
+ return;
+
+ _datePickerViewController = adoptNS([[WKDatePickerViewController alloc] initWithText:_assistedNodeInformation.value textSuggestions:@[ ]]);
+ [_datePickerViewController setDelegate:self];
+ [_focusedFormControlViewController presentViewController:_datePickerViewController.get() animated:animated completion:nil];
+}
+
+- (void)dismissDatePickerViewController:(BOOL)animated
+{
+ if (!_datePickerViewController)
+ return;
+
+ auto datePickerViewController = WTFMove(_datePickerViewController);
+ [datePickerViewController dismissViewControllerAnimated:animated completion:nil];
+}
+
- (void)presentTimePickerViewController:(BOOL)animated
{
if (_timePickerViewController)
@@ -4195,6 +4221,9 @@
case InputType::Time:
[self presentTimePickerViewController:YES];
break;
+ case InputType::Date:
+ [self presentDatePickerViewController:YES];
+ break;
case InputType::None:
break;
default:
@@ -4235,9 +4264,7 @@
}
[_focusedFormControlViewController show:NO];
- [self dismissTextInputViewController:YES];
- [self dismissNumberPadViewController:YES];
- [self dismissTimePickerViewController:YES];
+ [self dismissAllInputViewControllers];
}
- (void)textInputControllerDidRequestDismissal:(WKTextFormControlViewController *)controller
@@ -4398,6 +4425,9 @@
if ([_timePickerViewController handleWheelEvent:event])
return;
+ if ([_datePickerViewController handleWheelEvent:event])
+ return;
+
if ([_focusedFormControlViewController handleWheelEvent:event])
return;
#endif
Added: trunk/Source/WebKit/UIProcess/ios/forms/WKDatePickerViewController.h (0 => 228557)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKDatePickerViewController.h (rev 0)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKDatePickerViewController.h 2018-02-16 14:35:49 UTC (rev 228557)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WKDatePickerViewControllerAdditions.h>
+#endif
Added: trunk/Source/WebKit/UIProcess/ios/forms/WKDatePickerViewController.mm (0 => 228557)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKDatePickerViewController.mm (rev 0)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKDatePickerViewController.mm 2018-02-16 14:35:49 UTC (rev 228557)
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKDatePickerViewController.h"
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WKDatePickerViewControllerAdditions.mm>
+#endif
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (228556 => 228557)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2018-02-16 14:33:29 UTC (rev 228556)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2018-02-16 14:35:49 UTC (rev 228557)
@@ -736,6 +736,8 @@
2E5C770E1FA7D429005932C3 /* APIAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E5C770C1FA7D429005932C3 /* APIAttachment.h */; };
2E5C770F1FA7D429005932C3 /* APIAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E5C770D1FA7D429005932C3 /* APIAttachment.cpp */; };
2E7A944A1BBD97C300945547 /* _WKFocusedElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 2E94FC1620351A6D00974BA0 /* WKDatePickerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94FC1420351A6D00974BA0 /* WKDatePickerViewController.h */; };
+ 2E94FC1720351A6D00974BA0 /* WKDatePickerViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E94FC1520351A6D00974BA0 /* WKDatePickerViewController.mm */; };
2EA7B3D12026CEF8009CE5AC /* WKNumberPadViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA7B3CF2026CEF8009CE5AC /* WKNumberPadViewController.h */; };
2EA7B3D22026CEF8009CE5AC /* WKNumberPadViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EA7B3D02026CEF8009CE5AC /* WKNumberPadViewController.mm */; };
2EA7B3D52026CF23009CE5AC /* WKNumberPadView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA7B3D32026CF23009CE5AC /* WKNumberPadView.h */; };
@@ -3104,6 +3106,8 @@
2E5C770C1FA7D429005932C3 /* APIAttachment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIAttachment.h; sourceTree = "<group>"; };
2E5C770D1FA7D429005932C3 /* APIAttachment.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = APIAttachment.cpp; sourceTree = "<group>"; };
2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKFocusedElementInfo.h; sourceTree = "<group>"; };
+ 2E94FC1420351A6D00974BA0 /* WKDatePickerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKDatePickerViewController.h; path = ios/forms/WKDatePickerViewController.h; sourceTree = "<group>"; };
+ 2E94FC1520351A6D00974BA0 /* WKDatePickerViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKDatePickerViewController.mm; path = ios/forms/WKDatePickerViewController.mm; sourceTree = "<group>"; };
2EA7B3CF2026CEF8009CE5AC /* WKNumberPadViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKNumberPadViewController.h; path = ios/forms/WKNumberPadViewController.h; sourceTree = "<group>"; };
2EA7B3D02026CEF8009CE5AC /* WKNumberPadViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKNumberPadViewController.mm; path = ios/forms/WKNumberPadViewController.mm; sourceTree = "<group>"; };
2EA7B3D32026CF23009CE5AC /* WKNumberPadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKNumberPadView.h; path = ios/forms/WKNumberPadView.h; sourceTree = "<group>"; };
@@ -8383,6 +8387,8 @@
children = (
C5FA1ED118E1062200B3F402 /* WKAirPlayRoutePicker.h */,
C5FA1ED218E1062200B3F402 /* WKAirPlayRoutePicker.mm */,
+ 2E94FC1420351A6D00974BA0 /* WKDatePickerViewController.h */,
+ 2E94FC1520351A6D00974BA0 /* WKDatePickerViewController.mm */,
A58B6F0618FCA733008CBA53 /* WKFileUploadPanel.h */,
A58B6F0718FCA733008CBA53 /* WKFileUploadPanel.mm */,
2E16B6CD2017B7AC008996D6 /* WKFocusedFormControlView.h */,
@@ -9410,6 +9416,7 @@
BC4075F8124FF0270068F20A /* WKData.h in Headers */,
37A709A71E3EA0FD00CA5969 /* WKDataDetectorTypes.h in Headers */,
37A709A91E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h in Headers */,
+ 2E94FC1620351A6D00974BA0 /* WKDatePickerViewController.h in Headers */,
377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */,
8372DB2F1A677D4A00C697C5 /* WKDiagnosticLoggingResultType.h in Headers */,
BC4075FA124FF0270068F20A /* WKDictionary.h in Headers */,
@@ -11107,6 +11114,7 @@
A1FB68251F6E518200C43F9F /* WKCrashReporter.mm in Sources */,
512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
BC4075F7124FF0270068F20A /* WKData.cpp in Sources */,
+ 2E94FC1720351A6D00974BA0 /* WKDatePickerViewController.mm in Sources */,
1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */,
BC4075F9124FF0270068F20A /* WKDictionary.cpp in Sources */,
BC017D0816260FF4007054F5 /* WKDOMDocument.mm in Sources */,