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 $threeDTransformsSupport,
46 $accelerated2DCanvasSupport,
49 $attachmentElementSupport,
50 $batteryStatusSupport,
53 $channelMessagingSupport,
55 $templateLiteralSyntax,
58 $css3TextLineBreakSupport,
60 $cssBoxDecorationBreakSupport,
62 $cssGridLayoutSupport,
63 $cssImageOrientationSupport,
64 $cssImageResolutionSupport,
68 $cssCompositingSupport,
69 $customElementsSupport,
70 $customSchemeHandlerSupport,
71 $dataTransferItemsSupport,
72 $datalistElementSupport,
73 $detailsElementSupport,
74 $deviceOrientationSupport,
75 $directoryUploadSupport,
76 $dom4EventsConstructor,
77 $downloadAttributeSupport,
79 $fontLoadEventsSupport,
81 $fullscreenAPISupport,
85 $hardwareConcurrencySupport,
86 $highDPICanvasSupport,
88 $indexedDatabaseSupport,
90 $inputTypeColorSupport,
91 $inputTypeDateSupport,
92 $inputTypeDatetimeSupport,
93 $inputTypeDatetimelocalSupport,
94 $inputTypeMonthSupport,
95 $inputTypeTimeSupport,
96 $inputTypeWeekSupport,
99 $legacyNotificationsSupport,
100 $legacyVendorPrefixSupport,
101 $legacyWebAudioSupport,
102 $linkPrefetchSupport,
103 $linkPrerenderSupport,
105 $mediaCaptureSupport,
107 $mediaStatisticsSupport,
109 $meterElementSupport,
112 $mouseCursorScaleSupport,
113 $netscapePluginAPISupport,
115 $notificationsSupport,
116 $orientationEventsSupport,
117 $pageVisibilityAPISupport,
118 $performanceTimelineSupport,
120 $proximityEventsSupport,
122 $resolutionMediaQuerySupport,
123 $registerProtocolHandlerSupport,
124 $requestAnimationFrameSupport,
125 $resourceTimingSupport,
126 $scriptedSpeechSupport,
127 $seccompFiltersSupport,
132 $svgDOMObjCBindingsSupport,
134 $systemMallocSupport,
135 $templateElementSupport,
136 $textAutosizingSupport,
137 $threadedCompositorSupport,
138 $threadedHTMLParserSupport,
141 $touchIconLoadingSupport,
148 $webAnimationsSupport,
158 { option => "3d-rendering", desc => "Toggle 3D Rendering support",
159 define => "ENABLE_3D_TRANSFORMS", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$threeDTransformsSupport },
161 { option => "accelerated-2d-canvas", desc => "Toggle Accelerated 2D Canvas support",
162 define => "ENABLE_ACCELERATED_2D_CANVAS", default => isGtk(), value => \$accelerated2DCanvasSupport },
164 { option => "allinone-build", desc => "Toggle all-in-one build",
165 define => "ENABLE_ALLINONE_BUILD", default => isWindows(), value => \$allInOneBuild },
167 { option => "arrowfunction-syntax", desc => "Toggle ES6 arrow function syntax support",
168 define => "ENABLE_ES6_ARROWFUNCTION_SYNTAX", default => 1, value => \$arrowfunctionSyntax },
170 { option => "attachment-element", desc => "Toggle Attachment Element support",
171 define => "ENABLE_ATTACHMENT_ELEMENT", default => 0, value => \$attachmentElementSupport },
173 { option => "battery-status", desc => "Toggle Battery Status support",
174 define => "ENABLE_BATTERY_STATUS", default => isEfl(), value => \$batteryStatusSupport },
176 { option => "canvas-path", desc => "Toggle Canvas Path support",
177 define => "ENABLE_CANVAS_PATH", default => 1, value => \$canvasPathSupport },
179 { option => "canvas-proxy", desc => "Toggle CanvasProxy support",
180 define => "ENABLE_CANVAS_PROXY", default => 0, value => \$canvasProxySupport },
182 { option => "channel-messaging", desc => "Toggle Channel Messaging support",
183 define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
185 { option => "class-syntax", desc => "Toggle ES6 class syntax support",
186 define => "ENABLE_ES6_CLASS_SYNTAX", default => 1, value => \$classSyntax },
188 { option => "generators", desc => "Toggle ES6 generators support",
189 define => "ENABLE_ES6_GENERATORS", default => 1, value => \$generatorsSupport },
191 { option => "modules", desc => "Toggle ES6 modules support",
192 define => "ENABLE_ES6_MODULES", default => 0, value => \$modulesSupport },
194 { option => "template-literal-syntax", desc => "Toggle ES6 template literal syntax support",
195 define => "ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX", default => 1, value => \$templateLiteralSyntax },
197 { option => "csp-next", desc => "Toggle Content Security Policy 1.1 support",
198 define => "ENABLE_CSP_NEXT", default => isGtk(), value => \$cspNextSupport },
200 { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support",
201 define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation },
203 { option => "css-shapes", desc => "Toggle CSS Shapes support",
204 define => "ENABLE_CSS_SHAPES", default => 1, value => \$cssShapesSupport },
206 { option => "css-grid-layout", desc => "Toggle CSS Grid Layout support",
207 define => "ENABLE_CSS_GRID_LAYOUT", default => 1, value => \$cssGridLayoutSupport },
209 { option => "css3-text", desc => "Toggle CSS3 Text support",
210 define => "ENABLE_CSS3_TEXT", default => (isEfl() || isGtk()), value => \$css3TextSupport },
212 { option => "css3-text-line-break", desc => "Toggle CSS3 Text Line Break support",
213 define => "ENABLE_CSS3_TEXT_LINE_BREAK", default => 0, value => \$css3TextLineBreakSupport },
215 { option => "css-box-decoration-break", desc => "Toggle CSS box-decoration-break support",
216 define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
218 { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
219 define => "ENABLE_CSS_IMAGE_ORIENTATION", default => (isEfl() || isGtk()), value => \$cssImageOrientationSupport },
221 { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
222 define => "ENABLE_CSS_IMAGE_RESOLUTION", default => isGtk(), value => \$cssImageResolutionSupport },
224 { option => "css-image-set", desc => "Toggle CSS image-set support",
225 define => "ENABLE_CSS_IMAGE_SET", default => (isEfl() || isGtk()), value => \$cssImageSetSupport },
227 { option => "css-regions", desc => "Toggle CSS Regions support",
228 define => "ENABLE_CSS_REGIONS", default => 1, value => \$cssRegionsSupport },
230 { option => "css-compositing", desc => "Toggle CSS Compositing support",
231 define => "ENABLE_CSS_COMPOSITING", default => isAppleWebKit(), value => \$cssCompositingSupport },
233 { option => "custom-elements", desc => "Toggle custom elements support",
234 define => "ENABLE_CUSTOM_ELEMENTS", default => (isAppleMacWebKit() || isIOSWebKit()), value => \$customElementsSupport },
236 { option => "custom-scheme-handler", desc => "Toggle Custom Scheme Handler support",
237 define => "ENABLE_CUSTOM_SCHEME_HANDLER", default => isEfl(), value => \$customSchemeHandlerSupport },
239 { option => "datalist-element", desc => "Toggle Datalist Element support",
240 define => "ENABLE_DATALIST_ELEMENT", default => isEfl(), value => \$datalistElementSupport },
242 { option => "data-transfer-items", desc => "Toggle Data Transfer Items support",
243 define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport },
245 { option => "details-element", desc => "Toggle Details Element support",
246 define => "ENABLE_DETAILS_ELEMENT", default => 1, value => \$detailsElementSupport },
248 { option => "device-orientation", desc => "Toggle Device Orientation support",
249 define => "ENABLE_DEVICE_ORIENTATION", default => isIOSWebKit(), value => \$deviceOrientationSupport },
251 { option => "dom4-events-constructor", desc => "Expose DOM4 Events constructors",
252 define => "ENABLE_DOM4_EVENTS_CONSTRUCTOR", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$dom4EventsConstructor },
254 { option => "download-attribute", desc => "Toggle Download Attribute support",
255 define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => isEfl(), value => \$downloadAttributeSupport },
257 { option => "fetch-api", desc => "Toggle Fetch API support",
258 define => "ENABLE_FETCH_API", default => 1, value => \$fetchAPISupport },
260 { option => "font-load-events", desc => "Toggle Font Load Events support",
261 define => "ENABLE_FONT_LOAD_EVENTS", default => 0, value => \$fontLoadEventsSupport },
263 { option => "ftpdir", desc => "Toggle FTP Directory support",
264 define => "ENABLE_FTPDIR", default => 1, value => \$ftpDirSupport },
266 { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
267 define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isEfl() || isGtk()), value => \$fullscreenAPISupport },
269 { option => "gamepad", desc => "Toggle Gamepad support",
270 define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },
272 { option => "geolocation", desc => "Toggle Geolocation support",
273 define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$geolocationSupport },
275 { option => "high-dpi-canvas", desc => "Toggle High DPI Canvas support",
276 define => "ENABLE_HIGH_DPI_CANVAS", default => (isAppleWebKit()), value => \$highDPICanvasSupport },
278 { option => "icon-database", desc => "Toggle Icondatabase support",
279 define => "ENABLE_ICONDATABASE", default => !isIOSWebKit(), value => \$icondatabaseSupport },
281 { option => "indexed-database", desc => "Toggle Indexed Database support",
282 define => "ENABLE_INDEXED_DATABASE", default => (isEfl() || isGtk()), value => \$indexedDatabaseSupport },
284 { option => "input-speech", desc => "Toggle Input Speech support",
285 define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
287 { option => "input-type-color", desc => "Toggle Input Type Color support",
288 define => "ENABLE_INPUT_TYPE_COLOR", default => (isEfl() || isGtk()), value => \$inputTypeColorSupport },
290 { option => "input-type-date", desc => "Toggle Input Type Date support",
291 define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport },
293 { option => "input-type-datetime", desc => "Toggle broken Input Type Datetime support",
294 define => "ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE", default => 0, value => \$inputTypeDatetimeSupport },
296 { option => "input-type-datetimelocal", desc => "Toggle Input Type Datetimelocal support",
297 define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport },
299 { option => "input-type-month", desc => "Toggle Input Type Month support",
300 define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport },
302 { option => "input-type-time", desc => "Toggle Input Type Time support",
303 define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport },
305 { option => "input-type-week", desc => "Toggle Input Type Week support",
306 define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
308 { option => "intl", desc => "Toggle Intl support",
309 define => "ENABLE_INTL", default => 1, value => \$intlSupport },
311 { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
312 define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },
314 { option => "legacy-vendor-prefixes", desc => "Toggle Legacy Vendor Prefix support",
315 define => "ENABLE_LEGACY_VENDOR_PREFIXES", default => 1, value => \$legacyVendorPrefixSupport },
317 { option => "legacy-web-audio", desc => "Toggle Legacy Web Audio support",
318 define => "ENABLE_LEGACY_WEB_AUDIO", default => 1, value => \$legacyWebAudioSupport },
320 { option => "link-prefetch", desc => "Toggle Link Prefetch support",
321 define => "ENABLE_LINK_PREFETCH", default => (isGtk() || isEfl()), value => \$linkPrefetchSupport },
323 { option => "jit", desc => "Enable just-in-time JavaScript support",
324 define => "ENABLE_JIT", default => 1, value => \$jitSupport },
326 { option => "mathml", desc => "Toggle MathML support",
327 define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
329 { option => "media-capture", desc => "Toggle Media Capture support",
330 define => "ENABLE_MEDIA_CAPTURE", default => isEfl(), value => \$mediaCaptureSupport },
332 { option => "media-source", desc => "Toggle Media Source support",
333 define => "ENABLE_MEDIA_SOURCE", default => (isGtk() || isEfl()), value => \$mediaSourceSupport },
335 { option => "media-statistics", desc => "Toggle Media Statistics support",
336 define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
338 { option => "media-stream", desc => "Toggle Media Stream support",
339 define => "ENABLE_MEDIA_STREAM", default => (isGtk() || isEfl()), value => \$mediaStreamSupport },
341 { option => "meter-element", desc => "Toggle Meter Element support",
342 define => "ENABLE_METER_ELEMENT", default => !isAppleWinWebKit(), value => \$meterElementSupport },
344 { option => "mhtml", desc => "Toggle MHTML support",
345 define => "ENABLE_MHTML", default => (isGtk() || isEfl()), value => \$mhtmlSupport },
347 { option => "mouse-cursor-scale", desc => "Toggle Scaled mouse cursor support",
348 define => "ENABLE_MOUSE_CURSOR_SCALE", default => isEfl(), value => \$mouseCursorScaleSupport },
350 { option => "navigator-content-utils", desc => "Toggle Navigator Content Utils support",
351 define => "ENABLE_NAVIGATOR_CONTENT_UTILS", default => isEfl(), value => \$registerProtocolHandlerSupport },
353 { option => "navigator-hardware-concurrency", desc => "Toggle Navigator hardware concurrenct support",
354 define => "ENABLE_NAVIGATOR_HWCONCURRENCY", default => 1, value => \$hardwareConcurrencySupport },
356 { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
357 define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isIOSWebKit(), value => \$netscapePluginAPISupport },
359 { option => "nosniff", desc => "Toggle support for 'X-Content-Type-Options: nosniff'",
360 define => "ENABLE_NOSNIFF", default => isEfl(), value => \$nosniffSupport },
362 { option => "notifications", desc => "Toggle Notifications support",
363 define => "ENABLE_NOTIFICATIONS", default => isGtk(), value => \$notificationsSupport },
365 { option => "orientation-events", desc => "Toggle Orientation Events support",
366 define => "ENABLE_ORIENTATION_EVENTS", default => isIOSWebKit(), value => \$orientationEventsSupport },
368 { option => "performance-timeline", desc => "Toggle Performance Timeline support",
369 define => "ENABLE_PERFORMANCE_TIMELINE", default => isGtk(), value => \$performanceTimelineSupport },
371 { option => "promises", desc => "Toggle Promise support",
372 define => "ENABLE_PROMISES", default => 1, value => \$promiseSupport },
374 { option => "proximity-events", desc => "Toggle Proximity Events support",
375 define => "ENABLE_PROXIMITY_EVENTS", default => 0, value => \$proximityEventsSupport },
377 { option => "quota", desc => "Toggle Quota support",
378 define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport },
380 { option => "resolution-media-query", desc => "Toggle resolution media query support",
381 define => "ENABLE_RESOLUTION_MEDIA_QUERY", default => isEfl(), value => \$resolutionMediaQuerySupport },
383 { option => "resource-timing", desc => "Toggle Resource Timing support",
384 define => "ENABLE_RESOURCE_TIMING", default => isGtk(), value => \$resourceTimingSupport },
386 { option => "request-animation-frame", desc => "Toggle Request Animation Frame support",
387 define => "ENABLE_REQUEST_ANIMATION_FRAME", default => (isAppleMacWebKit() || isGtk() || isEfl()), value => \$requestAnimationFrameSupport },
389 { option => "seccomp-filters", desc => "Toggle Seccomp Filter sandbox",
390 define => "ENABLE_SECCOMP_FILTERS", default => 0, value => \$seccompFiltersSupport },
392 { option => "scripted-speech", desc => "Toggle Scripted Speech support",
393 define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
395 { option => "shadow-dom", desc => "Toggle Shadow DOM support",
396 define => "ENABLE_SHADOW_DOM", default => (isAppleMacWebKit() || isIOSWebKit()), value => \$shadowDOMSupport },
398 { option => "streams-api", desc => "Toggle Streams API support",
399 define => "ENABLE_STREAMS_API", default => 1, value => \$streamsAPISupport },
401 { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
402 define => "ENABLE_SUBTLE_CRYPTO", default => (isGtk() || isEfl() || isAppleMacWebKit() || isIOSWebKit()), value => \$subtleCrypto },
404 { option => "svg-fonts", desc => "Toggle SVG Fonts support",
405 define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport },
407 { option => "system-malloc", desc => "Toggle system allocator instead of bmalloc",
408 define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
410 { option => "template-element", desc => "Toggle HTMLTemplateElement support",
411 define => "ENABLE_TEMPLATE_ELEMENT", default => 1, value => \$templateElementSupport },
413 { option => "threaded-compositor", desc => "Toggle threaded compositor support",
414 define => "ENABLE_THREADED_COMPOSITOR", default => 0, value => \$threadedCompositorSupport },
416 { option => "text-autosizing", desc => "Toggle Text Autosizing support",
417 define => "ENABLE_TEXT_AUTOSIZING", default => 0, value => \$textAutosizingSupport },
419 { option => "touch-events", desc => "Toggle Touch Events support",
420 define => "ENABLE_TOUCH_EVENTS", default => (isIOSWebKit() || isEfl() || isGtk()), value => \$touchEventsSupport },
422 { option => "touch-slider", desc => "Toggle Touch Slider support",
423 define => "ENABLE_TOUCH_SLIDER", default => isEfl(), value => \$touchSliderSupport },
425 { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
426 define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
428 { option => "user-timing", desc => "Toggle User Timing support",
429 define => "ENABLE_USER_TIMING", default => isGtk(), value => \$userTimingSupport },
431 { option => "vibration", desc => "Toggle Vibration support",
432 define => "ENABLE_VIBRATION", default => isEfl(), value => \$vibrationSupport },
434 { option => "video", desc => "Toggle Video support",
435 define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoSupport },
437 { option => "video-track", desc => "Toggle Video Track support",
438 define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoTrackSupport },
440 { option => "webgl", desc => "Toggle WebGL support",
441 define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$webglSupport },
443 { option => "webassembly", desc => "Toggle WebAssembly support",
444 define => "ENABLE_WEBASSEMBLY", default => 0, value => \$webAssemblySupport },
446 { option => "web-animations", desc => "Toggle Web Animations support",
447 define => "ENABLE_WEB_ANIMATIONS", default => 0, value => \$webAnimationsSupport },
449 { option => "web-audio", desc => "Toggle Web Audio support",
450 define => "ENABLE_WEB_AUDIO", default => (isEfl() || isGtk()), value => \$webAudioSupport },
452 { option => "web-replay", desc => "Toggle Web Replay support",
453 define => "ENABLE_WEB_REPLAY", default => isAppleMacWebKit(), value => \$webReplaySupport },
455 { option => "web-sockets", desc => "Toggle Web Sockets support",
456 define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },
458 { option => "web-timing", desc => "Toggle Web Timing support",
459 define => "ENABLE_WEB_TIMING", default => (isGtk() || isEfl()), value => \$webTimingSupport },
461 { option => "xslt", desc => "Toggle XSLT support",
462 define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
464 { option => "ftl-jit", desc => "Toggle FTLJIT support",
465 define => "ENABLE_FTL_JIT", default => (isX86_64() && (isGtk() || isEfl())) , value => \$ftlJITSupport },
468 sub getFeatureOptionList()