Title: [205214] trunk/Source/WebCore
Revision
205214
Author
[email protected]
Date
2016-08-30 18:28:35 -0700 (Tue, 30 Aug 2016)

Log Message

"pluginReplacementEnabled" should be a Setting, not a RuntimeEnabledFeature
https://bugs.webkit.org/show_bug.cgi?id=161416
<rdar://problem/28050847>

Patch by Ricky Mondello <[email protected]> on 2016-08-30
Reviewed by Simon Fraser.

Mostly mechanical. Tested by running LayoutTests/plugins/quicktime-plugin-replacement.html and manually toggling
defaultPluginReplacementEnabled and observing a behavior change.

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::reset): Purged of the pluginReplacementEnabled setting.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled): Deleted.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::requestObject): Use the setting.
* page/Settings.cpp: Supply different values for iOS and other platforms, matching the RuntimeEnabledFeature values,
    enabled for iOS and disabled otherwise.
* page/Settings.in: Declare the setting.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Use the setting.
(WebCore::InternalSettings::Backup::restoreTo): Ditto.
(WebCore::InternalSettings::setPluginReplacementEnabled): Ditto.
* testing/InternalSettings.h: Can now throw an exception, like other Settings-backed members.
* testing/InternalSettings.idl: Declare this as possibly throwing an exception.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205213 => 205214)


--- trunk/Source/WebCore/ChangeLog	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/ChangeLog	2016-08-31 01:28:35 UTC (rev 205214)
@@ -1,5 +1,33 @@
 2016-08-30  Ricky Mondello  <[email protected]>
 
+        "pluginReplacementEnabled" should be a Setting, not a RuntimeEnabledFeature
+        https://bugs.webkit.org/show_bug.cgi?id=161416
+        <rdar://problem/28050847>
+
+        Reviewed by Simon Fraser.
+
+        Mostly mechanical. Tested by running LayoutTests/plugins/quicktime-plugin-replacement.html and manually toggling
+        defaultPluginReplacementEnabled and observing a behavior change.
+
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        (WebCore::RuntimeEnabledFeatures::reset): Purged of the pluginReplacementEnabled setting.
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled): Deleted.
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::requestObject): Use the setting.
+        * page/Settings.cpp: Supply different values for iOS and other platforms, matching the RuntimeEnabledFeature values,
+            enabled for iOS and disabled otherwise.
+        * page/Settings.in: Declare the setting.
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::Backup::Backup): Use the setting.
+        (WebCore::InternalSettings::Backup::restoreTo): Ditto.
+        (WebCore::InternalSettings::setPluginReplacementEnabled): Ditto.
+        * testing/InternalSettings.h: Can now throw an exception, like other Settings-backed members.
+        * testing/InternalSettings.idl: Declare this as possibly throwing an exception.
+
+2016-08-30  Ricky Mondello  <[email protected]>
+
         YouTubePluginReplacementTest's URL transformation logic should have tests
         https://bugs.webkit.org/show_bug.cgi?id=161406
         <rdar://problem/28050847>

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp (205213 => 205214)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp	2016-08-31 01:28:35 UTC (rev 205214)
@@ -57,11 +57,6 @@
     m_isDeviceOrientationEnabled = true;
     m_isLinkPreloadEnabled = false;
     m_isLangAttributeAwareFormControlUIEnabled = false;
-#if PLATFORM(IOS)
-    m_isPluginReplacementEnabled = true;
-#else
-    m_isPluginReplacementEnabled = false;
-#endif
     m_isResourceTimingEnabled = false;
 #if ENABLE(INDEXED_DATABASE)
     m_isIndexedDBEnabled = true;

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (205213 => 205214)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2016-08-31 01:28:35 UTC (rev 205214)
@@ -177,9 +177,6 @@
     // The lang attribute support is incomplete and should only be turned on for tests.
     void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { m_isLangAttributeAwareFormControlUIEnabled = isEnabled; }
 
-    void setPluginReplacementEnabled(bool isEnabled) { m_isPluginReplacementEnabled = isEnabled; }
-    bool pluginReplacementEnabled() const { return m_isPluginReplacementEnabled; }
-
     void setResourceTimingEnabled(bool isEnabled) { m_isResourceTimingEnabled = isEnabled; }
     bool resourceTimingEnabled() const { return m_isResourceTimingEnabled; }
 
@@ -246,7 +243,6 @@
     bool m_isDeviceOrientationEnabled;
     bool m_isLinkPreloadEnabled;
     bool m_isLangAttributeAwareFormControlUIEnabled;
-    bool m_isPluginReplacementEnabled;
     bool m_isResourceTimingEnabled;
 
 #if ENABLE(INDEXED_DATABASE)

Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (205213 => 205214)


--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp	2016-08-31 01:28:35 UTC (rev 205214)
@@ -374,7 +374,7 @@
 
 bool HTMLPlugInElement::requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
 {
-    if (!RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
+    if (!document().settings()->pluginReplacementEnabled())
         return false;
 
     if (m_pluginReplacement)

Modified: trunk/Source/WebCore/page/Settings.cpp (205213 => 205214)


--- trunk/Source/WebCore/page/Settings.cpp	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/page/Settings.cpp	2016-08-31 01:28:35 UTC (rev 205214)
@@ -145,6 +145,7 @@
 static const bool defaultImageSubsamplingEnabled = true;
 static const bool defaultScrollingTreeIncludesFrames = true;
 static const bool defaultMediaControlsScaleWithPageZoom = true;
+static const bool defaultPluginReplacementEnabled = true;
 #else
 static const bool defaultFixedPositionCreatesStackingContext = false;
 static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
@@ -158,6 +159,7 @@
 static const bool defaultImageSubsamplingEnabled = false;
 static const bool defaultScrollingTreeIncludesFrames = false;
 static const bool defaultMediaControlsScaleWithPageZoom = true;
+static const bool defaultPluginReplacementEnabled = false;
 #endif
 
 static const bool defaultAllowsPictureInPictureMediaPlayback = true;

Modified: trunk/Source/WebCore/page/Settings.in (205213 => 205214)


--- trunk/Source/WebCore/page/Settings.in	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/page/Settings.in	2016-08-31 01:28:35 UTC (rev 205214)
@@ -279,3 +279,5 @@
 
 # Runtime-enabled features
 visualViewportEnabled initial=false
+
+pluginReplacementEnabled initial=defaultPluginReplacementEnabled

Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (205213 => 205214)


--- trunk/Source/WebCore/testing/InternalSettings.cpp	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp	2016-08-31 01:28:35 UTC (rev 205214)
@@ -91,7 +91,7 @@
     , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
     , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
     , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
-    , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
+    , m_pluginReplacementEnabled(settings.pluginReplacementEnabled())
     , m_shouldConvertPositionStyleOnCopy(settings.shouldConvertPositionStyleOnCopy())
     , m_fontFallbackPrefersPictographs(settings.fontFallbackPrefersPictographs())
     , m_webFontsAlwaysFallBack(settings.webFontsAlwaysFallBack())
@@ -183,7 +183,7 @@
     settings.setAllowsInlineMediaPlayback(m_allowsInlineMediaPlayback);
     settings.setAllowsInlineMediaPlaybackAfterFullscreen(m_allowsInlineMediaPlaybackAfterFullscreen);
     settings.setInlineMediaPlaybackRequiresPlaysInlineAttribute(m_inlineMediaPlaybackRequiresPlaysInlineAttribute);
-    RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
+    settings.setPluginReplacementEnabled(m_pluginReplacementEnabled);
 #if ENABLE(INDEXED_DATABASE_IN_WORKERS)
     RuntimeEnabledFeatures::sharedFeatures().setIndexedDBWorkersEnabled(m_indexedDBWorkersEnabled);
 #endif
@@ -548,9 +548,10 @@
     settings()->setWebFontsAlwaysFallBack(enable);
 }
 
-void InternalSettings::setPluginReplacementEnabled(bool enabled)
+void InternalSettings::setPluginReplacementEnabled(bool enabled, ExceptionCode& ec)
 {
-    RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(enabled);
+    InternalSettingsGuardForSettings();
+    settings()->setPluginReplacementEnabled(enabled);
 }
 
 void InternalSettings::setBackgroundShouldExtendBeyondPage(bool hasExtendedBackground, ExceptionCode& ec)

Modified: trunk/Source/WebCore/testing/InternalSettings.h (205213 => 205214)


--- trunk/Source/WebCore/testing/InternalSettings.h	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/testing/InternalSettings.h	2016-08-31 01:28:35 UTC (rev 205214)
@@ -156,7 +156,7 @@
     void setAutoscrollForDragAndDropEnabled(bool, ExceptionCode&);
     void setFontFallbackPrefersPictographs(bool, ExceptionCode&);
     void setWebFontsAlwaysFallBack(bool, ExceptionCode&);
-    void setPluginReplacementEnabled(bool);
+    void setPluginReplacementEnabled(bool, ExceptionCode&);
     void setBackgroundShouldExtendBeyondPage(bool, ExceptionCode&);
     void setShouldConvertPositionStyleOnCopy(bool, ExceptionCode&);
     void setScrollingTreeIncludesFrames(bool, ExceptionCode&);

Modified: trunk/Source/WebCore/testing/InternalSettings.idl (205213 => 205214)


--- trunk/Source/WebCore/testing/InternalSettings.idl	2016-08-31 00:37:59 UTC (rev 205213)
+++ trunk/Source/WebCore/testing/InternalSettings.idl	2016-08-31 01:28:35 UTC (rev 205214)
@@ -57,7 +57,7 @@
 
     [RaisesException] void setForcePendingWebGLPolicy(boolean forced);
 
-    void setPluginReplacementEnabled(boolean enabled);
+    [RaisesException] void setPluginReplacementEnabled(boolean enabled);
 
     // Editing, forms
     [RaisesException] void setEditingBehavior(DOMString behavior);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to