Title: [211055] trunk/Source/WebCore
Revision
211055
Author
[email protected]
Date
2017-01-23 13:16:19 -0800 (Mon, 23 Jan 2017)

Log Message

Convert langAttributeAwareFormControlUIEnabled to a Setting
https://bugs.webkit.org/show_bug.cgi?id=167279

Patch by Joseph Pecoraro <[email protected]> on 2017-01-23
Reviewed by Sam Weinig.

* dom/Document.cpp:
(WebCore::Document::getCachedLocale):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters):
Convert to use Settings instead of RuntimeEnabledFeatures.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled): Deleted.
* page/Settings.in:
Move to Settings.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Remove the manual interface for the RuntimeEnabledFeature.
An identical interface is generated from Settings.in!

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (211054 => 211055)


--- trunk/Source/WebCore/ChangeLog	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/ChangeLog	2017-01-23 21:16:19 UTC (rev 211055)
@@ -1,3 +1,31 @@
+2017-01-23  Joseph Pecoraro  <[email protected]>
+
+        Convert langAttributeAwareFormControlUIEnabled to a Setting
+        https://bugs.webkit.org/show_bug.cgi?id=167279
+
+        Reviewed by Sam Weinig.
+
+        * dom/Document.cpp:
+        (WebCore::Document::getCachedLocale):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
+        Convert to use Settings instead of RuntimeEnabledFeatures.
+
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled): Deleted.
+        * page/Settings.in:
+        Move to Settings.
+
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled): Deleted.
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+        Remove the manual interface for the RuntimeEnabledFeature.
+        An identical interface is generated from Settings.in!
+
 2017-01-20  Anders Carlsson  <[email protected]>
 
         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)

Modified: trunk/Source/WebCore/dom/Document.cpp (211054 => 211055)


--- trunk/Source/WebCore/dom/Document.cpp	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-01-23 21:16:19 UTC (rev 211055)
@@ -6571,7 +6571,7 @@
 Locale& Document::getCachedLocale(const AtomicString& locale)
 {
     AtomicString localeKey = locale;
-    if (locale.isEmpty() || !RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
+    if (locale.isEmpty() || !settings() || !settings()->langAttributeAwareFormControlUIEnabled())
         localeKey = defaultLanguage();
     LocaleIdentifierToLocaleMap::AddResult result = m_localeCache.add(localeKey, nullptr);
     if (result.isNewEntry)

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (211054 => 211055)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2017-01-23 21:16:19 UTC (rev 211055)
@@ -56,9 +56,9 @@
 #include "PlatformMouseEvent.h"
 #include "RenderTextControlSingleLine.h"
 #include "RenderTheme.h"
-#include "RuntimeEnabledFeatures.h"
 #include "ScopedEventQueue.h"
 #include "SearchInputType.h"
+#include "Settings.h"
 #include "StyleResolver.h"
 #include <wtf/MathExtras.h>
 #include <wtf/Ref.h>
@@ -2034,7 +2034,9 @@
     parameters.minimum = minimum();
     parameters.maximum = maximum();
     parameters.required = isRequired();
-    if (!RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
+
+    Settings* settings = document().settings();
+    if (!settings || !settings->langAttributeAwareFormControlUIEnabled())
         parameters.locale = defaultLanguage();
     else {
         AtomicString computedLocale = computeInheritedLanguage();

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (211054 => 211055)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2017-01-23 21:16:19 UTC (rev 211055)
@@ -43,10 +43,6 @@
 class RuntimeEnabledFeatures {
     WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures);
 public:
-    // The lang attribute support is incomplete and should only be turned on for tests.
-    bool langAttributeAwareFormControlUIEnabled() const { return m_isLangAttributeAwareFormControlUIEnabled; }
-    void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { m_isLangAttributeAwareFormControlUIEnabled = isEnabled; }
-
     void setDOMIteratorEnabled(bool isEnabled) { m_isDOMIteratorEnabled = isEnabled; }
     bool domIteratorEnabled() const { return m_isDOMIteratorEnabled; }
 
@@ -201,7 +197,6 @@
     // Never instantiate.
     RuntimeEnabledFeatures();
 
-    bool m_isLangAttributeAwareFormControlUIEnabled { false }; // FIXME: Move this to Settings.
     bool m_areModernMediaControlsEnabled { false };
     bool m_isLinkPreloadEnabled { false };
     bool m_isResourceTimingEnabled { false };

Modified: trunk/Source/WebCore/page/Settings.in (211054 => 211055)


--- trunk/Source/WebCore/page/Settings.in	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/page/Settings.in	2017-01-23 21:16:19 UTC (rev 211055)
@@ -289,3 +289,5 @@
 animatedImageAsyncDecodingEnabled initial=true
 
 shouldSuppressKeyboardInputDuringProvisionalNavigation initial=false
+
+langAttributeAwareFormControlUIEnabled initial=false

Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (211054 => 211055)


--- trunk/Source/WebCore/testing/InternalSettings.cpp	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp	2017-01-23 21:16:19 UTC (rev 211055)
@@ -94,7 +94,6 @@
     , m_forcedColorsAreInvertedAccessibilityValue(settings.forcedColorsAreInvertedAccessibilityValue())
     , m_forcedDisplayIsMonochromeAccessibilityValue(settings.forcedDisplayIsMonochromeAccessibilityValue())
     , m_forcedPrefersReducedMotionAccessibilityValue(settings.forcedPrefersReducedMotionAccessibilityValue())
-    , m_langAttributeAwareFormControlUIEnabled(RuntimeEnabledFeatures::sharedFeatures().langAttributeAwareFormControlUIEnabled())
     , m_resourceTimingEnabled(RuntimeEnabledFeatures::sharedFeatures().resourceTimingEnabled())
     , m_linkPreloadEnabled(RuntimeEnabledFeatures::sharedFeatures().linkPreloadEnabled())
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
@@ -184,7 +183,6 @@
     settings.setForcedPrefersReducedMotionAccessibilityValue(m_forcedPrefersReducedMotionAccessibilityValue);
     Settings::setAllowsAnySSLCertificate(false);
 
-    RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(m_langAttributeAwareFormControlUIEnabled);
     RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(m_resourceTimingEnabled);
     RuntimeEnabledFeatures::sharedFeatures().setLinkPreloadEnabled(m_linkPreloadEnabled);
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
@@ -668,11 +666,6 @@
     return { };
 }
 
-void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
-{
-    RuntimeEnabledFeatures::sharedFeatures().setLangAttributeAwareFormControlUIEnabled(enabled);
-}
-
 void InternalSettings::setResourceTimingEnabled(bool enabled)
 {
     RuntimeEnabledFeatures::sharedFeatures().setResourceTimingEnabled(enabled);

Modified: trunk/Source/WebCore/testing/InternalSettings.h (211054 => 211055)


--- trunk/Source/WebCore/testing/InternalSettings.h	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/testing/InternalSettings.h	2017-01-23 21:16:19 UTC (rev 211055)
@@ -109,7 +109,6 @@
     void setForcedPrefersReducedMotionAccessibilityValue(ForcedAccessibilityValue);
 
     // RuntimeEnabledFeatures.
-    static void setLangAttributeAwareFormControlUIEnabled(bool);
     static void setResourceTimingEnabled(bool);
     static void setLinkPreloadEnabled(bool);
     static void setIndexedDBWorkersEnabled(bool);
@@ -188,7 +187,6 @@
         Settings::ForcedAccessibilityValue m_forcedPrefersReducedMotionAccessibilityValue;
 
         // Runtime enabled settings.
-        bool m_langAttributeAwareFormControlUIEnabled;
         bool m_resourceTimingEnabled;
         bool m_linkPreloadEnabled;
         bool m_indexedDBWorkersEnabled;

Modified: trunk/Source/WebCore/testing/InternalSettings.idl (211054 => 211055)


--- trunk/Source/WebCore/testing/InternalSettings.idl	2017-01-23 21:08:02 UTC (rev 211054)
+++ trunk/Source/WebCore/testing/InternalSettings.idl	2017-01-23 21:16:19 UTC (rev 211055)
@@ -82,7 +82,6 @@
     [MayThrowException] void setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);
 
     // RuntimeEnabledFeatures.
-    void setLangAttributeAwareFormControlUIEnabled(boolean enabled);
     void setResourceTimingEnabled(boolean enabled);
     void setLinkPreloadEnabled(boolean enabled);
     void setIndexedDBWorkersEnabled(boolean enabled);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to