Drop DarkModeCSSEnabled as an experimental feature and always enable it.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jul 2019 15:19:06 +0000 (15:19 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jul 2019 15:19:06 +0000 (15:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199725
rdar://problem/52970972

Reviewed by Megan Gardner.

Source/WebCore:

Tests: css-dark-mode

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate):
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Deleted.

Source/WebKit:

* Shared/WebPreferences.yaml: Removed DarkModeCSSEnabled.

LayoutTests:

Removed <!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
from all dark mode tests.

* css-dark-mode/color-scheme-css-parse.html:
* css-dark-mode/color-scheme-css.html:
* css-dark-mode/color-scheme-meta.html:
* css-dark-mode/color-scheme-priority.html:
* css-dark-mode/color-scheme-scrollbar.html:
* css-dark-mode/default-colors.html:
* css-dark-mode/older-syntax/supported-color-schemes-css.html:
* css-dark-mode/older-syntax/supported-color-schemes-meta.html:
* css-dark-mode/older-systems/color-scheme-css.html:
* css-dark-mode/older-systems/color-scheme-meta.html:
* css-dark-mode/older-systems/prefers-color-scheme.html:
* css-dark-mode/prefers-color-scheme-picture-element.html:
* css-dark-mode/prefers-color-scheme.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247388 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
LayoutTests/ChangeLog
LayoutTests/css-dark-mode/color-scheme-css-parse.html
LayoutTests/css-dark-mode/color-scheme-css.html
LayoutTests/css-dark-mode/color-scheme-meta.html
LayoutTests/css-dark-mode/color-scheme-priority.html
LayoutTests/css-dark-mode/color-scheme-scrollbar.html
LayoutTests/css-dark-mode/default-colors.html
LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-css.html
LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta.html
LayoutTests/css-dark-mode/older-systems/color-scheme-css.html
LayoutTests/css-dark-mode/older-systems/color-scheme-meta.html
LayoutTests/css-dark-mode/older-systems/prefers-color-scheme.html
LayoutTests/css-dark-mode/prefers-color-scheme-picture-element.html
LayoutTests/css-dark-mode/prefers-color-scheme.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/css/MediaQueryExpression.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/html/HTMLMetaElement.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml

index c09bab7..cf36feb 100644 (file)
@@ -1,3 +1,28 @@
+2019-07-12  Timothy Hatcher  <timothy@apple.com>
+
+        Drop DarkModeCSSEnabled as an experimental feature and always enable it.
+        https://bugs.webkit.org/show_bug.cgi?id=199725
+        rdar://problem/52970972
+
+        Reviewed by Megan Gardner.
+
+        Removed <!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
+        from all dark mode tests.
+
+        * css-dark-mode/color-scheme-css-parse.html:
+        * css-dark-mode/color-scheme-css.html:
+        * css-dark-mode/color-scheme-meta.html:
+        * css-dark-mode/color-scheme-priority.html:
+        * css-dark-mode/color-scheme-scrollbar.html:
+        * css-dark-mode/default-colors.html:
+        * css-dark-mode/older-syntax/supported-color-schemes-css.html:
+        * css-dark-mode/older-syntax/supported-color-schemes-meta.html:
+        * css-dark-mode/older-systems/color-scheme-css.html:
+        * css-dark-mode/older-systems/color-scheme-meta.html:
+        * css-dark-mode/older-systems/prefers-color-scheme.html:
+        * css-dark-mode/prefers-color-scheme-picture-element.html:
+        * css-dark-mode/prefers-color-scheme.html:
+
 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
 
         New York font erroneously gets synthetic bold
index 8c01abf..1ca7650 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index ba56f66..9166a8a 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index 887dc4a..1aa4909 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index ef49ae4..76912c0 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index bb763c3..1567b80 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index 9a95772..7583ef9 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index 4cffb9d..1e98085 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 
index 3284aea..d537829 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 
index 9a21f00..b548835 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 
index 587af9f..9790329 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 
index e970c3e..a84a3a6 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 
index de2b062..f9be020 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index c2cbe77..0bbce88 100644 (file)
@@ -1,7 +1,5 @@
 <!DOCTYPE html>
 
-<!-- webkit-test-runner [ experimental:DarkModeCSSEnabled=true ] -->
-
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
 
index 98d1b15..c0c8881 100644 (file)
@@ -1,3 +1,28 @@
+2019-07-12  Timothy Hatcher  <timothy@apple.com>
+
+        Drop DarkModeCSSEnabled as an experimental feature and always enable it.
+        https://bugs.webkit.org/show_bug.cgi?id=199725
+        rdar://problem/52970972
+
+        Reviewed by Megan Gardner.
+
+        Tests: css-dark-mode
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::prefersColorSchemeEvaluate):
+        * css/MediaQueryExpression.cpp:
+        (WebCore::featureWithValidIdent):
+        (WebCore::isFeatureValidWithoutValue):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        * html/HTMLMetaElement.cpp:
+        (WebCore::HTMLMetaElement::process):
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Deleted.
+
 2019-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         Refactor ShadowBlur: remove some class variables and use function parameters instead.
index 4c4bef6..b36e03e 100644 (file)
@@ -4029,9 +4029,6 @@ RefPtr<CSSValue> ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty
 
 #if ENABLE(DARK_MODE_CSS)
         case CSSPropertyColorScheme: {
-            if (!RuntimeEnabledFeatures::sharedFeatures().darkModeCSSEnabled())
-                return nullptr;
-
             auto colorScheme = style.colorScheme();
             if (colorScheme.isAuto())
                 return cssValuePool.createIdentifierValue(CSSValueAuto);
index 6cac9e1..ac56f8a 100644 (file)
@@ -767,8 +767,6 @@ static bool prefersDarkInterfaceEvaluate(CSSValue* value, const CSSToLengthConve
 #if ENABLE(DARK_MODE_CSS)
 static bool prefersColorSchemeEvaluate(CSSValue* value, const CSSToLengthConversionData&, Frame& frame, MediaFeaturePrefix)
 {
-    ASSERT(RuntimeEnabledFeatures::sharedFeatures().darkModeCSSEnabled());
-
     if (!value)
         return true;
 
index 4373e8b..cd81ff3 100644 (file)
@@ -55,7 +55,7 @@ static inline bool featureWithValidIdent(const AtomString& mediaFeature, const C
     || mediaFeature == MediaFeatureNames::displayMode
 #endif
 #if ENABLE(DARK_MODE_CSS)
-    || (mediaFeature == MediaFeatureNames::prefersColorScheme && RuntimeEnabledFeatures::sharedFeatures().darkModeCSSEnabled())
+    || (mediaFeature == MediaFeatureNames::prefersColorScheme)
 #endif
     || mediaFeature == MediaFeatureNames::prefersReducedMotion
     || (mediaFeature == MediaFeatureNames::prefersDarkInterface && (context.useSystemAppearance || isUASheetBehavior(context.mode)));
@@ -168,7 +168,7 @@ static inline bool isFeatureValidWithoutValue(const AtomString& mediaFeature, co
         || mediaFeature == MediaFeatureNames::prefersReducedMotion
         || (mediaFeature == MediaFeatureNames::prefersDarkInterface && (context.useSystemAppearance || isUASheetBehavior(context.mode)))
 #if ENABLE(DARK_MODE_CSS)
-        || (mediaFeature == MediaFeatureNames::prefersColorScheme && RuntimeEnabledFeatures::sharedFeatures().darkModeCSSEnabled())
+        || (mediaFeature == MediaFeatureNames::prefersColorScheme)
 #endif
         || mediaFeature == MediaFeatureNames::devicePixelRatio
         || mediaFeature == MediaFeatureNames::resolution
index 902da15..488e602 100644 (file)
@@ -4241,8 +4241,6 @@ RefPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSS
         return consumeTextEmphasisPosition(m_range);
 #if ENABLE(DARK_MODE_CSS)
     case CSSPropertyColorScheme:
-        if (!RuntimeEnabledFeatures::sharedFeatures().darkModeCSSEnabled())
-            return nullptr;
         return consumeColorScheme(m_range);
 #endif
     default:
index af6e6c1..2b0787e 100644 (file)
@@ -92,7 +92,7 @@ void HTMLMetaElement::process()
     else if (RuntimeEnabledFeatures::sharedFeatures().disabledAdaptationsMetaTagEnabled() && equalLettersIgnoringASCIICase(name(), "disabled-adaptations"))
         document().processDisabledAdaptations(contentValue);
 #if ENABLE(DARK_MODE_CSS)
-    else if (RuntimeEnabledFeatures::sharedFeatures().darkModeCSSEnabled() && (equalLettersIgnoringASCIICase(name(), "color-scheme") || equalLettersIgnoringASCIICase(name(), "supported-color-schemes")))
+    else if (equalLettersIgnoringASCIICase(name(), "color-scheme") || equalLettersIgnoringASCIICase(name(), "supported-color-schemes"))
         document().processColorScheme(contentValue);
 #endif
 #if PLATFORM(IOS_FAMILY)
index c68d867..5382890 100644 (file)
@@ -85,11 +85,6 @@ public:
     void setDirectoryUploadEnabled(bool isEnabled) { m_isDirectoryUploadEnabled = isEnabled; }
     bool directoryUploadEnabled() const { return m_isDirectoryUploadEnabled; }
 
-#if ENABLE(DARK_MODE_CSS)
-    void setDarkModeCSSEnabled(bool isEnabled) { m_isDarkModeCSSEnabled = isEnabled; }
-    bool darkModeCSSEnabled() const { return m_isDarkModeCSSEnabled; }
-#endif
-
     void setDataTransferItemsEnabled(bool areEnabled) { m_areDataTransferItemsEnabled = areEnabled; }
     bool dataTransferItemsEnabled() const { return m_areDataTransferItemsEnabled; }
 
@@ -437,10 +432,6 @@ private:
     bool m_isAttachmentElementEnabled { false };
 #endif
 
-#if ENABLE(DARK_MODE_CSS)
-    bool m_isDarkModeCSSEnabled { true };
-#endif
-
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
     bool m_isIndexedDBWorkersEnabled { true };
 #endif
index 96e5c82..f5da86c 100644 (file)
@@ -1,3 +1,13 @@
+2019-07-12  Timothy Hatcher  <timothy@apple.com>
+
+        Drop DarkModeCSSEnabled as an experimental feature and always enable it.
+        https://bugs.webkit.org/show_bug.cgi?id=199725
+        rdar://problem/52970972
+
+        Reviewed by Megan Gardner.
+
+        * Shared/WebPreferences.yaml: Removed DarkModeCSSEnabled.
+
 2019-07-11  Myles C. Maxfield  <mmaxfield@apple.com>
 
         New York font erroneously gets synthetic bold
index dff5569..6fe8530 100644 (file)
@@ -1354,15 +1354,6 @@ CSSCustomPropertiesAndValuesEnabled:
   webcoreBinding: RuntimeEnabledFeatures
   category: experimental
 
-DarkModeCSSEnabled:
-  type: bool
-  defaultValue: true
-  humanReadableName: "Dark Mode CSS Support"
-  humanReadableDescription: "Enable Dark Mode CSS Support"
-  webcoreBinding: RuntimeEnabledFeatures
-  category: experimental
-  condition: ENABLE(DARK_MODE_CSS)
-
 CSSPaintingAPIEnabled:
   type: bool
   defaultValue: false