1/*
2 * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#pragma once
27
28#include "EditingBehaviorTypes.h"
29
30namespace WebCore {
31
32// NOTEs
33// 1) EditingMacBehavior comprises Tiger, Leopard, SnowLeopard and iOS builds, as well as QtWebKit when built on Mac;
34// 2) EditingWindowsBehavior comprises Win32 build;
35// 3) EditingUnixBehavior comprises all unix-based systems, but Darwin/MacOS (and then abusing the terminology);
36// 99) MacEditingBehavior is used as a fallback.
37inline EditingBehaviorType editingBehaviorTypeForPlatform()
38{
39#if PLATFORM(IOS_FAMILY)
40 return EditingIOSBehavior;
41#elif OS(DARWIN)
42 return EditingMacBehavior;
43#elif OS(WINDOWS)
44 return EditingWindowsBehavior;
45#elif OS(UNIX)
46 return EditingUnixBehavior;
47#else
48 // Fallback
49 return EditingMacBehavior;
50#endif
51
52}
53
54#if PLATFORM(COCOA)
55static const bool defaultYouTubeFlashPluginReplacementEnabled = true;
56#else
57static const bool defaultYouTubeFlashPluginReplacementEnabled = false;
58#endif
59
60#if PLATFORM(IOS_FAMILY)
61static const bool defaultFixedBackgroundsPaintRelativeToDocument = true;
62static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
63static const bool defaultAllowsInlineMediaPlayback = false;
64static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = true;
65static const bool defaultVideoPlaybackRequiresUserGesture = true;
66static const bool defaultAudioPlaybackRequiresUserGesture = true;
67static const bool defaultMediaDataLoadsAutomatically = false;
68static const bool defaultShouldRespectImageOrientation = true;
69static const bool defaultImageSubsamplingEnabled = true;
70static const bool defaultScrollingTreeIncludesFrames = true;
71static const bool defaultMediaControlsScaleWithPageZoom = true;
72static const bool defaultQuickTimePluginReplacementEnabled = true;
73static const bool defaultRequiresUserGestureToLoadVideo = true;
74#else
75static const bool defaultFixedBackgroundsPaintRelativeToDocument = false;
76static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
77static const bool defaultAllowsInlineMediaPlayback = true;
78static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = false;
79static const bool defaultVideoPlaybackRequiresUserGesture = false;
80static const bool defaultAudioPlaybackRequiresUserGesture = false;
81static const bool defaultMediaDataLoadsAutomatically = true;
82static const bool defaultShouldRespectImageOrientation = false;
83static const bool defaultImageSubsamplingEnabled = false;
84static const bool defaultScrollingTreeIncludesFrames = false;
85static const bool defaultMediaControlsScaleWithPageZoom = true;
86static const bool defaultQuickTimePluginReplacementEnabled = false;
87static const bool defaultRequiresUserGestureToLoadVideo = false;
88#endif
89
90static const bool defaultAllowsPictureInPictureMediaPlayback = true;
91
92static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5;
93#if USE(UNIFIED_TEXT_CHECKING)
94static const bool defaultUnifiedTextCheckerEnabled = true;
95#else
96static const bool defaultUnifiedTextCheckerEnabled = false;
97#endif
98static const bool defaultSmartInsertDeleteEnabled = true;
99static const bool defaultSelectTrailingWhitespaceEnabled = false;
100
101#if ENABLE(VIDEO) && (USE(AVFOUNDATION) || USE(GSTREAMER) || USE(MEDIA_FOUNDATION))
102static const bool defaultMediaEnabled = true;
103#else
104static const bool defaultMediaEnabled = false;
105#endif
106
107#if (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(WATCHOS)
108static const bool defaultConicGradient = true;
109#else
110static const bool defaultConicGradient = false;
111#endif
112
113#if ENABLE(APPLE_PAY_REMOTE_UI)
114static const bool defaultApplePayEnabled = true;
115#else
116static const bool defaultApplePayEnabled = false;
117#endif
118
119}
120