Title: [236497] trunk/Source/WebKit
Revision
236497
Author
rn...@webkit.org
Date
2018-09-25 22:26:30 -0700 (Tue, 25 Sep 2018)

Log Message

Make frame flattening an internal debug feature
https://bugs.webkit.org/show_bug.cgi?id=189984

Reviewed by Simon Fraser.

Made frame flattening a runtime switchable from internal debug menu.

To avoid having to enumerate three distinct values in the settings, made it a boolean flag in WKPreference.
That's what's exposd as an API anyway.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFrameFlatteningEnabled):
(WKPreferencesGetFrameFlatteningEnabled):
* UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_get_enable_frame_flattening):
(webkit_settings_set_enable_frame_flattening):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236496 => 236497)


--- trunk/Source/WebKit/ChangeLog	2018-09-26 05:16:22 UTC (rev 236496)
+++ trunk/Source/WebKit/ChangeLog	2018-09-26 05:26:30 UTC (rev 236497)
@@ -1,3 +1,26 @@
+2018-09-25  Ryosuke Niwa  <rn...@webkit.org>
+
+        Make frame flattening an internal debug feature
+        https://bugs.webkit.org/show_bug.cgi?id=189984
+
+        Reviewed by Simon Fraser.
+
+        Made frame flattening a runtime switchable from internal debug menu.
+
+        To avoid having to enumerate three distinct values in the settings, made it a boolean flag in WKPreference.
+        That's what's exposd as an API anyway.
+
+        * Shared/WebPreferences.yaml:
+        * Shared/WebPreferencesDefaultValues.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetFrameFlatteningEnabled):
+        (WKPreferencesGetFrameFlatteningEnabled):
+        * UIProcess/API/glib/WebKitSettings.cpp:
+        (webkit_settings_get_enable_frame_flattening):
+        (webkit_settings_set_enable_frame_flattening):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2018-09-25  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream] Add Mac window capture source

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (236496 => 236497)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-09-26 05:16:22 UTC (rev 236496)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2018-09-26 05:26:30 UTC (rev 236497)
@@ -886,10 +886,13 @@
   defaultValue: 0
   webcoreBinding: custom
 
-FrameFlattening:
-  type: uint32_t
+FrameFlatteningEnabled:
+  type: bool
   defaultValue: DEFAULT_FRAME_FLATTENING
   webcoreBinding: custom
+  humanReadableName: "Frame flattening"
+  humanReadableDescription: "Enable frame flattening, which adjusts the height of an iframe to fit its contents"
+  category: internal
 
 StandardFontFamily:
   type: String

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (236496 => 236497)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2018-09-26 05:16:22 UTC (rev 236496)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2018-09-26 05:26:30 UTC (rev 236497)
@@ -60,7 +60,7 @@
 #if PLATFORM(IOS)
 #define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK true
 #define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED false
-#define DEFAULT_FRAME_FLATTENING FrameFlattening::FullyEnabled
+#define DEFAULT_FRAME_FLATTENING true
 #define DEFAULT_SHOULD_PRINT_BACKGROUNDS true
 #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
 #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
@@ -79,7 +79,7 @@
 #else
 #define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK false
 #define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED true
-#define DEFAULT_FRAME_FLATTENING FrameFlattening::Disabled
+#define DEFAULT_FRAME_FLATTENING false
 #define DEFAULT_SHOULD_PRINT_BACKGROUNDS false
 #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE true
 #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY true

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (236496 => 236497)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2018-09-26 05:16:22 UTC (rev 236496)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2018-09-26 05:26:30 UTC (rev 236497)
@@ -160,14 +160,12 @@
 
 void WKPreferencesSetFrameFlatteningEnabled(WKPreferencesRef preferencesRef, bool frameFlatteningEnabled)
 {
-    // FIXME: Expose more frame flattening values.
-    toImpl(preferencesRef)->setFrameFlattening(frameFlatteningEnabled ? static_cast<uint32_t>(WebCore::FrameFlattening::FullyEnabled) : static_cast<uint32_t>(WebCore::FrameFlattening::Disabled));
+    toImpl(preferencesRef)->setFrameFlatteningEnabled(frameFlatteningEnabled);
 }
 
 bool WKPreferencesGetFrameFlatteningEnabled(WKPreferencesRef preferencesRef)
 {
-    // FIXME: Expose more frame flattening values.
-    return toImpl(preferencesRef)->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
+    return toImpl(preferencesRef)->frameFlatteningEnabled();
 }
 
 void WKPreferencesSetPluginsEnabled(WKPreferencesRef preferencesRef, bool pluginsEnabled)

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp (236496 => 236497)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp	2018-09-26 05:16:22 UTC (rev 236496)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp	2018-09-26 05:26:30 UTC (rev 236497)
@@ -1717,8 +1717,7 @@
 {
     g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), FALSE);
 
-    // FIXME: Expose more frame flattening values.
-    return settings->priv->preferences->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
+    return settings->priv->preferences->frameFlatteningEnabled();
 }
 
 /**
@@ -1733,12 +1732,10 @@
     g_return_if_fail(WEBKIT_IS_SETTINGS(settings));
 
     WebKitSettingsPrivate* priv = settings->priv;
-    bool currentValue = priv->preferences->frameFlattening() != static_cast<uint32_t>(WebCore::FrameFlattening::Disabled);
-    if (currentValue == enabled)
+    if (priv->preferences->frameFlatteningEnabled() == enabled)
         return;
 
-    // FIXME: Expose more frame flattening values.
-    priv->preferences->setFrameFlattening(enabled ? static_cast<uint32_t>(WebCore::FrameFlattening::FullyEnabled) : static_cast<uint32_t>(WebCore::FrameFlattening::Disabled));
+    priv->preferences->setFrameFlatteningEnabled(enabled);
     g_object_notify(G_OBJECT(settings), "enable-frame-flattening");
 }
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (236496 => 236497)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-09-26 05:16:22 UTC (rev 236496)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-09-26 05:26:30 UTC (rev 236497)
@@ -3155,7 +3155,7 @@
     settings.setSystemLayoutDirection(static_cast<TextDirection>(store.getUInt32ValueForKey(WebPreferencesKey::systemLayoutDirectionKey())));
     settings.setJavaScriptRuntimeFlags(static_cast<RuntimeFlags>(store.getUInt32ValueForKey(WebPreferencesKey::_javascript_RuntimeFlagsKey())));
     settings.setStorageBlockingPolicy(static_cast<SecurityOrigin::StorageBlockingPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey())));
-    settings.setFrameFlattening(static_cast<WebCore::FrameFlattening>(store.getUInt32ValueForKey(WebPreferencesKey::frameFlatteningKey())));
+    settings.setFrameFlattening(store.getBoolValueForKey(WebPreferencesKey::frameFlatteningEnabledKey()) ? WebCore::FrameFlattening::FullyEnabled : WebCore::FrameFlattening::Disabled);
     settings.setEditableLinkBehavior(static_cast<WebCore::EditableLinkBehavior>(store.getUInt32ValueForKey(WebPreferencesKey::editableLinkBehaviorKey())));
 #if ENABLE(DATA_DETECTION)
     settings.setDataDetectorTypes(static_cast<DataDetectorTypes>(store.getUInt32ValueForKey(WebPreferencesKey::dataDetectorTypesKey())));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to