[CSS Grid Layout] Enable runtime feature if feature flag is enabled
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Apr 2014 21:57:12 +0000 (21:57 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Apr 2014 21:57:12 +0000 (21:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130013

Reviewed by Simon Fraser.

Source/WebKit/mac:

Enable CSS Grid Layout runtime feature when ENABLE_CSS_GRID_LAYOUT flag is true.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

Enable CSS Grid Layout runtime feature when ENABLE_CSS_GRID_LAYOUT flag is true.

* Shared/WebPreferencesStore.h:

LayoutTests:

Modify layout test as feature is not disabled by default in WK2.
The test now checks that the runtime feature can be disabled.

* fast/css-grid-layout/grid-disabled-expected.txt: Renamed from LayoutTests/fast/css-grid-layout/grid-disabled-by-default-expected.txt.
* fast/css-grid-layout/grid-disabled.html: Renamed from LayoutTests/fast/css-grid-layout/grid-disabled-by-default.html.

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

LayoutTests/ChangeLog
LayoutTests/fast/css-grid-layout/grid-disabled-expected.txt [moved from LayoutTests/fast/css-grid-layout/grid-disabled-by-default-expected.txt with 70% similarity]
LayoutTests/fast/css-grid-layout/grid-disabled.html [moved from LayoutTests/fast/css-grid-layout/grid-disabled-by-default.html with 57% similarity]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h

index a07187d..61be984 100644 (file)
@@ -1,3 +1,16 @@
+2014-04-01  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [CSS Grid Layout] Enable runtime feature if feature flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=130013
+
+        Reviewed by Simon Fraser.
+
+        Modify layout test as feature is not disabled by default in WK2.
+        The test now checks that the runtime feature can be disabled.
+
+        * fast/css-grid-layout/grid-disabled-expected.txt: Renamed from LayoutTests/fast/css-grid-layout/grid-disabled-by-default-expected.txt.
+        * fast/css-grid-layout/grid-disabled.html: Renamed from LayoutTests/fast/css-grid-layout/grid-disabled-by-default.html.
+
 2014-04-01  Javier Fernandez  <jfernandez@igalia.com>
 
         [CSS Grid Layout] Make the grid-item-margin-auto-columns-rows.html test a reftest
@@ -1,4 +1,4 @@
-Verifies that display: -webkit-grid does nothing by default.
+Verifies that display: -webkit-grid does nothing if runtime feature is disabled.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
@@ -1,14 +1,18 @@
 <!DOCTYPE html>
 <html>
+<script>
+if (window.testRunner)
+    testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 0);
+</script>
 <body>
 <div id="grid" style="display: -webkit-grid"></div>
 
 <script src="../../resources/js-test-pre.js"></script>
 <script>
-description("Verifies that display: -webkit-grid does nothing by default.");
+description("Verifies that display: -webkit-grid does nothing if runtime feature is disabled.");
 
 shouldBe("document.getElementById('grid').style.display", "''");
 </script>
 <script src="../../resources/js-test-post.js"></script>
 </body>
-</html>
\ No newline at end of file
+</html>
index 18aca57..16e4079 100644 (file)
@@ -1,3 +1,15 @@
+2014-04-01  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [CSS Grid Layout] Enable runtime feature if feature flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=130013
+
+        Reviewed by Simon Fraser.
+
+        Enable CSS Grid Layout runtime feature when ENABLE_CSS_GRID_LAYOUT flag is true.
+
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+
 2014-03-31  Simon Fraser  <simon.fraser@apple.com>
 
         Enable WEB_TIMING on Mac and iOS
index cdb9850..0c76bb9 100644 (file)
@@ -485,7 +485,11 @@ public:
         [NSNumber numberWithBool:YES],  WebKitAcceleratedCompositingEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitCSSRegionsEnabledPreferenceKey,
         [NSNumber numberWithBool:YES], WebKitCSSCompositingEnabledPreferenceKey,
+#if ENABLE(CSS_GRID_LAYOUT)
+        [NSNumber numberWithBool:YES],  WebKitCSSGridLayoutEnabledPreferenceKey,
+#else
         [NSNumber numberWithBool:NO],  WebKitCSSGridLayoutEnabledPreferenceKey,
+#endif
 #if PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
         [NSNumber numberWithBool:YES],  WebKitAcceleratedDrawingEnabledPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
index 2f91b6f..e1b9c02 100644 (file)
@@ -1,3 +1,14 @@
+2014-04-01  Manuel Rego Casasnovas  <rego@igalia.com>
+
+        [CSS Grid Layout] Enable runtime feature if feature flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=130013
+
+        Reviewed by Simon Fraser.
+
+        Enable CSS Grid Layout runtime feature when ENABLE_CSS_GRID_LAYOUT flag is true.
+
+        * Shared/WebPreferencesStore.h:
+
 2014-04-01  Anders Carlsson  <andersca@apple.com>
 
         Demote WKBackForwardListDidChangeNotification to SPI
index 9ee470a..4a66f1a 100644 (file)
@@ -100,6 +100,12 @@ namespace WebKit {
 #define DEFAULT_CANVAS_USES_ACCELERATED_DRAWING true
 #endif
 
+#if ENABLE(CSS_GRID_LAYOUT)
+#define DEFAULT_CSS_GRID_LAYOUT_ENABLED true
+#else
+#define DEFAULT_CSS_GRID_LAYOUT_ENABLED false
+#endif
+
 #define FOR_EACH_WEBKIT_BOOL_PREFERENCE(macro) \
     macro(JavaScriptEnabled, javaScriptEnabled, Bool, bool, true) \
     macro(JavaScriptMarkupEnabled, javaScriptMarkupEnabled, Bool, bool, true) \
@@ -133,7 +139,7 @@ namespace WebKit {
     macro(Accelerated2dCanvasEnabled, accelerated2dCanvasEnabled, Bool, bool, false) \
     macro(CSSRegionsEnabled, cssRegionsEnabled, Bool, bool, true) \
     macro(CSSCompositingEnabled, cssCompositingEnabled, Bool, bool, true) \
-    macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, false) \
+    macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, DEFAULT_CSS_GRID_LAYOUT_ENABLED) \
     macro(RegionBasedColumnsEnabled, regionBasedColumnsEnabled, Bool, bool, false) \
     macro(ForceFTPDirectoryListings, forceFTPDirectoryListings, Bool, bool, false) \
     macro(TabsToLinks, tabsToLinks, Bool, bool, DEFAULT_WEBKIT_TABSTOLINKS_ENABLED) \