1 # Copyright (C) 2012 Google Inc. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
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.
13 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 # A module to contain all the enable/disable feature option code.
31 use lib $FindBin::Bin;
36 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
39 @EXPORT = qw(&getFeatureOptionList);
45 $threeDRenderingSupport,
46 $accelerated2DCanvasSupport,
48 $batteryStatusSupport,
50 $channelMessagingSupport,
52 $cssExclusionsSupport,
54 $cssImageResolutionSupport,
58 $dataTransferItemsSupport,
61 $deviceOrientationSupport,
62 $directoryUploadSupport,
63 $downloadAttributeSupport,
68 $fullscreenAPISupport,
71 $highDPICanvasSupport,
73 $iframeSeamlessSupport,
75 $indexedDatabaseSupport,
77 $inputTypeColorSupport,
78 $inputTypeDateSupport,
79 $inputTypeDatetimeSupport,
80 $inputTypeDatetimelocalSupport,
81 $inputTypeMonthSupport,
82 $inputTypeTimeSupport,
83 $inputTypeWeekSupport,
85 $javascriptDebuggerSupport,
86 $legacyNotificationsSupport,
87 $legacyWebKitBlobBuilderSupport,
89 $linkPrerenderSupport,
93 $mediaStatisticsSupport,
98 $mutationObserversSupport,
99 $netscapePluginAPISupport,
101 $notificationsSupport,
102 $orientationEventsSupport,
103 $pageVisibilityAPISupport,
106 $registerProtocolHandlerSupport,
107 $requestAnimationFrameSupport,
108 $scriptedSpeechSupport,
110 $sharedWorkersSupport,
113 $svgDOMObjCBindingsSupport,
116 $systemMallocSupport,
117 $tiledBackingStoreSupport,
119 $touchIconLoadingSupport,
132 { option => "3d-rendering", desc => "Toggle 3D Rendering support",
133 define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() || isQt()), value => \$threeDRenderingSupport },
135 { option => "accelerated-2d-canvas", desc => "Toggle Accelerated 2D Canvas support",
136 define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2DCanvasSupport },
138 { option => "animation-api", desc => "Toggle Animation API support",
139 define => "ENABLE_ANIMATION_API", default => isBlackBerry(), value => \$animationAPISupport },
141 { option => "battery-status", desc => "Toggle Battery Status support",
142 define => "ENABLE_BATTERY_STATUS", default => (isEfl() || isBlackBerry()), value => \$batteryStatusSupport },
144 { option => "blob", desc => "Toggle Blob support",
145 define => "ENABLE_BLOB", default => (isAppleMacWebKit() || isGtk() || isChromium() || isBlackBerry() || isEfl()), value => \$blobSupport },
147 { option => "channel-messaging", desc => "Toggle Channel Messaging support",
148 define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
150 { option => "css-exclusions", desc => "Toggle CSS Exclusions support",
151 define => "ENABLE_CSS_EXCLUSIONS", default => 1, value => \$cssExclusionsSupport },
153 { option => "css-filters", desc => "Toggle CSS Filters support",
154 define => "ENABLE_CSS_FILTERS", default => isAppleWebKit(), value => \$cssFiltersSupport },
156 { option => "css3-flexbox", desc => "Toggle CSS3 Flexbox support",
157 define => "ENABLE_CSS3_FLEXBOX", default => 1, value => \$css3FlexboxSupport },
159 { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
160 define => "ENABLE_CSS_IMAGE_RESOLUTION", default => 0, value => \$cssImageResolutionSupport },
162 { option => "css-regions", desc => "Toggle CSS Regions support",
163 define => "ENABLE_CSS_REGIONS", default => 1, value => \$cssRegionsSupport },
165 { option => "css-shaders", desc => "Toggle CSS Shaders support",
166 define => "ENABLE_CSS_SHADERS", default => 0, value => \$cssShadersSupport },
168 { option => "css-variables", desc => "Toggle CSS Variable support",
169 define => "ENABLE_CSS_VARIABLES", default => 0, value => \$cssVariablesSupport },
171 { option => "datalist", desc => "Toggle Datalist support",
172 define => "ENABLE_DATALIST", default => 0, value => \$datalistSupport },
174 { option => "data-transfer-items", desc => "Toggle Data Transfer Items support",
175 define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport },
177 { option => "details", desc => "Toggle Details support",
178 define => "ENABLE_DETAILS", default => 1, value => \$detailsSupport },
180 { option => "device-orientation", desc => "Toggle Device Orientation support",
181 define => "ENABLE_DEVICE_ORIENTATION", default => isBlackBerry(), value => \$deviceOrientationSupport },
183 { option => "directory-upload", desc => "Toogle Directory Upload support",
184 define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport },
186 { option => "download-attribute", desc => "Toggle Download Attribute support",
187 define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => isBlackBerry(), value => \$downloadAttributeSupport },
189 { option => "file-system", desc => "Toggle File System support",
190 define => "ENABLE_FILE_SYSTEM", default => isBlackBerry(), value => \$fileSystemSupport },
192 { option => "filters", desc => "Toggle Filters support",
193 define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl() || isBlackBerry()), value => \$filtersSupport },
195 { option => "font-boosting", desc => "Toggle Font Boosting support",
196 define => "ENABLE_FONT_BOOSTING", default => 0, value => \$fontBoostingSupport },
198 { option => "ftpdir", desc => "Toggle FTP Directory support",
199 define => "ENABLE_FTPDIR", default => !isWinCE(), value => \$ftpDirSupport },
201 { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
202 define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isEfl() || isGtk() || isBlackBerry() || isQt()), value => \$fullscreenAPISupport },
204 { option => "gamepad", desc => "Toggle Gamepad support",
205 define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },
207 { option => "geolocation", desc => "Toggle Geolocation support",
208 define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$geolocationSupport },
210 { option => "high-dpi-canvas", desc => "Toggle High DPI Canvas support",
211 define => "ENABLE_HIGH_DPI_CANVAS", default => (isAppleWebKit()), value => \$highDPICanvasSupport },
213 { option => "icon-database", desc => "Toggle Icondatabase support",
214 define => "ENABLE_ICONDATABASE", default => 1, value => \$icondatabaseSupport },
216 { option => "iframe-seamless", desc => "Toggle iframe seamless attribute support",
217 define => "ENABLE_IFRAME_SEAMLESS", default => 1, value => \$iframeSeamlessSupport },
219 { option => "indexed-database", desc => "Toggle Indexed Database support",
220 define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
222 { option => "input-speech", desc => "Toggle Input Speech support",
223 define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
225 { option => "input-type-color", desc => "Toggle Input Type Color support",
226 define => "ENABLE_INPUT_TYPE_COLOR", default => (isBlackBerry() || isEfl()), value => \$inputTypeColorSupport },
228 { option => "input-type-date", desc => "Toggle Input Type Date support",
229 define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport },
231 { option => "input-type-datetime", desc => "Toggle Input Type Datetime support",
232 define => "ENABLE_INPUT_TYPE_DATETIME", default => 0, value => \$inputTypeDatetimeSupport },
234 { option => "input-type-datetimelocal", desc => "Toggle Input Type Datetimelocal support",
235 define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport },
237 { option => "input-type-month", desc => "Toggle Input Type Month support",
238 define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport },
240 { option => "input-type-time", desc => "Toggle Input Type Time support",
241 define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport },
243 { option => "input-type-week", desc => "Toggle Input Type Week support",
244 define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
246 { option => "inspector", desc => "Toggle Inspector support",
247 define => "ENABLE_INSPECTOR", default => !isWinCE(), value => \$inspectorSupport },
249 { option => "javascript-debugger", desc => "Toggle JavaScript Debugger support",
250 define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javascriptDebuggerSupport },
252 { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
253 define => "ENABLE_LEGACY_NOTIFICATIONS", default => isBlackBerry(), value => \$legacyNotificationsSupport },
255 { option => "legacy-webkit-blob-builder", desc => "Toggle Legacy WebKit Blob Builder support",
256 define => "ENABLE_LEGACY_WEBKIT_BLOB_BUILDER", default => (isGtk() || isChromium() || isBlackBerry()), value => \$legacyWebKitBlobBuilderSupport },
258 { option => "link-prefetch", desc => "Toggle Link Prefetch support",
259 define => "ENABLE_LINK_PREFETCH", default => 0, value => \$linkPrefetchSupport },
261 { option => "link-prerender", desc => "Toggle Link Prerender support",
262 define => "ENABLE_LINK_PRERENDER", default => 0, value => \$linkPrerenderSupport },
264 { option => "mathml", desc => "Toggle MathML support",
265 define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
267 { option => "media-capture", desc => "Toggle Media Capture support",
268 define => "ENABLE_MEDIA_CAPTURE", default => isEfl(), value => \$mediaCaptureSupport },
270 { option => "media-source", desc => "Toggle Media Source support",
271 define => "ENABLE_MEDIA_SOURCE", default => 0, value => \$mediaSourceSupport },
273 { option => "media-statistics", desc => "Toggle Media Statistics support",
274 define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
276 { option => "media-stream", desc => "Toggle Media Stream support",
277 define => "ENABLE_MEDIA_STREAM", default => (isChromium() || isGtk()), value => \$mediaStreamSupport },
279 { option => "meter-tag", desc => "Toggle Meter Tag support",
280 define => "ENABLE_METER_TAG", default => !isAppleWinWebKit(), value => \$meterTagSupport },
282 { option => "mhtml", desc => "Toggle MHTML support",
283 define => "ENABLE_MHTML", default => 0, value => \$mhtmlSupport },
285 { option => "microdata", desc => "Toggle Microdata support",
286 define => "ENABLE_MICRODATA", default => 0, value => \$microdataSupport },
288 { option => "mutation-observers", desc => "Toggle Mutation Observers support",
289 define => "ENABLE_MUTATION_OBSERVERS", default => 1, value => \$mutationObserversSupport },
291 { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
292 define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isEfl(), value => \$netscapePluginAPISupport },
294 { option => "network-info", desc => "Toggle Network Info support",
295 define => "ENABLE_NETWORK_INFO", default => isEfl(), value => \$networkInfoSupport },
297 { option => "notifications", desc => "Toggle Notifications support",
298 define => "ENABLE_NOTIFICATIONS", default => isBlackBerry(), value => \$notificationsSupport },
300 { option => "orientation-events", desc => "Toggle Orientation Events support",
301 define => "ENABLE_ORIENTATION_EVENTS", default => isBlackBerry(), value => \$orientationEventsSupport },
303 { option => "page-visibility-api", desc => "Toggle Page Visibility API support",
304 define => "ENABLE_PAGE_VISIBILITY_API", default => (isBlackBerry() || isEfl()), value => \$pageVisibilityAPISupport },
306 { option => "progress-tag", desc => "Toggle Progress Tag support",
307 define => "ENABLE_PROGRESS_TAG", default => 1, value => \$progressTagSupport },
309 { option => "quota", desc => "Toggle Quota support",
310 define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport },
312 { option => "register-protocol-handler", desc => "Toggle Register Protocol Handler support",
313 define => "ENABLE_REGISTER_PROTOCOL_HANDLER", default => isEfl(), value => \$registerProtocolHandlerSupport },
315 { option => "request-animation-frame", desc => "Toggle Request Animation Frame support",
316 define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isEfl() || isBlackBerry()), value => \$requestAnimationFrameSupport },
318 { option => "scripted-speech", desc => "Toggle Scripted Speech support",
319 define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
321 { option => "shadow-dom", desc => "Toggle Shadow DOM support",
322 define => "ENABLE_SHADOW_DOM", default => isGtk(), value => \$shadowDOMSupport },
324 { option => "shared-workers", desc => "Toggle Shared Workers support",
325 define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$sharedWorkersSupport },
327 { option => "sql-database", desc => "Toggle SQL Database support",
328 define => "ENABLE_SQL_DATABASE", default => 1, value => \$sqlDatabaseSupport },
330 { option => "style-scoped", desc => "Toggle Style Scoped support",
331 define => "ENABLE_STYLE_SCOPED", default => 0, value => \$styleScopedSupport },
333 { option => "svg", desc => "Toggle SVG support",
334 define => "ENABLE_SVG", default => 1, value => \$svgSupport },
336 { option => "svg-dom-objc-bindings", desc => "Toggle SVG DOM ObjC Bindings support",
337 define => "ENABLE_SVG_DOM_OBJC_BINDINGS", default => isAppleMacWebKit(), value => \$svgDOMObjCBindingsSupport },
339 { option => "svg-fonts", desc => "Toggle SVG Fonts support",
340 define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport },
342 { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
343 define => "USE_SYSTEM_MALLOC", default => isWinCE(), value => \$systemMallocSupport },
345 { option => "tiled-backing-store", desc => "Toggle Tiled Backing Store support",
346 define => "WTF_USE_TILED_BACKING_STORE", default => isQt(), value => \$tiledBackingStoreSupport },
348 { option => "touch-events", desc => "Toggle Touch Events support",
349 define => "ENABLE_TOUCH_EVENTS", default => (isQt() || isBlackBerry() || isEfl()), value => \$touchEventsSupport },
351 { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
352 define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
354 { option => "vibration", desc => "Toggle Vibration support",
355 define => "ENABLE_VIBRATION", default => (isEfl() || isBlackBerry()), value => \$vibrationSupport },
357 { option => "video", desc => "Toggle Video support",
358 define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$videoSupport },
360 { option => "video-track", desc => "Toggle Video Track support",
361 define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoTrackSupport },
363 { option => "webgl", desc => "Toggle WebGL support",
364 define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isGtk()), value => \$webglSupport },
366 { option => "web-audio", desc => "Toggle Web Audio support",
367 define => "ENABLE_WEB_AUDIO", default => 0, value => \$webAudioSupport },
369 { option => "web-sockets", desc => "Toggle Web Sockets support",
370 define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },
372 { option => "web-timing", desc => "Toggle Web Timing support",
373 define => "ENABLE_WEB_TIMING", default => (isBlackBerry() || isGtk() || isEfl()), value => \$webTimingSupport },
375 { option => "workers", desc => "Toggle Workers support",
376 define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$workersSupport },
378 { option => "xslt", desc => "Toggle XSLT support",
379 define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
382 sub getFeatureOptionList()