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,
123 $svgDOMObjCBindingsSupport,
126 $systemMallocSupport,
127 $templateElementSupport,
128 $textAutosizingSupport,
129 $threadedCompositorSupport,
130 $threadedHTMLParserSupport,
133 $touchIconLoadingSupport,
150 { option => "3d-rendering", desc => "Toggle 3D Rendering support",
151 define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$threeDRenderingSupport },
153 { option => "accelerated-2d-canvas", desc => "Toggle Accelerated 2D Canvas support",
154 define => "ENABLE_ACCELERATED_2D_CANVAS", default => isGtk(), value => \$accelerated2DCanvasSupport },
156 { option => "battery-status", desc => "Toggle Battery Status support",
157 define => "ENABLE_BATTERY_STATUS", default => isEfl(), value => \$batteryStatusSupport },
159 { option => "canvas-path", desc => "Toggle Canvas Path support",
160 define => "ENABLE_CANVAS_PATH", default => 1, value => \$canvasPathSupport },
162 { option => "canvas-proxy", desc => "Toggle CanvasProxy support",
163 define => "ENABLE_CANVAS_PROXY", default => 0, value => \$canvasProxySupport },
165 { option => "channel-messaging", desc => "Toggle Channel Messaging support",
166 define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
168 { option => "class-syntax", desc => "Toggle ES6 class syntax support",
169 define => "ENABLE_ES6_CLASS_SYNTAX", default => 0, value => \$classSyntax },
171 { option => "csp-next", desc => "Toggle Content Security Policy 1.1 support",
172 define => "ENABLE_CSP_NEXT", default => isGtk(), value => \$cspNextSupport },
174 { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support",
175 define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation },
177 { option => "css-shapes", desc => "Toggle CSS Shapes support",
178 define => "ENABLE_CSS_SHAPES", default => 1, value => \$cssShapesSupport },
180 { option => "css-grid-layout", desc => "Toggle CSS Grid Layout support",
181 define => "ENABLE_CSS_GRID_LAYOUT", default => 1, value => \$cssGridLayoutSupport },
183 { option => "css3-conditional-rules", desc => "Toggle CSS3 Conditional Rules support (i.e. \@supports)",
184 define => "ENABLE_CSS3_CONDITIONAL_RULES", default => 1, value => \$css3ConditionalRulesSupport },
186 { option => "css3-text", desc => "Toggle CSS3 Text support",
187 define => "ENABLE_CSS3_TEXT", default => (isEfl() || isGtk()), value => \$css3TextSupport },
189 { option => "css3-text-line-break", desc => "Toggle CSS3 Text Line Break support",
190 define => "ENABLE_CSS3_TEXT_LINE_BREAK", default => 0, value => \$css3TextLineBreakSupport },
192 { option => "css-box-decoration-break", desc => "Toggle CSS box-decoration-break support",
193 define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
195 { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
196 define => "ENABLE_CSS_IMAGE_ORIENTATION", default => (isEfl() || isGtk()), value => \$cssImageOrientationSupport },
198 { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
199 define => "ENABLE_CSS_IMAGE_RESOLUTION", default => isGtk(), value => \$cssImageResolutionSupport },
201 { option => "css-image-set", desc => "Toggle CSS image-set support",
202 define => "ENABLE_CSS_IMAGE_SET", default => (isEfl() || isGtk()), value => \$cssImageSetSupport },
204 { option => "css-regions", desc => "Toggle CSS Regions support",
205 define => "ENABLE_CSS_REGIONS", default => 1, value => \$cssRegionsSupport },
207 { option => "css-compositing", desc => "Toggle CSS Compositing support",
208 define => "ENABLE_CSS_COMPOSITING", default => isAppleWebKit(), value => \$cssCompositingSupport },
210 { option => "custom-scheme-handler", desc => "Toggle Custom Scheme Handler support",
211 define => "ENABLE_CUSTOM_SCHEME_HANDLER", default => isEfl(), value => \$customSchemeHandlerSupport },
213 { option => "datalist-element", desc => "Toggle Datalist Element support",
214 define => "ENABLE_DATALIST_ELEMENT", default => isEfl(), value => \$datalistElementSupport },
216 { option => "data-transfer-items", desc => "Toggle Data Transfer Items support",
217 define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport },
219 { option => "details-element", desc => "Toggle Details Element support",
220 define => "ENABLE_DETAILS_ELEMENT", default => 1, value => \$detailsElementSupport },
222 { option => "device-orientation", desc => "Toggle Device Orientation support",
223 define => "ENABLE_DEVICE_ORIENTATION", default => isIOSWebKit(), value => \$deviceOrientationSupport },
225 { option => "dom4-events-constructor", desc => "Expose DOM4 Events constructors",
226 define => "ENABLE_DOM4_EVENTS_CONSTRUCTOR", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$dom4EventsConstructor },
228 { option => "download-attribute", desc => "Toggle Download Attribute support",
229 define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => isEfl(), value => \$downloadAttributeSupport },
231 { option => "font-load-events", desc => "Toggle Font Load Events support",
232 define => "ENABLE_FONT_LOAD_EVENTS", default => 0, value => \$fontLoadEventsSupport },
234 { option => "ftpdir", desc => "Toggle FTP Directory support",
235 define => "ENABLE_FTPDIR", default => 1, value => \$ftpDirSupport },
237 { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
238 define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isEfl() || isGtk()), value => \$fullscreenAPISupport },
240 { option => "gamepad", desc => "Toggle Gamepad support",
241 define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },
243 { option => "geolocation", desc => "Toggle Geolocation support",
244 define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$geolocationSupport },
246 { option => "high-dpi-canvas", desc => "Toggle High DPI Canvas support",
247 define => "ENABLE_HIGH_DPI_CANVAS", default => (isAppleWebKit()), value => \$highDPICanvasSupport },
249 { option => "icon-database", desc => "Toggle Icondatabase support",
250 define => "ENABLE_ICONDATABASE", default => !isIOSWebKit(), value => \$icondatabaseSupport },
252 { option => "indexed-database", desc => "Toggle Indexed Database support",
253 define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
255 { option => "input-speech", desc => "Toggle Input Speech support",
256 define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
258 { option => "input-type-color", desc => "Toggle Input Type Color support",
259 define => "ENABLE_INPUT_TYPE_COLOR", default => isEfl(), value => \$inputTypeColorSupport },
261 { option => "input-type-date", desc => "Toggle Input Type Date support",
262 define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport },
264 { option => "input-type-datetime", desc => "Toggle broken Input Type Datetime support",
265 define => "ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE", default => 0, value => \$inputTypeDatetimeSupport },
267 { option => "input-type-datetimelocal", desc => "Toggle Input Type Datetimelocal support",
268 define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport },
270 { option => "input-type-month", desc => "Toggle Input Type Month support",
271 define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport },
273 { option => "input-type-time", desc => "Toggle Input Type Time support",
274 define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport },
276 { option => "input-type-week", desc => "Toggle Input Type Week support",
277 define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
279 { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
280 define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },
282 { option => "legacy-vendor-prefixes", desc => "Toggle Legacy Vendor Prefix support",
283 define => "ENABLE_LEGACY_VENDOR_PREFIXES", default => 1, value => \$legacyVendorPrefixSupport },
285 { option => "legacy-web-audio", desc => "Toggle Legacy Web Audio support",
286 define => "ENABLE_LEGACY_WEB_AUDIO", default => 1, value => \$legacyWebAudioSupport },
288 { option => "link-prefetch", desc => "Toggle Link Prefetch support",
289 define => "ENABLE_LINK_PREFETCH", default => (isGtk() || isEfl()), value => \$linkPrefetchSupport },
291 { option => "mathml", desc => "Toggle MathML support",
292 define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
294 { option => "media-capture", desc => "Toggle Media Capture support",
295 define => "ENABLE_MEDIA_CAPTURE", default => isEfl(), value => \$mediaCaptureSupport },
297 { option => "media-source", desc => "Toggle Media Source support",
298 define => "ENABLE_MEDIA_SOURCE", default => isGtk(), value => \$mediaSourceSupport },
300 { option => "media-statistics", desc => "Toggle Media Statistics support",
301 define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
303 { option => "media-stream", desc => "Toggle Media Stream support",
304 define => "ENABLE_MEDIA_STREAM", default => (isGtk() || isEfl()), value => \$mediaStreamSupport },
306 { option => "meter-element", desc => "Toggle Meter Element support",
307 define => "ENABLE_METER_ELEMENT", default => !isAppleWinWebKit(), value => \$meterElementSupport },
309 { option => "mhtml", desc => "Toggle MHTML support",
310 define => "ENABLE_MHTML", default => (isGtk() || isEfl()), value => \$mhtmlSupport },
312 { option => "mouse-cursor-scale", desc => "Toggle Scaled mouse cursor support",
313 define => "ENABLE_MOUSE_CURSOR_SCALE", default => isEfl(), value => \$mouseCursorScaleSupport },
315 { option => "navigator-content-utils", desc => "Toggle Navigator Content Utils support",
316 define => "ENABLE_NAVIGATOR_CONTENT_UTILS", default => isEfl(), value => \$registerProtocolHandlerSupport },
318 { option => "navigator-hardware-concurrency", desc => "Toggle Navigator hardware concurrenct support",
319 define => "ENABLE_NAVIGATOR_HWCONCURRENCY", default => 1, value => \$registerProtocolHandlerSupport },
321 { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
322 define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isIOSWebKit(), value => \$netscapePluginAPISupport },
324 { option => "nosniff", desc => "Toggle support for 'X-Content-Type-Options: nosniff'",
325 define => "ENABLE_NOSNIFF", default => isEfl(), value => \$nosniffSupport },
327 { option => "notifications", desc => "Toggle Notifications support",
328 define => "ENABLE_NOTIFICATIONS", default => isGtk(), value => \$notificationsSupport },
330 { option => "orientation-events", desc => "Toggle Orientation Events support",
331 define => "ENABLE_ORIENTATION_EVENTS", default => isIOSWebKit(), value => \$orientationEventsSupport },
333 { option => "performance-timeline", desc => "Toggle Performance Timeline support",
334 define => "ENABLE_PERFORMANCE_TIMELINE", default => isGtk(), value => \$performanceTimelineSupport },
336 { option => "picture-sizes", desc => "Toggle sizes attribute support",
337 define => "ENABLE_PICTURE_SIZES", default => 1, value => \$pictureSizesSupport },
339 { option => "promises", desc => "Toggle Promise support",
340 define => "ENABLE_PROMISES", default => 1, value => \$promiseSupport },
342 { option => "proximity-events", desc => "Toggle Proximity Events support",
343 define => "ENABLE_PROXIMITY_EVENTS", default => 0, value => \$proximityEventsSupport },
345 { option => "quota", desc => "Toggle Quota support",
346 define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport },
348 { option => "resolution-media-query", desc => "Toggle resolution media query support",
349 define => "ENABLE_RESOLUTION_MEDIA_QUERY", default => isEfl(), value => \$resolutionMediaQuerySupport },
351 { option => "resource-timing", desc => "Toggle Resource Timing support",
352 define => "ENABLE_RESOURCE_TIMING", default => isGtk(), value => \$resourceTimingSupport },
354 { option => "request-animation-frame", desc => "Toggle Request Animation Frame support",
355 define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isEfl()), value => \$requestAnimationFrameSupport },
357 { option => "seccomp-filters", desc => "Toggle Seccomp Filter sandbox",
358 define => "ENABLE_SECCOMP_FILTERS", default => 0, value => \$seccompFiltersSupport },
360 { option => "scripted-speech", desc => "Toggle Scripted Speech support",
361 define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
363 { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
364 define => "ENABLE_SUBTLE_CRYPTO", default => (isGtk() || isEfl() || isAppleMacWebKit() || isIOSWebKit()), value => \$subtleCrypto },
366 { option => "suid-linux-sandbox", desc => "Toggle suid sandbox for linux",
367 define => "ENABLE_SUID_SANDBOX_LINUX", default => 0, value => \$suidLinuxSandbox },
369 { option => "svg-fonts", desc => "Toggle SVG Fonts support",
370 define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport },
372 { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
373 define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
375 { option => "template-element", desc => "Toggle HTMLTemplateElement support",
376 define => "ENABLE_TEMPLATE_ELEMENT", default => 1, value => \$templateElementSupport },
378 { option => "threaded-compositor", desc => "Toggle threaded compositor support",
379 define => "ENABLE_THREADED_COMPOSITOR", default => 0, value => \$threadedCompositorSupport },
381 { option => "text-autosizing", desc => "Toggle Text Autosizing support",
382 define => "ENABLE_TEXT_AUTOSIZING", default => 0, value => \$textAutosizingSupport },
384 { option => "touch-events", desc => "Toggle Touch Events support",
385 define => "ENABLE_TOUCH_EVENTS", default => (isIOSWebKit() || isEfl() || isGtk()), value => \$touchEventsSupport },
387 { option => "touch-slider", desc => "Toggle Touch Slider support",
388 define => "ENABLE_TOUCH_SLIDER", default => isEfl(), value => \$touchSliderSupport },
390 { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
391 define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
393 { option => "user-timing", desc => "Toggle User Timing support",
394 define => "ENABLE_USER_TIMING", default => isGtk(), value => \$userTimingSupport },
396 { option => "vibration", desc => "Toggle Vibration support",
397 define => "ENABLE_VIBRATION", default => isEfl(), value => \$vibrationSupport },
399 { option => "video", desc => "Toggle Video support",
400 define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoSupport },
402 { option => "video-track", desc => "Toggle Video Track support",
403 define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoTrackSupport },
405 { option => "webgl", desc => "Toggle WebGL support",
406 define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$webglSupport },
408 { option => "web-audio", desc => "Toggle Web Audio support",
409 define => "ENABLE_WEB_AUDIO", default => (isEfl() || isGtk()), value => \$webAudioSupport },
411 { option => "web-replay", desc => "Toggle Web Replay support",
412 define => "ENABLE_WEB_REPLAY", default => isAppleMacWebKit(), value => \$webReplaySupport },
414 { option => "web-sockets", desc => "Toggle Web Sockets support",
415 define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },
417 { option => "web-timing", desc => "Toggle Web Timing support",
418 define => "ENABLE_WEB_TIMING", default => (isGtk() || isEfl()), value => \$webTimingSupport },
420 { option => "xhr-timeout", desc => "Toggle XHR Timeout support",
421 define => "ENABLE_XHR_TIMEOUT", default => (isEfl() || isGtk() || isAppleMacWebKit()), value => \$xhrTimeoutSupport },
423 { option => "xslt", desc => "Toggle XSLT support",
424 define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
426 { option => "ftl-jit", desc => "Toggle FTLJIT support",
427 define => "ENABLE_FTL_JIT", default => 0, value => \$ftlJITSupport },
429 { option => "cloop", desc => "Force use of the llint c loop",
430 define => "ENABLE_LLINT_C_LOOP", default => 0, value => \$forceCLoop },
433 sub getFeatureOptionList()