summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/Settings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page/Settings.cpp')
-rw-r--r--Source/WebCore/page/Settings.cpp427
1 files changed, 207 insertions, 220 deletions
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index 681c3a69d..6bb9d03a8 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -33,22 +33,25 @@
#include "DOMTimer.h"
#include "Database.h"
#include "Document.h"
-#include "Font.h"
+#include "FontCascade.h"
#include "FontGenericFamilies.h"
#include "FrameTree.h"
#include "FrameView.h"
#include "HTMLMediaElement.h"
#include "HistoryItem.h"
-#include "InspectorInstrumentation.h"
#include "MainFrame.h"
#include "Page.h"
#include "PageCache.h"
+#include "RuntimeApplicationChecks.h"
#include "StorageMap.h"
-#include "TextAutosizer.h"
#include <limits>
#include <wtf/NeverDestroyed.h>
#include <wtf/StdLibExtras.h>
+#if ENABLE(MEDIA_STREAM)
+#include "MockRealtimeMediaSourceCenter.h"
+#endif
+
namespace WebCore {
static void setImageLoadingSettings(Page* page)
@@ -57,40 +60,41 @@ static void setImageLoadingSettings(Page* page)
return;
for (Frame* frame = &page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
- frame->document()->cachedResourceLoader()->setImagesEnabled(page->settings().areImagesEnabled());
- frame->document()->cachedResourceLoader()->setAutoLoadImages(page->settings().loadsImagesAutomatically());
+ if (!frame->document())
+ continue;
+ frame->document()->cachedResourceLoader().setImagesEnabled(page->settings().areImagesEnabled());
+ frame->document()->cachedResourceLoader().setAutoLoadImages(page->settings().loadsImagesAutomatically());
}
}
static void invalidateAfterGenericFamilyChange(Page* page)
{
- invalidateFontGlyphsCache();
+ invalidateFontCascadeCache();
if (page)
page->setNeedsRecalcStyleInAllFrames();
}
-double Settings::gDefaultMinDOMTimerInterval = 0.010; // 10 milliseconds
-double Settings::gDefaultDOMTimerAlignmentInterval = 0;
-double Settings::gHiddenPageDOMTimerAlignmentInterval = 1.0;
-
-#if USE(SAFARI_THEME)
-bool Settings::gShouldPaintNativeControls = true;
-#endif
-
#if USE(AVFOUNDATION)
-bool Settings::gAVFoundationEnabled = false;
+bool Settings::gAVFoundationEnabled = true;
+bool Settings::gAVFoundationNSURLSessionEnabled = true;
#endif
-#if PLATFORM(MAC)
-bool Settings::gQTKitEnabled = true;
+#if PLATFORM(COCOA)
+bool Settings::gQTKitEnabled = false;
#endif
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-bool Settings::gVideoPluginProxyEnabled = true;
+#if USE(GSTREAMER)
+bool Settings::gGStreamerEnabled = true;
#endif
bool Settings::gMockScrollbarsEnabled = false;
bool Settings::gUsesOverlayScrollbars = false;
+bool Settings::gMockScrollAnimatorEnabled = false;
+
+#if ENABLE(MEDIA_STREAM)
+bool Settings::gMockCaptureDevicesEnabled = false;
+bool Settings::gMediaCaptureRequiresSecureConnection = true;
+#endif
#if PLATFORM(WIN)
bool Settings::gShouldUseHighResolutionTimers = true;
@@ -98,21 +102,27 @@ bool Settings::gShouldUseHighResolutionTimers = true;
bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false;
bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false;
+bool Settings::gResourceLoadStatisticsEnabledEnabled = false;
+bool Settings::gAllowsAnySSLCertificate = false;
#if PLATFORM(IOS)
bool Settings::gNetworkDataUsageTrackingEnabled = false;
bool Settings::gAVKitEnabled = false;
+bool Settings::gShouldOptOutOfNetworkStateObservation = false;
+bool Settings::gManageAudioSession = false;
#endif
// NOTEs
// 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well as QtWebKit when built on Mac;
-// 2) EditingWindowsBehavior comprises Win32 and WinCE builds, as well as QtWebKit and Chromium when built on Windows;
+// 2) EditingWindowsBehavior comprises Win32 build;
// 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS (and then abusing the terminology);
// 99) MacEditingBehavior is used as a fallback.
static EditingBehaviorType editingBehaviorTypeForPlatform()
{
return
-#if OS(DARWIN)
+#if PLATFORM(IOS)
+ EditingIOSBehavior
+#elif OS(DARWIN)
EditingMacBehavior
#elif OS(WINDOWS)
EditingWindowsBehavior
@@ -125,18 +135,46 @@ static EditingBehaviorType editingBehaviorTypeForPlatform()
;
}
+#if PLATFORM(COCOA)
+static const bool defaultYouTubeFlashPluginReplacementEnabled = true;
+#else
+static const bool defaultYouTubeFlashPluginReplacementEnabled = false;
+#endif
+
#if PLATFORM(IOS)
static const bool defaultFixedPositionCreatesStackingContext = true;
-static const bool defaultMediaPlaybackAllowsInline = false;
-static const bool defaultMediaPlaybackRequiresUserGesture = true;
+static const bool defaultFixedBackgroundsPaintRelativeToDocument = true;
+static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
+static const bool defaultAllowsInlineMediaPlayback = false;
+static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = true;
+static const bool defaultVideoPlaybackRequiresUserGesture = true;
+static const bool defaultAudioPlaybackRequiresUserGesture = true;
+static const bool defaultMediaDataLoadsAutomatically = false;
static const bool defaultShouldRespectImageOrientation = true;
+static const bool defaultImageSubsamplingEnabled = true;
+static const bool defaultScrollingTreeIncludesFrames = true;
+static const bool defaultMediaControlsScaleWithPageZoom = true;
+static const bool defaultQuickTimePluginReplacementEnabled = true;
#else
static const bool defaultFixedPositionCreatesStackingContext = false;
-static const bool defaultMediaPlaybackAllowsInline = true;
-static const bool defaultMediaPlaybackRequiresUserGesture = false;
+static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
+static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
+static const bool defaultAllowsInlineMediaPlayback = true;
+static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = false;
+static const bool defaultVideoPlaybackRequiresUserGesture = false;
+static const bool defaultAudioPlaybackRequiresUserGesture = false;
+static const bool defaultMediaDataLoadsAutomatically = true;
static const bool defaultShouldRespectImageOrientation = false;
+static const bool defaultImageSubsamplingEnabled = false;
+static const bool defaultScrollingTreeIncludesFrames = false;
+static const bool defaultMediaControlsScaleWithPageZoom = true;
+static const bool defaultQuickTimePluginReplacementEnabled = false;
#endif
+static const bool defaultRequiresUserGestureToLoadVideo = true;
+
+static const bool defaultAllowsPictureInPictureMediaPlayback = true;
+
static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5;
#if USE(UNIFIED_TEXT_CHECKING)
static const bool defaultUnifiedTextCheckerEnabled = true;
@@ -149,68 +187,40 @@ static const bool defaultSelectTrailingWhitespaceEnabled = false;
// This amount of time must have elapsed before we will even consider scheduling a layout without a delay.
// FIXME: For faster machines this value can really be lowered to 200. 250 is adequate, but a little high
// for dual G5s. :)
-static const auto layoutScheduleThreshold = std::chrono::milliseconds(250);
+static const Seconds layoutScheduleThreshold = 250_ms;
Settings::Settings(Page* page)
- : m_page(0)
+ : m_page(nullptr)
, m_mediaTypeOverride("screen")
, m_fontGenericFamilies(std::make_unique<FontGenericFamilies>())
, m_storageBlockingPolicy(SecurityOrigin::AllowAllStorage)
, m_layoutInterval(layoutScheduleThreshold)
-#if PLATFORM(IOS)
- , m_maxParseDuration(-1)
-#endif
-#if ENABLE(TEXT_AUTOSIZING)
- , m_textAutosizingFontScaleFactor(1)
-#if HACK_FORCE_TEXT_AUTOSIZING_ON_DESKTOP
- , m_textAutosizingWindowSizeOverride(320, 480)
- , m_textAutosizingEnabled(true)
-#else
- , m_textAutosizingEnabled(false)
-#endif
-#endif
+ , m_minimumDOMTimerInterval(DOMTimer::defaultMinimumInterval())
SETTINGS_INITIALIZER_LIST
- , m_screenFontSubstitutionEnabled(shouldEnableScreenFontSubstitutionByDefault())
, m_isJavaEnabled(false)
, m_isJavaEnabledForLocalFiles(true)
, m_loadsImagesAutomatically(false)
- , m_privateBrowsingEnabled(false)
, m_areImagesEnabled(true)
+ , m_preferMIMETypeForImages(false)
, m_arePluginsEnabled(false)
, m_isScriptEnabled(false)
, m_needsAdobeFrameReloadingQuirk(false)
, m_usesPageCache(false)
, m_fontRenderingMode(0)
-#if PLATFORM(IOS)
- , m_standalone(false)
- , m_telephoneNumberParsingEnabled(false)
- , m_mediaDataLoadsAutomatically(false)
- , m_shouldTransformsAffectOverflow(true)
- , m_shouldDispatchJavaScriptWindowOnErrorEvents(false)
- , m_alwaysUseBaselineOfPrimaryFont(false)
- , m_alwaysUseAcceleratedOverflowScroll(false)
-#endif
-#if ENABLE(CSS_STICKY_POSITION)
- , m_cssStickyPositionEnabled(true)
-#endif
, m_showTiledScrollingIndicator(false)
- , m_tiledBackingStoreEnabled(false)
, m_backgroundShouldExtendBeyondPage(false)
, m_dnsPrefetchingEnabled(false)
#if ENABLE(TOUCH_EVENTS)
, m_touchEventEmulationEnabled(false)
#endif
, m_scrollingPerformanceLoggingEnabled(false)
- , m_aggressiveTileRetentionEnabled(false)
, m_timeWithoutMouseMovementBeforeHidingControls(3)
- , m_setImageLoadingSettingsTimer(this, &Settings::imageLoadingSettingsTimerFired)
-#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+ , m_setImageLoadingSettingsTimer(*this, &Settings::imageLoadingSettingsTimerFired)
, m_hiddenPageDOMTimerThrottlingEnabled(false)
-#endif
-#if ENABLE(PAGE_VISIBILITY_API)
, m_hiddenPageCSSAnimationSuspensionEnabled(false)
-#endif
, m_fontFallbackPrefersPictographs(false)
+ , m_webFontsAlwaysFallBack(false)
+ , m_forcePendingWebGLPolicy(false)
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
@@ -223,31 +233,14 @@ Settings::~Settings()
{
}
-PassRefPtr<Settings> Settings::create(Page* page)
+Ref<Settings> Settings::create(Page* page)
{
- return adoptRef(new Settings(page));
+ return adoptRef(*new Settings(page));
}
SETTINGS_SETTER_BODIES
-void Settings::setHiddenPageDOMTimerAlignmentInterval(double hiddenPageDOMTimerAlignmentinterval)
-{
- gHiddenPageDOMTimerAlignmentInterval = hiddenPageDOMTimerAlignmentinterval;
-}
-
-double Settings::hiddenPageDOMTimerAlignmentInterval()
-{
- return gHiddenPageDOMTimerAlignmentInterval;
-}
-
-#if !PLATFORM(MAC)
-bool Settings::shouldEnableScreenFontSubstitutionByDefault()
-{
- return true;
-}
-#endif
-
-#if !PLATFORM(MAC)
+#if !PLATFORM(COCOA)
void Settings::initializeDefaultFontFamilies()
{
// Other platforms can set up fonts from a client, but on Mac, we want it in WebCore to share code between WebKit1 and WebKit2.
@@ -338,41 +331,16 @@ void Settings::setPictographFontFamily(const AtomicString& family, UScriptCode s
invalidateAfterGenericFamilyChange(m_page);
}
-#if ENABLE(TEXT_AUTOSIZING)
-void Settings::setTextAutosizingEnabled(bool textAutosizingEnabled)
-{
- if (m_textAutosizingEnabled == textAutosizingEnabled)
- return;
-
- m_textAutosizingEnabled = textAutosizingEnabled;
- if (m_page)
- m_page->setNeedsRecalcStyleInAllFrames();
-}
-
-void Settings::setTextAutosizingWindowSizeOverride(const IntSize& textAutosizingWindowSizeOverride)
+float Settings::defaultMinimumZoomFontSize()
{
- if (m_textAutosizingWindowSizeOverride == textAutosizingWindowSizeOverride)
- return;
-
- m_textAutosizingWindowSizeOverride = textAutosizingWindowSizeOverride;
- if (m_page)
- m_page->setNeedsRecalcStyleInAllFrames();
+ return 15;
}
-void Settings::setTextAutosizingFontScaleFactor(float fontScaleFactor)
+#if !PLATFORM(IOS)
+bool Settings::defaultTextAutosizingEnabled()
{
- m_textAutosizingFontScaleFactor = fontScaleFactor;
-
- if (!m_page)
- return;
-
- // FIXME: I wonder if this needs to traverse frames like in WebViewImpl::resize, or whether there is only one document per Settings instance?
- for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traverseNext())
- frame->document()->textAutosizer()->recalculateMultipliers();
-
- m_page->setNeedsRecalcStyleInAllFrames();
+ return false;
}
-
#endif
void Settings::setMediaTypeOverride(const String& mediaTypeOverride)
@@ -406,17 +374,15 @@ void Settings::setLoadsImagesAutomatically(bool loadsImagesAutomatically)
m_setImageLoadingSettingsTimer.startOneShot(0);
}
-void Settings::imageLoadingSettingsTimerFired(Timer<Settings>*)
+void Settings::imageLoadingSettingsTimerFired()
{
setImageLoadingSettings(m_page);
}
void Settings::setScriptEnabled(bool isScriptEnabled)
{
-#if PLATFORM(IOS)
if (m_isScriptEnabled == isScriptEnabled)
return;
-#endif
m_isScriptEnabled = isScriptEnabled;
@@ -426,7 +392,6 @@ void Settings::setScriptEnabled(bool isScriptEnabled)
#if PLATFORM(IOS)
m_page->setNeedsRecalcStyleInAllFrames();
#endif
- InspectorInstrumentation::scriptsEnabled(m_page, m_isScriptEnabled);
}
void Settings::setJavaEnabled(bool isJavaEnabled)
@@ -447,23 +412,23 @@ void Settings::setImagesEnabled(bool areImagesEnabled)
m_setImageLoadingSettingsTimer.startOneShot(0);
}
-void Settings::setPluginsEnabled(bool arePluginsEnabled)
+void Settings::setPreferMIMETypeForImages(bool preferMIMETypeForImages)
{
- if (m_arePluginsEnabled == arePluginsEnabled)
- return;
+ m_preferMIMETypeForImages = preferMIMETypeForImages;
+}
- m_arePluginsEnabled = arePluginsEnabled;
- Page::refreshPlugins(false);
+void Settings::setForcePendingWebGLPolicy(bool forced)
+{
+ m_forcePendingWebGLPolicy = forced;
}
-void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
+void Settings::setPluginsEnabled(bool arePluginsEnabled)
{
- if (m_privateBrowsingEnabled == privateBrowsingEnabled)
+ if (m_arePluginsEnabled == arePluginsEnabled)
return;
- m_privateBrowsingEnabled = privateBrowsingEnabled;
- if (m_page)
- m_page->privateBrowsingStateChanged();
+ m_arePluginsEnabled = arePluginsEnabled;
+ Page::refreshPlugins(false);
}
void Settings::setUserStyleSheetLocation(const URL& userStyleSheetLocation)
@@ -484,53 +449,21 @@ void Settings::setNeedsAdobeFrameReloadingQuirk(bool shouldNotReloadIFramesForUn
m_needsAdobeFrameReloadingQuirk = shouldNotReloadIFramesForUnchangedSRC;
}
-void Settings::setDefaultMinDOMTimerInterval(double interval)
-{
- gDefaultMinDOMTimerInterval = interval;
-}
-
-double Settings::defaultMinDOMTimerInterval()
+void Settings::setMinimumDOMTimerInterval(std::chrono::milliseconds interval)
{
- return gDefaultMinDOMTimerInterval;
-}
+ auto oldTimerInterval = m_minimumDOMTimerInterval;
+ m_minimumDOMTimerInterval = interval;
-void Settings::setMinDOMTimerInterval(double interval)
-{
- if (m_page)
- m_page->setMinimumTimerInterval(interval);
-}
-
-double Settings::minDOMTimerInterval()
-{
if (!m_page)
- return 0;
- return m_page->minimumTimerInterval();
-}
-
-void Settings::setDefaultDOMTimerAlignmentInterval(double interval)
-{
- gDefaultDOMTimerAlignmentInterval = interval;
-}
-
-double Settings::defaultDOMTimerAlignmentInterval()
-{
- return gDefaultDOMTimerAlignmentInterval;
-}
-
-void Settings::setDOMTimerAlignmentInterval(double interval)
-{
- if (m_page)
- m_page->setTimerAlignmentInterval(interval);
-}
+ return;
-double Settings::domTimerAlignmentInterval() const
-{
- if (!m_page)
- return 0;
- return m_page->timerAlignmentInterval();
+ for (Frame* frame = &m_page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (frame->document())
+ frame->document()->adjustMinimumTimerInterval(oldTimerInterval);
+ }
}
-void Settings::setLayoutInterval(std::chrono::milliseconds layoutInterval)
+void Settings::setLayoutInterval(Seconds layoutInterval)
{
// FIXME: It seems weird that this function may disregard the specified layout interval.
// We should either expose layoutScheduleThreshold or better communicate this invariant.
@@ -547,29 +480,15 @@ void Settings::setUsesPageCache(bool usesPageCache)
if (!m_page)
return;
- if (!m_usesPageCache) {
- int first = -m_page->backForward().backCount();
- int last = m_page->backForward().forwardCount();
- for (int i = first; i <= last; i++)
- pageCache()->remove(m_page->backForward().itemAtIndex(i));
- }
-}
-
-void Settings::setScreenFontSubstitutionEnabled(bool enabled)
-{
- if (m_screenFontSubstitutionEnabled == enabled)
- return;
- m_screenFontSubstitutionEnabled = enabled;
-
- if (m_page)
- m_page->setNeedsRecalcStyleInAllFrames();
+ if (!m_usesPageCache)
+ PageCache::singleton().pruneToSizeNow(0, PruningReason::None);
}
void Settings::setFontRenderingMode(FontRenderingMode mode)
{
if (fontRenderingMode() == mode)
return;
- m_fontRenderingMode = mode;
+ m_fontRenderingMode = static_cast<int>(mode);
if (m_page)
m_page->setNeedsRecalcStyleInAllFrames();
}
@@ -579,13 +498,6 @@ FontRenderingMode Settings::fontRenderingMode() const
return static_cast<FontRenderingMode>(m_fontRenderingMode);
}
-#if USE(SAFARI_THEME)
-void Settings::setShouldPaintNativeControls(bool shouldPaintNativeControls)
-{
- gShouldPaintNativeControls = shouldPaintNativeControls;
-}
-#endif
-
void Settings::setDNSPrefetchingEnabled(bool dnsPrefetchingEnabled)
{
if (m_dnsPrefetchingEnabled == dnsPrefetchingEnabled)
@@ -604,6 +516,18 @@ void Settings::setShowTiledScrollingIndicator(bool enabled)
m_showTiledScrollingIndicator = enabled;
}
+#if ENABLE(RESOURCE_USAGE)
+void Settings::setResourceUsageOverlayVisible(bool visible)
+{
+ if (m_resourceUsageOverlayVisible == visible)
+ return;
+
+ m_resourceUsageOverlayVisible = visible;
+ if (m_page)
+ m_page->setResourceUsageOverlayVisible(visible);
+}
+#endif
+
#if PLATFORM(WIN)
void Settings::setShouldUseHighResolutionTimers(bool shouldUseHighResolutionTimers)
{
@@ -621,15 +545,6 @@ void Settings::setStorageBlockingPolicy(SecurityOrigin::StorageBlockingPolicy en
m_page->storageBlockingStateChanged();
}
-void Settings::setTiledBackingStoreEnabled(bool enabled)
-{
- m_tiledBackingStoreEnabled = enabled;
-#if USE(TILED_BACKING_STORE)
- if (m_page)
- m_page->mainFrame().setTiledBackingStoreEnabled(enabled);
-#endif
-}
-
void Settings::setBackgroundShouldExtendBeyondPage(bool shouldExtend)
{
if (m_backgroundShouldExtendBeyondPage == shouldExtend)
@@ -637,10 +552,8 @@ void Settings::setBackgroundShouldExtendBeyondPage(bool shouldExtend)
m_backgroundShouldExtendBeyondPage = shouldExtend;
-#if USE(ACCELERATED_COMPOSITING)
if (m_page)
- m_page->mainFrame().view()->setBackgroundExtendsBeyondPage(shouldExtend);
-#endif
+ m_page->mainFrame().view()->updateExtendBackgroundIfNecessary();
}
#if USE(AVFOUNDATION)
@@ -652,9 +565,17 @@ void Settings::setAVFoundationEnabled(bool enabled)
gAVFoundationEnabled = enabled;
HTMLMediaElement::resetMediaEngines();
}
+
+void Settings::setAVFoundationNSURLSessionEnabled(bool enabled)
+{
+ if (gAVFoundationNSURLSessionEnabled == enabled)
+ return;
+
+ gAVFoundationNSURLSessionEnabled = enabled;
+}
#endif
-#if PLATFORM(MAC)
+#if PLATFORM(COCOA)
void Settings::setQTKitEnabled(bool enabled)
{
if (gQTKitEnabled == enabled)
@@ -665,17 +586,40 @@ void Settings::setQTKitEnabled(bool enabled)
}
#endif
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-void Settings::setVideoPluginProxyEnabled(bool enabled)
+#if USE(GSTREAMER)
+void Settings::setGStreamerEnabled(bool enabled)
{
- if (gVideoPluginProxyEnabled == enabled)
+ if (gGStreamerEnabled == enabled)
return;
- gVideoPluginProxyEnabled = enabled;
+ gGStreamerEnabled = enabled;
HTMLMediaElement::resetMediaEngines();
}
#endif
+#if ENABLE(MEDIA_STREAM)
+bool Settings::mockCaptureDevicesEnabled()
+{
+ return gMockCaptureDevicesEnabled;
+}
+
+void Settings::setMockCaptureDevicesEnabled(bool enabled)
+{
+ gMockCaptureDevicesEnabled = enabled;
+ MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled(enabled);
+}
+
+bool Settings::mediaCaptureRequiresSecureConnection() const
+{
+ return gMediaCaptureRequiresSecureConnection;
+}
+
+void Settings::setMediaCaptureRequiresSecureConnection(bool mediaCaptureRequiresSecureConnection)
+{
+ gMediaCaptureRequiresSecureConnection = mediaCaptureRequiresSecureConnection;
+}
+#endif
+
void Settings::setScrollingPerformanceLoggingEnabled(bool enabled)
{
m_scrollingPerformanceLoggingEnabled = enabled;
@@ -683,12 +627,11 @@ void Settings::setScrollingPerformanceLoggingEnabled(bool enabled)
if (m_page && m_page->mainFrame().view())
m_page->mainFrame().view()->setScrollingPerformanceLoggingEnabled(enabled);
}
-
-void Settings::setAggressiveTileRetentionEnabled(bool enabled)
-{
- m_aggressiveTileRetentionEnabled = enabled;
-}
+// It's very important that this setting doesn't change in the middle of a document's lifetime.
+// The Mac port uses this flag when registering and deregistering platform-dependent scrollbar
+// objects. Therefore, if this changes at an unexpected time, deregistration may not happen
+// correctly, which may cause the platform to follow dangling pointers.
void Settings::setMockScrollbarsEnabled(bool flag)
{
gMockScrollbarsEnabled = flag;
@@ -711,6 +654,16 @@ bool Settings::usesOverlayScrollbars()
return gUsesOverlayScrollbars;
}
+void Settings::setUsesMockScrollAnimator(bool flag)
+{
+ gMockScrollAnimatorEnabled = flag;
+}
+
+bool Settings::usesMockScrollAnimator()
+{
+ return gMockScrollAnimatorEnabled;
+}
+
void Settings::setShouldRespectPriorityInCSSAttributeSetters(bool flag)
{
gShouldRespectPriorityInCSSAttributeSetters = flag;
@@ -721,7 +674,6 @@ bool Settings::shouldRespectPriorityInCSSAttributeSetters()
return gShouldRespectPriorityInCSSAttributeSetters;
}
-#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
void Settings::setHiddenPageDOMTimerThrottlingEnabled(bool flag)
{
if (m_hiddenPageDOMTimerThrottlingEnabled == flag)
@@ -730,9 +682,16 @@ void Settings::setHiddenPageDOMTimerThrottlingEnabled(bool flag)
if (m_page)
m_page->hiddenPageDOMTimerThrottlingStateChanged();
}
-#endif
-#if ENABLE(PAGE_VISIBILITY_API)
+void Settings::setHiddenPageDOMTimerThrottlingAutoIncreases(bool flag)
+{
+ if (m_hiddenPageDOMTimerThrottlingAutoIncreases == flag)
+ return;
+ m_hiddenPageDOMTimerThrottlingAutoIncreases = flag;
+ if (m_page)
+ m_page->hiddenPageDOMTimerThrottlingStateChanged();
+}
+
void Settings::setHiddenPageCSSAnimationSuspensionEnabled(bool flag)
{
if (m_hiddenPageCSSAnimationSuspensionEnabled == flag)
@@ -741,7 +700,6 @@ void Settings::setHiddenPageCSSAnimationSuspensionEnabled(bool flag)
if (m_page)
m_page->hiddenPageCSSAnimationSuspensionStateChanged();
}
-#endif
void Settings::setFontFallbackPrefersPictographs(bool preferPictographs)
{
@@ -753,17 +711,25 @@ void Settings::setFontFallbackPrefersPictographs(bool preferPictographs)
m_page->setNeedsRecalcStyleInAllFrames();
}
+void Settings::setWebFontsAlwaysFallBack(bool enable)
+{
+ if (m_webFontsAlwaysFallBack == enable)
+ return;
+
+ m_webFontsAlwaysFallBack = enable;
+}
+
void Settings::setLowPowerVideoAudioBufferSizeEnabled(bool flag)
{
gLowPowerVideoAudioBufferSizeEnabled = flag;
}
-#if PLATFORM(IOS)
-void Settings::setStandalone(bool standalone)
+void Settings::setResourceLoadStatisticsEnabled(bool flag)
{
- m_standalone = standalone;
+ gResourceLoadStatisticsEnabledEnabled = flag;
}
+#if PLATFORM(IOS)
void Settings::setAudioSessionCategoryOverride(unsigned sessionCategory)
{
AudioSession::sharedSession().setCategoryOverride(static_cast<AudioSession::CategoryType>(sessionCategory));
@@ -801,4 +767,25 @@ const String& Settings::networkInterfaceName()
}
#endif
+bool Settings::globalConstRedeclarationShouldThrow()
+{
+#if PLATFORM(MAC)
+ return !MacApplication::isIBooks();
+#elif PLATFORM(IOS)
+ return !IOSApplication::isIBooks();
+#else
+ return true;
+#endif
+}
+
+void Settings::setAllowsAnySSLCertificate(bool allowAnySSLCertificate)
+{
+ gAllowsAnySSLCertificate = allowAnySSLCertificate;
+}
+
+bool Settings::allowsAnySSLCertificate()
+{
+ return gAllowsAnySSLCertificate;
+}
+
} // namespace WebCore