Title: [263977] trunk/Source
Revision
263977
Author
[email protected]
Date
2020-07-06 12:01:37 -0700 (Mon, 06 Jul 2020)

Log Message

Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls
https://bugs.webkit.org/show_bug.cgi?id=213949

Reviewed by Darin Adler.

Source/WebCore:

Enable date/time related input element types on all Cocoa platforms, but disable them at runtime.
To make runtime disabling work completely, the user agent style for these element types was
extracted from html.css and is now only added when needed via UserAgentStyle::ensureDefaultStyleSheetsForElement.

This is the first step to allowing us to run a subset of the date/time related input element tests
on more platforms. If this is successful, we should consider do this for all platforms, not just Cocoa.

* css/html.css:
Move to RenderTheme accessors for conditional inclusion based on Settings.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isDateTimeField const): Deleted.
* html/HTMLInputElement.h:
Removed dead isDateTimeField() code. This should have been removed when datetime was removed.

* html/InputType.cpp:
(WebCore::createInputTypeFactoryMap):
(WebCore::InputType::create):
Switch from using RuntimeEnabledFeatures to Settings for checking for enabling (Settings allows
us to write less boilerplate code and is more versatile for testing) and switch to checking the
condition on each InputType construction, rather than just on map's creation (again, this allows
us to have more flexibility in testing).

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::inputTypeMonthEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setInputTypeMonthEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::inputTypeTimeEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setInputTypeTimeEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::inputTypeWeekEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setInputTypeWeekEnabled): Deleted.
Remove hand written code infavor of code genreated from Settings.yaml.

* page/Settings.yaml:
Moved from RuntimeEnabledFeatures.

* platform/LocalizedStrings.h:
Remove weekFormatInLDML() declaration, which had not implementation.

* platform/text/PlatformLocale.cpp:
(WebCore::Locale::formatDateTime):
* platform/text/PlatformLocale.h:
Simplify code by marking formatDateTime() virtual on all platforms and un-#ifdefing
the base implementation. Platforms that wish to override it still can.

* platform/text/cocoa/LocaleCocoa.h:
* platform/text/cocoa/LocaleCocoa.mm:
* platform/text/ios/LocalizedDateCache.h:
* platform/text/ios/LocalizedDateCache.mm:
Remove iOS specific #ifdefs around code that should work on all Cocoa platforms.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
(WebCore::RenderTheme::dateInputStyleSheet const):
(WebCore::RenderTheme::dateTimeLocalInputStyleSheet const):
(WebCore::RenderTheme::monthInputStyleSheet const):
(WebCore::RenderTheme::timeInputStyleSheet const):
(WebCore::RenderTheme::weekInputStyleSheet const):
* rendering/RenderTheme.h:
Add default user agent stylesheet strings for input types. All moved from html.css.

* style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
* style/UserAgentStyle.h:
Conditionally add the input type specific user agent stylesheets only if the actual
input type is being passed in. Since creation of the input types is guarded by a Setting,
this can only happen if the type has been enabled.

Source/WebKit:

* Shared/FocusedElementInformation.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView textInputTraits]):
(mayContainSelectableText):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getFocusedElementInformation):
Remove DateTime from the InputType enum. This should have been removed when datetime was removed.

* Shared/WebPreferences.yaml:
Add preferences for all the date/time related input types, and have them automatically
link up with the newly added WebCore Settings of the same names (this is the default
behavior if no explicit webcoreBinding: is provided).

* Shared/WebPreferencesDefaultValues.h:
Disable date/time input elements by default for non iOS/watchOS cocoa platforms. For non-Cocoa platforms
(and iOS/watchOS), they are enabled by default, but only actually get enabled if the appropriate ENABLE_*
macro is also set.

Source/WTF:

* wtf/PlatformEnableCocoa.h:
Enable building date/time input types on all Cocoa ports.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (263976 => 263977)


--- trunk/Source/WTF/ChangeLog	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WTF/ChangeLog	2020-07-06 19:01:37 UTC (rev 263977)
@@ -1,3 +1,13 @@
+2020-07-06  Sam Weinig  <[email protected]>
+
+        Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls
+        https://bugs.webkit.org/show_bug.cgi?id=213949
+
+        Reviewed by Darin Adler.
+
+        * wtf/PlatformEnableCocoa.h:
+        Enable building date/time input types on all Cocoa ports. 
+
 2020-07-06  Geoffrey Garen  <[email protected]>
 
         RunLoop::dispatch should only call wakeUp when needed

Modified: trunk/Source/WTF/wtf/PlatformEnableCocoa.h (263976 => 263977)


--- trunk/Source/WTF/wtf/PlatformEnableCocoa.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WTF/wtf/PlatformEnableCocoa.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -236,23 +236,23 @@
 #define ENABLE_INDEXED_DATABASE_IN_WORKERS 1
 #endif
 
-#if !defined(ENABLE_INPUT_TYPE_DATE) && !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
+#if !defined(ENABLE_INPUT_TYPE_DATE)
 #define ENABLE_INPUT_TYPE_DATE 1
 #endif
 
-#if !defined(ENABLE_INPUT_TYPE_DATETIMELOCAL) && !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
+#if !defined(ENABLE_INPUT_TYPE_DATETIMELOCAL)
 #define ENABLE_INPUT_TYPE_DATETIMELOCAL 1
 #endif
 
-#if !defined(ENABLE_INPUT_TYPE_MONTH) && !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
+#if !defined(ENABLE_INPUT_TYPE_MONTH)
 #define ENABLE_INPUT_TYPE_MONTH 1
 #endif
 
-#if !defined(ENABLE_INPUT_TYPE_TIME) && !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
+#if !defined(ENABLE_INPUT_TYPE_TIME)
 #define ENABLE_INPUT_TYPE_TIME 1
 #endif
 
-#if !defined(ENABLE_INPUT_TYPE_WEEK) && !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
+#if !defined(ENABLE_INPUT_TYPE_WEEK)
 #define ENABLE_INPUT_TYPE_WEEK 1
 #endif
 

Modified: trunk/Source/WebCore/ChangeLog (263976 => 263977)


--- trunk/Source/WebCore/ChangeLog	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/ChangeLog	2020-07-06 19:01:37 UTC (rev 263977)
@@ -1,3 +1,83 @@
+2020-07-06  Sam Weinig  <[email protected]>
+
+        Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls
+        https://bugs.webkit.org/show_bug.cgi?id=213949
+
+        Reviewed by Darin Adler.
+
+        Enable date/time related input element types on all Cocoa platforms, but disable them at runtime.
+        To make runtime disabling work completely, the user agent style for these element types was
+        extracted from html.css and is now only added when needed via UserAgentStyle::ensureDefaultStyleSheetsForElement.
+
+        This is the first step to allowing us to run a subset of the date/time related input element tests
+        on more platforms. If this is successful, we should consider do this for all platforms, not just Cocoa. 
+
+        * css/html.css:
+        Move to RenderTheme accessors for conditional inclusion based on Settings.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::isDateTimeField const): Deleted.
+        * html/HTMLInputElement.h:
+        Removed dead isDateTimeField() code. This should have been removed when datetime was removed.
+
+        * html/InputType.cpp:
+        (WebCore::createInputTypeFactoryMap):
+        (WebCore::InputType::create):
+        Switch from using RuntimeEnabledFeatures to Settings for checking for enabling (Settings allows
+        us to write less boilerplate code and is more versatile for testing) and switch to checking the
+        condition on each InputType construction, rather than just on map's creation (again, this allows
+        us to have more flexibility in testing).
+
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::inputTypeDateEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setInputTypeDateEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setInputTypeDateTimeLocalEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::inputTypeMonthEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setInputTypeMonthEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::inputTypeTimeEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setInputTypeTimeEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::inputTypeWeekEnabled const): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setInputTypeWeekEnabled): Deleted.
+        Remove hand written code infavor of code genreated from Settings.yaml.
+
+        * page/Settings.yaml:
+        Moved from RuntimeEnabledFeatures.
+
+        * platform/LocalizedStrings.h:
+        Remove weekFormatInLDML() declaration, which had not implementation.
+
+        * platform/text/PlatformLocale.cpp:
+        (WebCore::Locale::formatDateTime):
+        * platform/text/PlatformLocale.h:
+        Simplify code by marking formatDateTime() virtual on all platforms and un-#ifdefing
+        the base implementation. Platforms that wish to override it still can.
+
+        * platform/text/cocoa/LocaleCocoa.h:
+        * platform/text/cocoa/LocaleCocoa.mm:
+        * platform/text/ios/LocalizedDateCache.h:
+        * platform/text/ios/LocalizedDateCache.mm:
+        Remove iOS specific #ifdefs around code that should work on all Cocoa platforms.
+
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::colorInputStyleSheet const):
+        (WebCore::RenderTheme::dateInputStyleSheet const):
+        (WebCore::RenderTheme::dateTimeLocalInputStyleSheet const):
+        (WebCore::RenderTheme::monthInputStyleSheet const):
+        (WebCore::RenderTheme::timeInputStyleSheet const):
+        (WebCore::RenderTheme::weekInputStyleSheet const):
+        * rendering/RenderTheme.h:
+        Add default user agent stylesheet strings for input types. All moved from html.css. 
+        
+        * style/UserAgentStyle.cpp:
+        (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
+        * style/UserAgentStyle.h:
+        Conditionally add the input type specific user agent stylesheets only if the actual
+        input type is being passed in. Since creation of the input types is guarded by a Setting,
+        this can only happen if the type has been enabled. 
+
 2020-07-06  Rob Buis  <[email protected]>
 
         Allow setting empty host/hostname on URLs if they use file scheme

Modified: trunk/Source/WebCore/css/html.css (263976 => 263977)


--- trunk/Source/WebCore/css/html.css	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/css/html.css	2020-07-06 19:01:37 UTC (rev 263977)
@@ -475,62 +475,6 @@
     flex: none;
 }
 
-#if defined(ENABLE_INPUT_TYPE_DATE) && ENABLE_INPUT_TYPE_DATE
-input[type="date"] {
-    align-items: center;
-    -webkit-appearance: menulist-button;
-    display: -webkit-inline-flex;
-    overflow: hidden;
-#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)
-    width: 10em;
-#endif
-}
-#endif
-#if defined(ENABLE_INPUT_TYPE_DATETIMELOCAL) && ENABLE_INPUT_TYPE_DATETIMELOCAL
-input[type="datetime-local"] {
-    align-items: center;
-    -webkit-appearance: menulist-button;
-    display: -webkit-inline-flex;
-    overflow: hidden;
-#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)
-    width: 10em;
-#endif
-}
-#endif
-#if defined(ENABLE_INPUT_TYPE_MONTH) && ENABLE_INPUT_TYPE_MONTH
-input[type="month"] {
-    align-items: center;
-    -webkit-appearance: menulist-button;
-    display: -webkit-inline-flex;
-    overflow: hidden;
-#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)
-    width: 10em;
-#endif
-}
-#endif
-#if defined(ENABLE_INPUT_TYPE_TIME) && ENABLE_INPUT_TYPE_TIME
-input[type="time"] {
-    align-items: center;
-    -webkit-appearance: menulist-button;
-    display: -webkit-inline-flex;
-    overflow: hidden;
-#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)
-    width: 10em;
-#endif
-}
-#endif
-#if defined(ENABLE_INPUT_TYPE_WEEK) && ENABLE_INPUT_TYPE_WEEK
-#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)
-input[type="week"] {
-    align-items: center;
-    -webkit-appearance: menulist-button;
-    display: -webkit-inline-flex;
-    overflow: hidden;
-    width: 10em;
-}
-#endif
-#endif
-
 input::-webkit-date-and-time-value {
 #if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY
     margin-right: 18px;

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (263976 => 263977)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2020-07-06 19:01:37 UTC (rev 263977)
@@ -1766,11 +1766,6 @@
     return m_inputType->isDateField();
 }
 
-bool HTMLInputElement::isDateTimeField() const
-{
-    return m_inputType->isDateTimeField();
-}
-
 bool HTMLInputElement::isDateTimeLocalField() const
 {
     return m_inputType->isDateTimeLocalField();

Modified: trunk/Source/WebCore/html/HTMLInputElement.h (263976 => 263977)


--- trunk/Source/WebCore/html/HTMLInputElement.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/html/HTMLInputElement.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -122,7 +122,6 @@
     WEBCORE_EXPORT bool isTelephoneField() const;
     WEBCORE_EXPORT bool isURLField() const;
     WEBCORE_EXPORT bool isDateField() const;
-    WEBCORE_EXPORT bool isDateTimeField() const;
     WEBCORE_EXPORT bool isDateTimeLocalField() const;
     WEBCORE_EXPORT bool isMonthField() const;
     WEBCORE_EXPORT bool isTimeField() const;

Modified: trunk/Source/WebCore/html/InputType.cpp (263976 => 263977)


--- trunk/Source/WebCore/html/InputType.cpp	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/html/InputType.cpp	2020-07-06 19:01:37 UTC (rev 263977)
@@ -61,9 +61,9 @@
 #include "RenderElement.h"
 #include "RenderTheme.h"
 #include "ResetInputType.h"
-#include "RuntimeEnabledFeatures.h"
 #include "ScopedEventQueue.h"
 #include "SearchInputType.h"
+#include "Settings.h"
 #include "ShadowRoot.h"
 #include "SubmitInputType.h"
 #include "TelephoneInputType.h"
@@ -82,13 +82,12 @@
 
 using namespace HTMLNames;
 
-typedef bool (RuntimeEnabledFeatures::*InputTypeConditionalFunction)() const;
+typedef bool (Settings::*InputTypeConditionalFunction)() const;
 typedef const AtomString& (*InputTypeNameFunction)();
 typedef Ref<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
-typedef HashMap<AtomString, InputTypeFactoryFunction, ASCIICaseInsensitiveHash> InputTypeFactoryMap;
+typedef HashMap<AtomString, std::pair<InputTypeConditionalFunction, InputTypeFactoryFunction>, ASCIICaseInsensitiveHash> InputTypeFactoryMap;
 
-template<class T>
-static Ref<InputType> createInputType(HTMLInputElement& element)
+template<class T> static Ref<InputType> createInputType(HTMLInputElement& element)
 {
     return adoptRef(*new T(element));
 }
@@ -103,13 +102,13 @@
         { nullptr, &InputTypeNames::button, &createInputType<ButtonInputType> },
         { nullptr, &InputTypeNames::checkbox, &createInputType<CheckboxInputType> },
 #if ENABLE(INPUT_TYPE_COLOR)
-        { &RuntimeEnabledFeatures::inputTypeColorEnabled, &InputTypeNames::color, &createInputType<ColorInputType> },
+        { &Settings::inputTypeColorEnabled, &InputTypeNames::color, &createInputType<ColorInputType> },
 #endif
 #if ENABLE(INPUT_TYPE_DATE)
-        { &RuntimeEnabledFeatures::inputTypeDateEnabled, &InputTypeNames::date, &createInputType<DateInputType> },
+        { &Settings::inputTypeDateEnabled, &InputTypeNames::date, &createInputType<DateInputType> },
 #endif
 #if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-        { &RuntimeEnabledFeatures::inputTypeDateTimeLocalEnabled, &InputTypeNames::datetimelocal, &createInputType<DateTimeLocalInputType> },
+        { &Settings::inputTypeDateTimeLocalEnabled, &InputTypeNames::datetimelocal, &createInputType<DateTimeLocalInputType> },
 #endif
         { nullptr, &InputTypeNames::email, &createInputType<EmailInputType> },
         { nullptr, &InputTypeNames::file, &createInputType<FileInputType> },
@@ -116,7 +115,7 @@
         { nullptr, &InputTypeNames::hidden, &createInputType<HiddenInputType> },
         { nullptr, &InputTypeNames::image, &createInputType<ImageInputType> },
 #if ENABLE(INPUT_TYPE_MONTH)
-        { &RuntimeEnabledFeatures::inputTypeMonthEnabled, &InputTypeNames::month, &createInputType<MonthInputType> },
+        { &Settings::inputTypeMonthEnabled, &InputTypeNames::month, &createInputType<MonthInputType> },
 #endif
         { nullptr, &InputTypeNames::number, &createInputType<NumberInputType> },
         { nullptr, &InputTypeNames::password, &createInputType<PasswordInputType> },
@@ -127,21 +126,18 @@
         { nullptr, &InputTypeNames::submit, &createInputType<SubmitInputType> },
         { nullptr, &InputTypeNames::telephone, &createInputType<TelephoneInputType> },
 #if ENABLE(INPUT_TYPE_TIME)
-        { &RuntimeEnabledFeatures::inputTypeTimeEnabled, &InputTypeNames::time, &createInputType<TimeInputType> },
+        { &Settings::inputTypeTimeEnabled, &InputTypeNames::time, &createInputType<TimeInputType> },
 #endif
         { nullptr, &InputTypeNames::url, &createInputType<URLInputType> },
 #if ENABLE(INPUT_TYPE_WEEK)
-        { &RuntimeEnabledFeatures::inputTypeWeekEnabled, &InputTypeNames::week, &createInputType<WeekInputType> },
+        { &Settings::inputTypeWeekEnabled, &InputTypeNames::week, &createInputType<WeekInputType> },
 #endif
         // No need to register "text" because it is the default type.
     };
 
     InputTypeFactoryMap map;
-    for (auto& inputType : inputTypes) {
-        auto conditionalFunction = inputType.conditionalFunction;
-        if (!conditionalFunction || (RuntimeEnabledFeatures::sharedFeatures().*conditionalFunction)())
-            map.add(inputType.nameFunction(), inputType.factoryFunction);
-    }
+    for (auto& inputType : inputTypes)
+        map.add(inputType.nameFunction(), std::make_pair(inputType.conditionalFunction, inputType.factoryFunction));
     return map;
 }
 
@@ -149,7 +145,8 @@
 {
     if (!typeName.isEmpty()) {
         static const auto factoryMap = makeNeverDestroyed(createInputTypeFactoryMap());
-        if (auto factory = factoryMap.get().get(typeName))
+        auto&& [conditional, factory] = factoryMap.get().get(typeName);
+        if (factory && (!conditional || std::invoke(conditional, element.document().settings())))
             return factory(element);
     }
     return adoptRef(*new TextInputType(element));

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.cpp (263976 => 263977)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.cpp	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.cpp	2020-07-06 19:01:37 UTC (rev 263977)
@@ -47,9 +47,6 @@
 #if PLATFORM(WATCHOS)
     m_isWebSocketEnabled = false;
 #endif
-#if PLATFORM(GTK) && ENABLE(INPUT_TYPE_COLOR)
-    m_isInputTypeColorEnabled = true;
-#endif
 }
 
 RuntimeEnabledFeatures& RuntimeEnabledFeatures::sharedFeatures()

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (263976 => 263977)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -260,41 +260,11 @@
     bool legacyCSSVendorPrefixesEnabled() const { return m_isLegacyCSSVendorPrefixesEnabled; }
 #endif
 
-#if ENABLE(INPUT_TYPE_COLOR)
-    bool inputTypeColorEnabled() const { return m_isInputTypeColorEnabled; }
-    void setInputTypeColorEnabled(bool isEnabled) { m_isInputTypeColorEnabled = isEnabled; }
-#endif
-
 #if ENABLE(DATALIST_ELEMENT)
     bool dataListElementEnabled() const { return m_isDataListElementEnabled; }
     void setDataListElementEnabled(bool isEnabled) { m_isDataListElementEnabled = isEnabled; }
 #endif
 
-#if ENABLE(INPUT_TYPE_DATE)
-    bool inputTypeDateEnabled() const { return m_isInputTypeDateEnabled; }
-    void setInputTypeDateEnabled(bool isEnabled) { m_isInputTypeDateEnabled = isEnabled; }
-#endif
-
-#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-    bool inputTypeDateTimeLocalEnabled() const { return m_isInputTypeDateTimeLocalEnabled; }
-    void setInputTypeDateTimeLocalEnabled(bool isEnabled) { m_isInputTypeDateTimeLocalEnabled = isEnabled; }
-#endif
-
-#if ENABLE(INPUT_TYPE_MONTH)
-    bool inputTypeMonthEnabled() const { return m_isInputTypeMonthEnabled; }
-    void setInputTypeMonthEnabled(bool isEnabled) { m_isInputTypeMonthEnabled = isEnabled; }
-#endif
-
-#if ENABLE(INPUT_TYPE_TIME)
-    bool inputTypeTimeEnabled() const { return m_isInputTypeTimeEnabled; }
-    void setInputTypeTimeEnabled(bool isEnabled) { m_isInputTypeTimeEnabled = isEnabled; }
-#endif
-
-#if ENABLE(INPUT_TYPE_WEEK)
-    bool inputTypeWeekEnabled() const { return m_isInputTypeWeekEnabled; }
-    void setInputTypeWeekEnabled(bool isEnabled) { m_isInputTypeWeekEnabled = isEnabled; }
-#endif
-
 #if ENABLE(GAMEPAD)
     void setGamepadsEnabled(bool areEnabled) { m_areGamepadsEnabled = areEnabled; }
     bool gamepadsEnabled() const { return m_areGamepadsEnabled; }
@@ -522,34 +492,10 @@
     bool m_isLegacyCSSVendorPrefixesEnabled { false };
 #endif
 
-#if ENABLE(INPUT_TYPE_COLOR)
-    bool m_isInputTypeColorEnabled { false };
-#endif
-
 #if ENABLE(DATALIST_ELEMENT)
     bool m_isDataListElementEnabled { false };
 #endif
 
-#if ENABLE(INPUT_TYPE_DATE)
-    bool m_isInputTypeDateEnabled { true };
-#endif
-
-#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
-    bool m_isInputTypeDateTimeLocalEnabled { true };
-#endif
-
-#if ENABLE(INPUT_TYPE_MONTH)
-    bool m_isInputTypeMonthEnabled { true };
-#endif
-
-#if ENABLE(INPUT_TYPE_TIME)
-    bool m_isInputTypeTimeEnabled { true };
-#endif
-
-#if ENABLE(INPUT_TYPE_WEEK)
-    bool m_isInputTypeWeekEnabled { true };
-#endif
-
 #if ENABLE(GAMEPAD)
     bool m_areGamepadsEnabled { false };
 #endif

Modified: trunk/Source/WebCore/page/Settings.yaml (263976 => 263977)


--- trunk/Source/WebCore/page/Settings.yaml	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/page/Settings.yaml	2020-07-06 19:01:37 UTC (rev 263977)
@@ -950,6 +950,30 @@
 aspectRatioOfImgFromWidthAndHeightEnabled:
   initial: false
 
+inputTypeColorEnabled:
+  initial: false
+  conditional: INPUT_TYPE_COLOR
+
+inputTypeDateEnabled:
+  initial: false
+  conditional: INPUT_TYPE_DATE
+
+inputTypeDateTimeLocalEnabled:
+  initial: false
+  conditional: INPUT_TYPE_DATETIMELOCAL
+
+inputTypeMonthEnabled:
+  initial: false
+  conditional: INPUT_TYPE_MONTH
+
+inputTypeTimeEnabled:
+  initial: false
+  conditional: INPUT_TYPE_TIME
+
+inputTypeWeekEnabled:
+  initial: false
+  conditional: INPUT_TYPE_WEEK
+
 # Deprecated
 
 iceCandidateFilteringEnabled:

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (263976 => 263977)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -201,11 +201,6 @@
     String AXLinkActionVerb();
     String AXListItemActionVerb();
 
-#if ENABLE(INPUT_TYPE_WEEK)
-    // weekFormatInLDML() returns week and year format in LDML, Unicode
-    // technical standard 35, Locale Data Markup Language, e.g. "'Week' ww, yyyy"
-    String weekFormatInLDML();
-#endif
 #if PLATFORM(COCOA)
 #if ENABLE(METER_ELEMENT)
     String AXMeterGaugeRegionOptimumText();

Modified: trunk/Source/WebCore/platform/text/PlatformLocale.cpp (263976 => 263977)


--- trunk/Source/WebCore/platform/text/PlatformLocale.cpp	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/text/PlatformLocale.cpp	2020-07-06 19:01:37 UTC (rev 263977)
@@ -325,16 +325,10 @@
 }
 
 #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
-
-#if !PLATFORM(IOS_FAMILY)
 String Locale::formatDateTime(const DateComponents& date, FormatType formatType)
 {
     if (date.type() == DateComponents::Invalid)
         return String();
-#if !ENABLE(INPUT_TYPE_WEEK)
-    if (date.type() == DateComponents::Week)
-        return String();
-#endif
 
     DateTimeStringBuilder builder(*this, date);
     switch (date.type()) {
@@ -348,10 +342,8 @@
         builder.build(formatType == FormatTypeShort ? shortMonthFormat() : monthFormat());
         break;
     case DateComponents::Week:    
-#if ENABLE(INPUT_TYPE_WEEK)
-        builder.build(weekFormatInLDML());
+        // FIXME: Add support for formatting weeks.
         break;
-#endif
     case DateComponents::DateTimeLocal:
         builder.build(formatType == FormatTypeShort ? dateTimeFormatWithoutSeconds() : dateTimeFormatWithSeconds());
         break;
@@ -361,8 +353,6 @@
     }
     return builder.toString();
 }
-#endif // !PLATFORM(IOS_FAMILY)
-
 #endif
 
 }

Modified: trunk/Source/WebCore/platform/text/PlatformLocale.h (263976 => 263977)


--- trunk/Source/WebCore/platform/text/PlatformLocale.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/text/PlatformLocale.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -116,11 +116,7 @@
     // display to the user. If an implementation doesn't support
     // localized dates the function should return an empty string.
     // FormatType can be used to specify if you want the short format. 
-#if !PLATFORM(IOS_FAMILY)
-    String formatDateTime(const DateComponents&, FormatType = FormatTypeUnspecified);
-#else
-    virtual String formatDateTime(const DateComponents&, FormatType = FormatTypeUnspecified) = 0;
-#endif // !PLATFORM(IOS_FAMILY)
+    virtual String formatDateTime(const DateComponents&, FormatType = FormatTypeUnspecified);
 #endif
 
     virtual ~Locale();

Modified: trunk/Source/WebCore/platform/text/cocoa/LocaleCocoa.h (263976 => 263977)


--- trunk/Source/WebCore/platform/text/cocoa/LocaleCocoa.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/text/cocoa/LocaleCocoa.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -44,7 +44,7 @@
 
 class DateComponents;
 
-class LocaleCocoa : public Locale {
+class LocaleCocoa final : public Locale {
 public:
     explicit LocaleCocoa(NSLocale*);
     ~LocaleCocoa();

Modified: trunk/Source/WebCore/platform/text/cocoa/LocaleCocoa.mm (263976 => 263977)


--- trunk/Source/WebCore/platform/text/cocoa/LocaleCocoa.mm	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/text/cocoa/LocaleCocoa.mm	2020-07-06 19:01:37 UTC (rev 263977)
@@ -39,10 +39,7 @@
 #import <wtf/Language.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/text/AtomStringHash.h>
-
-#if PLATFORM(IOS_FAMILY)
 #import "LocalizedDateCache.h"
-#endif
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h (263976 => 263977)


--- trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -25,9 +25,6 @@
 
 #pragma once
 
-// FIXME: Rename this file to LocalizedDataCacheIOS.h and remove this guard.
-#if PLATFORM(IOS_FAMILY)
-
 #include "DateComponents.h"
 #include "FontCascade.h"
 #include <wtf/HashMap.h>
@@ -71,5 +68,3 @@
 LocalizedDateCache& localizedDateCache();
 
 } // namespace WebCore
-
-#endif // PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm (263976 => 263977)


--- trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm	2020-07-06 19:01:37 UTC (rev 263977)
@@ -26,9 +26,6 @@
 #import "config.h"
 #import "LocalizedDateCache.h"
 
-// FIXME: Rename this file to LocalizedDataCacheIOS.mm and consider removing this guard.
-#if PLATFORM(IOS_FAMILY)
-
 #import "FontCascade.h"
 #import <CoreFoundation/CFNotificationCenter.h>
 #import <math.h>
@@ -179,4 +176,3 @@
 
 } // namespace WebCore
 
-#endif // PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (263976 => 263977)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2020-07-06 19:01:37 UTC (rev 263977)
@@ -1034,12 +1034,66 @@
 
 String RenderTheme::colorInputStyleSheet() const
 {
-    ASSERT(RuntimeEnabledFeatures::sharedFeatures().inputTypeColorEnabled());
     return "input[type=\"color\"] { -webkit-appearance: color-well; width: 44px; height: 23px; outline: none; } "_s;
 }
 
 #endif // ENABLE(INPUT_TYPE_COLOR)
 
+#if PLATFORM(IOS_FAMILY)
+#define DATE_INPUT_WIDTH ""
+#else
+#define DATE_INPUT_WIDTH "width: 10em; "
+#endif
+
+#if ENABLE(INPUT_TYPE_DATE)
+
+String RenderTheme::dateInputStyleSheet() const
+{
+    return "input[type=\"date\"] { align-items: center; -webkit-appearance: menulist-button; display: -webkit-inline-flex; overflow: hidden; " DATE_INPUT_WIDTH "} "_s;
+}
+
+#endif
+
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+
+String RenderTheme::dateTimeLocalInputStyleSheet() const
+{
+    return "input[type=\"datetime-local\"] { align-items: center; -webkit-appearance: menulist-button; display: -webkit-inline-flex; overflow: hidden; " DATE_INPUT_WIDTH "} "_s;
+}
+
+#endif
+
+#if ENABLE(INPUT_TYPE_MONTH)
+
+String RenderTheme::monthInputStyleSheet() const
+{
+    return "input[type=\"month\"] { align-items: center; -webkit-appearance: menulist-button; display: -webkit-inline-flex; overflow: hidden; " DATE_INPUT_WIDTH "} "_s;
+}
+
+#endif
+
+#if ENABLE(INPUT_TYPE_TIME)
+
+String RenderTheme::timeInputStyleSheet() const
+{
+    return "input[type=\"time\"] { align-items: center; -webkit-appearance: menulist-button; display: -webkit-inline-flex; overflow: hidden; " DATE_INPUT_WIDTH "} "_s;
+}
+
+#endif
+
+#if ENABLE(INPUT_TYPE_WEEK)
+
+String RenderTheme::weekInputStyleSheet() const
+{
+#if PLATFORM(IOS_FAMILY)
+    return ""_s;
+#else
+    return "input[type=\"week\"] { align-items: center; -webkit-appearance: menulist-button; display: -webkit-inline-flex; overflow: hidden; " DATE_INPUT_WIDTH "} "_s;
+#endif
+}
+
+#endif
+
 #if ENABLE(DATALIST_ELEMENT)
 
 String RenderTheme::dataListStyleSheet() const

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (263976 => 263977)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -101,6 +101,21 @@
 #if ENABLE(INPUT_TYPE_COLOR)
     String colorInputStyleSheet() const;
 #endif
+#if ENABLE(INPUT_TYPE_DATE)
+    String dateInputStyleSheet() const;
+#endif
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+    String dateTimeLocalInputStyleSheet() const;
+#endif
+#if ENABLE(INPUT_TYPE_MONTH)
+    String monthInputStyleSheet() const;
+#endif
+#if ENABLE(INPUT_TYPE_TIME)
+    String timeInputStyleSheet() const;
+#endif
+#if ENABLE(INPUT_TYPE_WEEK)
+    String weekInputStyleSheet() const;
+#endif
 
     // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
     // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of

Modified: trunk/Source/WebCore/style/UserAgentStyle.cpp (263976 => 263977)


--- trunk/Source/WebCore/style/UserAgentStyle.cpp	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/style/UserAgentStyle.cpp	2020-07-06 19:01:37 UTC (rev 263977)
@@ -84,6 +84,21 @@
 #if ENABLE(INPUT_TYPE_COLOR)
 StyleSheetContents* UserAgentStyle::colorInputStyleSheet;
 #endif
+#if ENABLE(INPUT_TYPE_DATE)
+StyleSheetContents* UserAgentStyle::dateInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+StyleSheetContents* UserAgentStyle::dateTimeLocalInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_MONTH)
+StyleSheetContents* UserAgentStyle::monthInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_TIME)
+StyleSheetContents* UserAgentStyle::timeInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_WEEK)
+StyleSheetContents* UserAgentStyle::weekInputStyleSheet;
+#endif
 
 #if PLATFORM(IOS_FAMILY)
 #define DEFAULT_OUTLINE_WIDTH "3px"
@@ -269,6 +284,36 @@
             addToDefaultStyle(*colorInputStyleSheet);
         }
 #endif // ENABLE(INPUT_TYPE_COLOR)
+#if ENABLE(INPUT_TYPE_DATE)
+        else if (!dateInputStyleSheet && is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isDateField()) {
+            dateInputStyleSheet = parseUASheet(RenderTheme::singleton().dateInputStyleSheet());
+            addToDefaultStyle(*dateInputStyleSheet);
+        }
+#endif // ENABLE(INPUT_TYPE_DATE)
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+        else if (!dateTimeLocalInputStyleSheet && is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isDateTimeLocalField()) {
+            dateTimeLocalInputStyleSheet = parseUASheet(RenderTheme::singleton().dateTimeLocalInputStyleSheet());
+            addToDefaultStyle(*dateTimeLocalInputStyleSheet);
+        }
+#endif // ENABLE(INPUT_TYPE_DATETIMELOCAL)
+#if ENABLE(INPUT_TYPE_MONTH)
+        else if (!monthInputStyleSheet && is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isMonthField()) {
+            monthInputStyleSheet = parseUASheet(RenderTheme::singleton().monthInputStyleSheet());
+            addToDefaultStyle(*monthInputStyleSheet);
+        }
+#endif // ENABLE(INPUT_TYPE_MONTH)
+#if ENABLE(INPUT_TYPE_TIME)
+        else if (!timeInputStyleSheet && is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isTimeField()) {
+            timeInputStyleSheet = parseUASheet(RenderTheme::singleton().timeInputStyleSheet());
+            addToDefaultStyle(*timeInputStyleSheet);
+        }
+#endif // ENABLE(INPUT_TYPE_TIME)
+#if ENABLE(INPUT_TYPE_WEEK)
+        else if (!weekInputStyleSheet && is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isWeekField()) {
+            weekInputStyleSheet = parseUASheet(RenderTheme::singleton().weekInputStyleSheet());
+            addToDefaultStyle(*weekInputStyleSheet);
+        }
+#endif // ENABLE(INPUT_TYPE_WEEK)
     } else if (is<SVGElement>(element)) {
         if (!svgStyleSheet) {
             // SVG rules.

Modified: trunk/Source/WebCore/style/UserAgentStyle.h (263976 => 263977)


--- trunk/Source/WebCore/style/UserAgentStyle.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebCore/style/UserAgentStyle.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -54,6 +54,21 @@
 #if ENABLE(INPUT_TYPE_COLOR)
     static StyleSheetContents* colorInputStyleSheet;
 #endif
+#if ENABLE(INPUT_TYPE_DATE)
+    static StyleSheetContents* dateInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+    static StyleSheetContents* dateTimeLocalInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_MONTH)
+    static StyleSheetContents* monthInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_TIME)
+    static StyleSheetContents* timeInputStyleSheet;
+#endif
+#if ENABLE(INPUT_TYPE_WEEK)
+    static StyleSheetContents* weekInputStyleSheet;
+#endif
 
     static StyleSheetContents* mediaQueryStyleSheet;
 

Modified: trunk/Source/WebKit/ChangeLog (263976 => 263977)


--- trunk/Source/WebKit/ChangeLog	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebKit/ChangeLog	2020-07-06 19:01:37 UTC (rev 263977)
@@ -1,3 +1,30 @@
+2020-07-06  Sam Weinig  <[email protected]>
+
+        Compile-time enable (but leave disabled at runtime by default) date/time input types on macOS to allow testing of cross platform (e.g. DOM) aspects of the controls
+        https://bugs.webkit.org/show_bug.cgi?id=213949
+
+        Reviewed by Darin Adler.
+
+        * Shared/FocusedElementInformation.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKFocusedElementInfo initWithFocusedElementInformation:isUserInitiated:userObject:]):
+        (-[WKContentView requiresAccessoryView]):
+        (-[WKContentView textInputTraits]):
+        (mayContainSelectableText):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getFocusedElementInformation):
+        Remove DateTime from the InputType enum. This should have been removed when datetime was removed.
+
+        * Shared/WebPreferences.yaml:
+        Add preferences for all the date/time related input types, and have them automatically
+        link up with the newly added WebCore Settings of the same names (this is the default 
+        behavior if no explicit webcoreBinding: is provided).
+
+        * Shared/WebPreferencesDefaultValues.h:
+        Disable date/time input elements by default for non iOS/watchOS cocoa platforms. For non-Cocoa platforms
+        (and iOS/watchOS), they are enabled by default, but only actually get enabled if the appropriate ENABLE_*
+        macro is also set.
+
 2020-07-06  Haelwenn (lanodan) Monnier  <[email protected]>
 
         BubblewrapLauncher.cpp: Add paths required for sndio

Modified: trunk/Source/WebKit/Shared/FocusedElementInformation.h (263976 => 263977)


--- trunk/Source/WebKit/Shared/FocusedElementInformation.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebKit/Shared/FocusedElementInformation.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -53,7 +53,6 @@
     Number,
     NumberPad,
     Date,
-    DateTime,
     DateTimeLocal,
     Month,
     Week,
@@ -173,7 +172,6 @@
         WebKit::InputType::Number,
         WebKit::InputType::NumberPad,
         WebKit::InputType::Date,
-        WebKit::InputType::DateTime,
         WebKit::InputType::DateTimeLocal,
         WebKit::InputType::Month,
         WebKit::InputType::Week,

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (263976 => 263977)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2020-07-06 19:01:37 UTC (rev 263977)
@@ -1773,9 +1773,48 @@
   humanReadableName: "Color Inputs"
   humanReadableDescription: "Enable input elements of type color"
   category: internal
-  webcoreBinding: RuntimeEnabledFeatures
   condition: ENABLE(INPUT_TYPE_COLOR)
 
+InputTypeDateEnabled:
+  type: bool
+  defaultValue: DEFAULT_INPUT_TYPE_DATE_ENABLED
+  humanReadableName: "Date Input"
+  humanReadableDescription: "Enable input elements of type date"
+  category: internal
+  condition: ENABLE(INPUT_TYPE_DATE)
+
+InputTypeDateTimeLocalEnabled:
+  type: bool
+  defaultValue: DEFAULT_INPUT_TYPE_DATETIMELOCAL_ENABLED
+  humanReadableName: "datetime-local Inputs"
+  humanReadableDescription: "Enable input elements of type datetime-local"
+  category: internal
+  condition: ENABLE(INPUT_TYPE_DATETIMELOCAL)
+
+InputTypeMonthEnabled:
+  type: bool
+  defaultValue: DEFAULT_INPUT_TYPE_MONTH_ENABLED
+  humanReadableName: "Month Input"
+  humanReadableDescription: "Enable input elements of type month"
+  category: internal
+  condition: ENABLE(INPUT_TYPE_MONTH)
+
+InputTypeTimeEnabled:
+  type: bool
+  defaultValue: DEFAULT_INPUT_TYPE_TIME_ENABLED
+  humanReadableName: "Time Input"
+  humanReadableDescription: "Enable input elements of type time"
+  category: internal
+  condition: ENABLE(INPUT_TYPE_TIME)
+
+InputTypeWeekEnabled:
+  type: bool
+  defaultValue: DEFAULT_INPUT_TYPE_WEEK_ENABLED
+  humanReadableName: "Week Input"
+  humanReadableDescription: "Enable input elements of type week"
+  category: internal
+  condition: ENABLE(INPUT_TYPE_WEEK)
+
 DataListElementEnabled:
   type: bool
   defaultValue: DEFAULT_DATALIST_ELEMENT_ENABLED

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (263976 => 263977)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-07-06 19:01:37 UTC (rev 263977)
@@ -238,6 +238,20 @@
 #define DEFAULT_DATALIST_ELEMENT_ENABLED true
 #endif
 
+#if !PLATFORM(MAC) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
+#define DEFAULT_INPUT_TYPE_DATE_ENABLED true
+#define DEFAULT_INPUT_TYPE_DATETIMELOCAL_ENABLED true
+#define DEFAULT_INPUT_TYPE_MONTH_ENABLED true
+#define DEFAULT_INPUT_TYPE_TIME_ENABLED true
+#define DEFAULT_INPUT_TYPE_WEEK_ENABLED true
+#else
+#define DEFAULT_INPUT_TYPE_DATE_ENABLED false
+#define DEFAULT_INPUT_TYPE_DATETIMELOCAL_ENABLED false
+#define DEFAULT_INPUT_TYPE_MONTH_ENABLED false
+#define DEFAULT_INPUT_TYPE_TIME_ENABLED false
+#define DEFAULT_INPUT_TYPE_WEEK_ENABLED false
+#endif
+
 #if PLATFORM(COCOA) || PLATFORM(GTK)
 #define DEFAULT_CUSTOM_PASTEBOARD_DATA_ENABLED true
 #else

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (263976 => 263977)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2020-07-06 19:01:37 UTC (rev 263977)
@@ -540,9 +540,6 @@
     case WebKit::InputType::Date:
         _type = WKInputTypeDate;
         break;
-    case WebKit::InputType::DateTime:
-        _type = WKInputTypeDateTime;
-        break;
     case WebKit::InputType::DateTimeLocal:
         _type = WKInputTypeDateTimeLocal;
         break;
@@ -2959,7 +2956,6 @@
     case WebKit::InputType::ContentEditable:
     case WebKit::InputType::TextArea:
     case WebKit::InputType::Select:
-    case WebKit::InputType::DateTime:
     case WebKit::InputType::Week:
 #if ENABLE(INPUT_TYPE_COLOR)
     case WebKit::InputType::Color:
@@ -5034,7 +5030,6 @@
         case WebKit::InputType::TextArea:
         case WebKit::InputType::Search:
         case WebKit::InputType::Date:
-        case WebKit::InputType::DateTime:
         case WebKit::InputType::DateTimeLocal:
         case WebKit::InputType::Month:
         case WebKit::InputType::Week:
@@ -5081,7 +5076,6 @@
     case WebKit::InputType::Color:
 #endif
     case WebKit::InputType::Date:
-    case WebKit::InputType::DateTime:
     case WebKit::InputType::DateTimeLocal:
     case WebKit::InputType::Drawing:
     case WebKit::InputType::Email:
@@ -5777,7 +5771,6 @@
     case WebKit::InputType::Text:
     case WebKit::InputType::TextArea:
     case WebKit::InputType::URL:
-    case WebKit::InputType::DateTime:
     case WebKit::InputType::Week:
         return true;
     }

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (263976 => 263977)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-07-06 18:09:28 UTC (rev 263976)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-07-06 19:01:37 UTC (rev 263977)
@@ -3179,8 +3179,6 @@
             information.elementType = InputType::DateTimeLocal;
         else if (element.isDateField())
             information.elementType = InputType::Date;
-        else if (element.isDateTimeField())
-            information.elementType = InputType::DateTime;
         else if (element.isTimeField())
             information.elementType = InputType::Time;
         else if (element.isWeekField())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to