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,
47 $batteryStatusSupport,
50 $channelMessagingSupport,
53 $css3ConditionalRulesSupport,
55 $css3TextLineBreakSupport,
57 $cssBoxDecorationBreakSupport,
59 $cssGridLayoutSupport,
60 $cssImageOrientationSupport,
61 $cssImageResolutionSupport,
65 $cssCompositingSupport,
66 $customSchemeHandlerSupport,
67 $dataTransferItemsSupport,
68 $datalistElementSupport,
69 $detailsElementSupport,
70 $deviceOrientationSupport,
71 $directoryUploadSupport,
72 $dom4EventsConstructor,
73 $downloadAttributeSupport,
74 $fontLoadEventsSupport,
76 $fullscreenAPISupport,
79 $highDPICanvasSupport,
81 $indexedDatabaseSupport,
83 $inputTypeColorSupport,
84 $inputTypeDateSupport,
85 $inputTypeDatetimeSupport,
86 $inputTypeDatetimelocalSupport,
87 $inputTypeMonthSupport,
88 $inputTypeTimeSupport,
89 $inputTypeWeekSupport,
90 $legacyNotificationsSupport,
91 $legacyVendorPrefixSupport,
92 $legacyWebAudioSupport,
94 $linkPrerenderSupport,
98 $mediaStatisticsSupport,
100 $meterElementSupport,
102 $mouseCursorScaleSupport,
103 $netscapePluginAPISupport,
106 $notificationsSupport,
107 $orientationEventsSupport,
108 $pageVisibilityAPISupport,
109 $performanceTimelineSupport,
110 $pictureSizesSupport,
112 $proximityEventsSupport,
114 $resolutionMediaQuerySupport,
115 $registerProtocolHandlerSupport,
116 $requestAnimationFrameSupport,
117 $resourceTimingSupport,
118 $scriptedSpeechSupport,
119 $seccompFiltersSupport,
124 $svgDOMObjCBindingsSupport,
127 $systemMallocSupport,
128 $templateElementSupport,
129 $textAutosizingSupport,
130 $threadedCompositorSupport,
131 $threadedHTMLParserSupport,
134 $touchIconLoadingSupport,
151 { option => "3d-rendering", desc => "Toggle 3D Rendering support",
152 define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$threeDRenderingSupport },
154 { option => "accelerated-2d-canvas", desc => "Toggle Accelerated 2D Canvas support",
155 define => "ENABLE_ACCELERATED_2D_CANVAS", default => isGtk(), value => \$accelerated2DCanvasSupport },
157 { option => "battery-status", desc => "Toggle Battery Status support",
158 define => "ENABLE_BATTERY_STATUS", default => isEfl(), value => \$batteryStatusSupport },
160 { option => "canvas-path", desc => "Toggle Canvas Path support",
161 define => "ENABLE_CANVAS_PATH", default => 1, value => \$canvasPathSupport },
163 { option => "canvas-proxy", desc => "Toggle CanvasProxy support",
164 define => "ENABLE_CANVAS_PROXY", default => 0, value => \$canvasProxySupport },
166 { option => "channel-messaging", desc => "Toggle Channel Messaging support",
167 define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
169 { option => "class-syntax", desc => "Toggle ES6 class syntax support",
170 define => "ENABLE_ES6_CLASS_SYNTAX", default => 1, value => \$classSyntax },
172 { option => "csp-next", desc => "Toggle Content Security Policy 1.1 support",
173 define => "ENABLE_CSP_NEXT", default => isGtk(), value => \$cspNextSupport },
175 { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support",
176 define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation },
178 { option => "css-shapes", desc => "Toggle CSS Shapes support",
179 define => "ENABLE_CSS_SHAPES", default => 1, value => \$cssShapesSupport },
181 { option => "css-grid-layout", desc => "Toggle CSS Grid Layout support",
182 define => "ENABLE_CSS_GRID_LAYOUT", default => 1, value => \$cssGridLayoutSupport },
184 { option => "css3-conditional-rules", desc => "Toggle CSS3 Conditional Rules support (i.e. \@supports)",
185 define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 1, value => \$css3ConditionalRulesSupport },
187 { option => "css3-text", desc => "Toggle CSS3 Text support",
188 define => "ENABLE_CSS3_TEXT", default => (isEfl() || isGtk()), value => \$css3TextSupport },
190 { option => "css3-text-line-break", desc => "Toggle CSS3 Text Line Break support",
191 define => "ENABLE_CSS3_TEXT_LINE_BREAK", default => 0, value => \$css3TextLineBreakSupport },
193 { option => "css-box-decoration-break", desc => "Toggle CSS box-decoration-break support",
194 define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
196 { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
197 define => "ENABLE_CSS_IMAGE_ORIENTATION", default => (isEfl() || isGtk()), value => \$cssImageOrientationSupport },
199 { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
200 define => "ENABLE_CSS_IMAGE_RESOLUTION", default => isGtk(), value => \$cssImageResolutionSupport },
202 { option => "css-image-set", desc => "Toggle CSS image-set support",
203 define => "ENABLE_CSS_IMAGE_SET", default => (isEfl() || isGtk()), value => \$cssImageSetSupport },
205 { option => "css-regions", desc => "Toggle CSS Regions support",
206 define => "ENABLE_CSS_REGIONS", default => 1, value => \$cssRegionsSupport },
208 { option => "css-compositing", desc => "Toggle CSS Compositing support",
209 define => "ENABLE_CSS_COMPOSITING", default => isAppleWebKit(), value => \$cssCompositingSupport },
211 { option => "custom-scheme-handler", desc => "Toggle Custom Scheme Handler support",
212 define => "ENABLE_CUSTOM_SCHEME_HANDLER", default => isEfl(), value => \$customSchemeHandlerSupport },
214 { option => "datalist-element", desc => "Toggle Datalist Element support",
215 define => "ENABLE_DATALIST_ELEMENT", default => isEfl(), value => \$datalistElementSupport },
217 { option => "data-transfer-items", desc => "Toggle Data Transfer Items support",
218 define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport },
220 { option => "details-element", desc => "Toggle Details Element support",
221 define => "ENABLE_DETAILS_ELEMENT", default => 1, value => \$detailsElementSupport },
223 { option => "device-orientation", desc => "Toggle Device Orientation support",
224 define => "ENABLE_DEVICE_ORIENTATION", default => isIOSWebKit(), value => \$deviceOrientationSupport },
226 { option => "dom4-events-constructor", desc => "Expose DOM4 Events constructors",
227 define => "ENABLE_DOM4_EVENTS_CONSTRUCTOR", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$dom4EventsConstructor },
229 { option => "download-attribute", desc => "Toggle Download Attribute support",
230 define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => isEfl(), value => \$downloadAttributeSupport },
232 { option => "font-load-events", desc => "Toggle Font Load Events support",
233 define => "ENABLE_FONT_LOAD_EVENTS", default => 0, value => \$fontLoadEventsSupport },
235 { option => "ftpdir", desc => "Toggle FTP Directory support",
236 define => "ENABLE_FTPDIR", default => 1, value => \$ftpDirSupport },
238 { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
239 define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isEfl() || isGtk()), value => \$fullscreenAPISupport },
241 { option => "gamepad", desc => "Toggle Gamepad support",
242 define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },
244 { option => "geolocation", desc => "Toggle Geolocation support",
245 define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$geolocationSupport },
247 { option => "high-dpi-canvas", desc => "Toggle High DPI Canvas support",
248 define => "ENABLE_HIGH_DPI_CANVAS", default => (isAppleWebKit()), value => \$highDPICanvasSupport },
250 { option => "icon-database", desc => "Toggle Icondatabase support",
251 define => "ENABLE_ICONDATABASE", default => !isIOSWebKit(), value => \$icondatabaseSupport },
253 { option => "indexed-database", desc => "Toggle Indexed Database support",
254 define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
256 { option => "input-speech", desc => "Toggle Input Speech support",
257 define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
259 { option => "input-type-color", desc => "Toggle Input Type Color support",
260 define => "ENABLE_INPUT_TYPE_COLOR", default => (isEfl() || isGtk()), value => \$inputTypeColorSupport },
262 { option => "input-type-date", desc => "Toggle Input Type Date support",
263 define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport },
265 { option => "input-type-datetime", desc => "Toggle broken Input Type Datetime support",
266 define => "ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE", default => 0, value => \$inputTypeDatetimeSupport },
268 { option => "input-type-datetimelocal", desc => "Toggle Input Type Datetimelocal support",
269 define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport },
271 { option => "input-type-month", desc => "Toggle Input Type Month support",
272 define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport },
274 { option => "input-type-time", desc => "Toggle Input Type Time support",
275 define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport },
277 { option => "input-type-week", desc => "Toggle Input Type Week support",
278 define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
280 { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
281 define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },
283 { option => "legacy-vendor-prefixes", desc => "Toggle Legacy Vendor Prefix support",
284 define => "ENABLE_LEGACY_VENDOR_PREFIXES", default => 1, value => \$legacyVendorPrefixSupport },
286 { option => "legacy-web-audio", desc => "Toggle Legacy Web Audio support",
287 define => "ENABLE_LEGACY_WEB_AUDIO", default => 1, value => \$legacyWebAudioSupport },
289 { option => "link-prefetch", desc => "Toggle Link Prefetch support",
290 define => "ENABLE_LINK_PREFETCH", default => (isGtk() || isEfl()), value => \$linkPrefetchSupport },
292 { option => "mathml", desc => "Toggle MathML support",
293 define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
295 { option => "media-capture", desc => "Toggle Media Capture support",
296 define => "ENABLE_MEDIA_CAPTURE", default => isEfl(), value => \$mediaCaptureSupport },
298 { option => "media-source", desc => "Toggle Media Source support",
299 define => "ENABLE_MEDIA_SOURCE", default => isGtk(), value => \$mediaSourceSupport },
301 { option => "media-statistics", desc => "Toggle Media Statistics support",
302 define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
304 { option => "media-stream", desc => "Toggle Media Stream support",
305 define => "ENABLE_MEDIA_STREAM", default => (isGtk() || isEfl()), value => \$mediaStreamSupport },
307 { option => "meter-element", desc => "Toggle Meter Element support",
308 define => "ENABLE_METER_ELEMENT", default => !isAppleWinWebKit(), value => \$meterElementSupport },
310 { option => "mhtml", desc => "Toggle MHTML support",
311 define => "ENABLE_MHTML", default => (isGtk() || isEfl()), value => \$mhtmlSupport },
313 { option => "mouse-cursor-scale", desc => "Toggle Scaled mouse cursor support",
314 define => "ENABLE_MOUSE_CURSOR_SCALE", default => isEfl(), value => \$mouseCursorScaleSupport },
316 { option => "navigator-content-utils", desc => "Toggle Navigator Content Utils support",
317 define => "ENABLE_NAVIGATOR_CONTENT_UTILS", default => isEfl(), value => \$registerProtocolHandlerSupport },
319 { option => "navigator-hardware-concurrency", desc => "Toggle Navigator hardware concurrenct support",
320 define => "ENABLE_NAVIGATOR_HWCONCURRENCY", default => 1, value => \$registerProtocolHandlerSupport },
322 { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
323 define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isIOSWebKit(), value => \$netscapePluginAPISupport },
325 { option => "nosniff", desc => "Toggle support for 'X-Content-Type-Options: nosniff'",
326 define => "ENABLE_NOSNIFF", default => isEfl(), value => \$nosniffSupport },
328 { option => "notifications", desc => "Toggle Notifications support",
329 define => "ENABLE_NOTIFICATIONS", default => isGtk(), value => \$notificationsSupport },
331 { option => "orientation-events", desc => "Toggle Orientation Events support",
332 define => "ENABLE_ORIENTATION_EVENTS", default => isIOSWebKit(), value => \$orientationEventsSupport },
334 { option => "performance-timeline", desc => "Toggle Performance Timeline support",
335 define => "ENABLE_PERFORMANCE_TIMELINE", default => isGtk(), value => \$performanceTimelineSupport },
337 { option => "picture-sizes", desc => "Toggle sizes attribute support",
338 define => "ENABLE_PICTURE_SIZES", default => 1, value => \$pictureSizesSupport },
340 { option => "promises", desc => "Toggle Promise support",
341 define => "ENABLE_PROMISES", default => 1, value => \$promiseSupport },
343 { option => "proximity-events", desc => "Toggle Proximity Events support",
344 define => "ENABLE_PROXIMITY_EVENTS", default => 0, value => \$proximityEventsSupport },
346 { option => "quota", desc => "Toggle Quota support",
347 define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport },
349 { option => "resolution-media-query", desc => "Toggle resolution media query support",
350 define => "ENABLE_RESOLUTION_MEDIA_QUERY", default => isEfl(), value => \$resolutionMediaQuerySupport },
352 { option => "resource-timing", desc => "Toggle Resource Timing support",
353 define => "ENABLE_RESOURCE_TIMING", default => isGtk(), value => \$resourceTimingSupport },
355 { option => "request-animation-frame", desc => "Toggle Request Animation Frame support",
356 define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isEfl()), value => \$requestAnimationFrameSupport },
358 { option => "seccomp-filters", desc => "Toggle Seccomp Filter sandbox",
359 define => "ENABLE_SECCOMP_FILTERS", default => 0, value => \$seccompFiltersSupport },
361 { option => "scripted-speech", desc => "Toggle Scripted Speech support",
362 define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
364 { option => "streams-api", desc => "Toggle Streams API support",
365 define => "ENABLE_STREAMS_API", default => 1, value => \$streamsAPISupport },
367 { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
368 define => "ENABLE_SUBTLE_CRYPTO", default => (isGtk() || isEfl() || isAppleMacWebKit() || isIOSWebKit()), value => \$subtleCrypto },
370 { option => "suid-linux-sandbox", desc => "Toggle suid sandbox for linux",
371 define => "ENABLE_SUID_SANDBOX_LINUX", default => 0, value => \$suidLinuxSandbox },
373 { option => "svg-fonts", desc => "Toggle SVG Fonts support",
374 define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport },
376 { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
377 define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
379 { option => "template-element", desc => "Toggle HTMLTemplateElement support",
380 define => "ENABLE_TEMPLATE_ELEMENT", default => 1, value => \$templateElementSupport },
382 { option => "threaded-compositor", desc => "Toggle threaded compositor support",
383 define => "ENABLE_THREADED_COMPOSITOR", default => 0, value => \$threadedCompositorSupport },
385 { option => "text-autosizing", desc => "Toggle Text Autosizing support",
386 define => "ENABLE_TEXT_AUTOSIZING", default => 0, value => \$textAutosizingSupport },
388 { option => "touch-events", desc => "Toggle Touch Events support",
389 define => "ENABLE_TOUCH_EVENTS", default => (isIOSWebKit() || isEfl() || isGtk()), value => \$touchEventsSupport },
391 { option => "touch-slider", desc => "Toggle Touch Slider support",
392 define => "ENABLE_TOUCH_SLIDER", default => isEfl(), value => \$touchSliderSupport },
394 { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
395 define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
397 { option => "user-timing", desc => "Toggle User Timing support",
398 define => "ENABLE_USER_TIMING", default => isGtk(), value => \$userTimingSupport },
400 { option => "vibration", desc => "Toggle Vibration support",
401 define => "ENABLE_VIBRATION", default => isEfl(), value => \$vibrationSupport },
403 { option => "video", desc => "Toggle Video support",
404 define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoSupport },
406 { option => "video-track", desc => "Toggle Video Track support",
407 define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoTrackSupport },
409 { option => "webgl", desc => "Toggle WebGL support",
410 define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$webglSupport },
412 { option => "web-audio", desc => "Toggle Web Audio support",
413 define => "ENABLE_WEB_AUDIO", default => (isEfl() || isGtk()), value => \$webAudioSupport },
415 { option => "web-replay", desc => "Toggle Web Replay support",
416 define => "ENABLE_WEB_REPLAY", default => isAppleMacWebKit(), value => \$webReplaySupport },
418 { option => "web-sockets", desc => "Toggle Web Sockets support",
419 define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },
421 { option => "web-timing", desc => "Toggle Web Timing support",
422 define => "ENABLE_WEB_TIMING", default => (isGtk() || isEfl()), value => \$webTimingSupport },
424 { option => "xhr-timeout", desc => "Toggle XHR Timeout support",
425 define => "ENABLE_XHR_TIMEOUT", default => (isEfl() || isGtk() || isAppleMacWebKit()), value => \$xhrTimeoutSupport },
427 { option => "xslt", desc => "Toggle XSLT support",
428 define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
430 { option => "ftl-jit", desc => "Toggle FTLJIT support",
431 define => "ENABLE_FTL_JIT", default => 0, value => \$ftlJITSupport },
433 { option => "cloop", desc => "Force use of the llint c loop",
434 define => "ENABLE_LLINT_C_LOOP", default => 0, value => \$forceCLoop },
437 sub getFeatureOptionList()