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 | |
30 | namespace 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. |
37 | inline 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) |
55 | static const bool defaultYouTubeFlashPluginReplacementEnabled = true; |
56 | #else |
57 | static const bool defaultYouTubeFlashPluginReplacementEnabled = false; |
58 | #endif |
59 | |
60 | #if PLATFORM(IOS_FAMILY) |
61 | static const bool defaultFixedBackgroundsPaintRelativeToDocument = true; |
62 | static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true; |
63 | static const bool defaultAllowsInlineMediaPlayback = false; |
64 | static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = true; |
65 | static const bool defaultVideoPlaybackRequiresUserGesture = true; |
66 | static const bool defaultAudioPlaybackRequiresUserGesture = true; |
67 | static const bool defaultMediaDataLoadsAutomatically = false; |
68 | static const bool defaultShouldRespectImageOrientation = true; |
69 | static const bool defaultImageSubsamplingEnabled = true; |
70 | static const bool defaultScrollingTreeIncludesFrames = true; |
71 | static const bool defaultMediaControlsScaleWithPageZoom = true; |
72 | static const bool defaultQuickTimePluginReplacementEnabled = true; |
73 | static const bool defaultRequiresUserGestureToLoadVideo = true; |
74 | #else |
75 | static const bool defaultFixedBackgroundsPaintRelativeToDocument = false; |
76 | static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false; |
77 | static const bool defaultAllowsInlineMediaPlayback = true; |
78 | static const bool defaultInlineMediaPlaybackRequiresPlaysInlineAttribute = false; |
79 | static const bool defaultVideoPlaybackRequiresUserGesture = false; |
80 | static const bool defaultAudioPlaybackRequiresUserGesture = false; |
81 | static const bool defaultMediaDataLoadsAutomatically = true; |
82 | static const bool defaultShouldRespectImageOrientation = false; |
83 | static const bool defaultImageSubsamplingEnabled = false; |
84 | static const bool defaultScrollingTreeIncludesFrames = false; |
85 | static const bool defaultMediaControlsScaleWithPageZoom = true; |
86 | static const bool defaultQuickTimePluginReplacementEnabled = false; |
87 | static const bool defaultRequiresUserGestureToLoadVideo = false; |
88 | #endif |
89 | |
90 | static const bool defaultAllowsPictureInPictureMediaPlayback = true; |
91 | |
92 | static const double defaultIncrementalRenderingSuppressionTimeoutInSeconds = 5; |
93 | #if USE(UNIFIED_TEXT_CHECKING) |
94 | static const bool defaultUnifiedTextCheckerEnabled = true; |
95 | #else |
96 | static const bool defaultUnifiedTextCheckerEnabled = false; |
97 | #endif |
98 | static const bool defaultSmartInsertDeleteEnabled = true; |
99 | static const bool defaultSelectTrailingWhitespaceEnabled = false; |
100 | |
101 | #if ENABLE(VIDEO) && (USE(AVFOUNDATION) || USE(GSTREAMER) || USE(MEDIA_FOUNDATION)) |
102 | static const bool defaultMediaEnabled = true; |
103 | #else |
104 | static 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) |
108 | static const bool defaultConicGradient = true; |
109 | #else |
110 | static const bool defaultConicGradient = false; |
111 | #endif |
112 | |
113 | #if ENABLE(APPLE_PAY_REMOTE_UI) |
114 | static const bool defaultApplePayEnabled = true; |
115 | #else |
116 | static const bool defaultApplePayEnabled = false; |
117 | #endif |
118 | |
119 | } |
120 | |