WebPreferencesDefaultValues.cpp [plain text]
#include "config.h"
#include "WebPreferencesDefaultValues.h"
#include <WebCore/RuntimeApplicationChecks.h>
#if PLATFORM(COCOA)
#include <wtf/spi/darwin/dyldSPI.h>
#endif
#if PLATFORM(IOS_FAMILY)
#include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
#include "VersionChecks.h"
#endif
namespace WebKit {
bool defaultPassiveTouchListenersAsDefaultOnDocument()
{
#if PLATFORM(IOS_FAMILY)
return linkedOnOrAfter(WebKit::SDKVersion::FirstThatDefaultsToPassiveTouchListenersOnDocument);
#else
return true;
#endif
}
bool defaultCSSOMViewScrollingAPIEnabled()
{
#if PLATFORM(IOS_FAMILY)
if (WebCore::IOSApplication::isIMDb() && applicationSDKVersion() < DYLD_IOS_VERSION_13_0)
return false;
#endif
return true;
}
#if ENABLE(TEXT_AUTOSIZING) && !PLATFORM(IOS_FAMILY)
bool defaultTextAutosizingUsesIdempotentMode()
{
return false;
}
#endif // ENABLE(TEXT_AUTOSIZING) && !PLATFORM(IOS_FAMILY)
bool defaultDisallowSyncXHRDuringPageDismissalEnabled()
{
#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
if (CFPreferencesGetAppBooleanValue(CFSTR("allowDeprecatedSynchronousXMLHttpRequestDuringUnload"), CFSTR("com.apple.WebKit"), nullptr)) {
WTFLogAlways("Allowing synchronous XHR during page unload due to managed preference");
return false;
}
#elif PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
if (allowsDeprecatedSynchronousXMLHttpRequestDuringUnload()) {
WTFLogAlways("Allowing synchronous XHR during page unload due to managed preference");
return false;
}
#endif
return true;
}
}