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,
48 $attachmentElementSupport,
49 $batteryStatusSupport,
52 $channelMessagingSupport,
54 $templateLiteralSyntax,
57 $css3TextLineBreakSupport,
59 $cssBoxDecorationBreakSupport,
61 $cssGridLayoutSupport,
62 $cssImageOrientationSupport,
63 $cssImageResolutionSupport,
67 $cssCompositingSupport,
68 $customElementsSupport,
69 $customSchemeHandlerSupport,
70 $dataTransferItemsSupport,
71 $datalistElementSupport,
72 $detailsElementSupport,
73 $deviceOrientationSupport,
74 $directoryUploadSupport,
75 $dom4EventsConstructor,
76 $downloadAttributeSupport,
78 $fontLoadEventsSupport,
80 $fullscreenAPISupport,
84 $hardwareConcurrencySupport,
85 $highDPICanvasSupport,
87 $indexedDatabaseSupport,
89 $inputTypeColorSupport,
90 $inputTypeDateSupport,
91 $inputTypeDatetimeSupport,
92 $inputTypeDatetimelocalSupport,
93 $inputTypeMonthSupport,
94 $inputTypeTimeSupport,
95 $inputTypeWeekSupport,
98 $legacyNotificationsSupport,
99 $legacyVendorPrefixSupport,
100 $legacyWebAudioSupport,
101 $linkPrefetchSupport,
102 $linkPrerenderSupport,
104 $mediaCaptureSupport,
106 $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,
131 $svgDOMObjCBindingsSupport,
133 $systemMallocSupport,
134 $templateElementSupport,
135 $textAutosizingSupport,
136 $threadedCompositorSupport,
137 $threadedHTMLParserSupport,
140 $touchIconLoadingSupport,
147 $webAnimationsSupport,
156 prohibitUnknownPort();
159 { option => "3d-rendering", desc => "Toggle 3D Rendering support",
160 define => "ENABLE_3D_TRANSFORMS", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$threeDTransformsSupport },
162 { option => "accelerated-2d-canvas", desc => "Toggle Accelerated 2D Canvas support",
163 define => "ENABLE_ACCELERATED_2D_CANVAS", default => isGtk(), value => \$accelerated2DCanvasSupport },
165 { option => "allinone-build", desc => "Toggle all-in-one build",
166 define => "ENABLE_ALLINONE_BUILD", default => isWindows(), value => \$allInOneBuild },
168 { option => "attachment-element", desc => "Toggle Attachment Element support",
169 define => "ENABLE_ATTACHMENT_ELEMENT", default => 0, value => \$attachmentElementSupport },
171 { option => "battery-status", desc => "Toggle Battery Status support",
172 define => "ENABLE_BATTERY_STATUS", default => isEfl(), value => \$batteryStatusSupport },
174 { option => "canvas-path", desc => "Toggle Canvas Path support",
175 define => "ENABLE_CANVAS_PATH", default => 1, value => \$canvasPathSupport },
177 { option => "canvas-proxy", desc => "Toggle CanvasProxy support",
178 define => "ENABLE_CANVAS_PROXY", default => 0, value => \$canvasProxySupport },
180 { option => "channel-messaging", desc => "Toggle Channel Messaging support",
181 define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
183 { option => "generators", desc => "Toggle ES6 generators support",
184 define => "ENABLE_ES6_GENERATORS", default => 1, value => \$generatorsSupport },
186 { option => "modules", desc => "Toggle ES6 modules support",
187 define => "ENABLE_ES6_MODULES", default => 0, value => \$modulesSupport },
189 { option => "csp-next", desc => "Toggle Content Security Policy 1.1 support",
190 define => "ENABLE_CSP_NEXT", default => isGtk(), value => \$cspNextSupport },
192 { option => "css-device-adaptation", desc => "Toggle CSS Device Adaptation support",
193 define => "ENABLE_CSS_DEVICE_ADAPTATION", default => isEfl(), value => \$cssDeviceAdaptation },
195 { option => "css-shapes", desc => "Toggle CSS Shapes support",
196 define => "ENABLE_CSS_SHAPES", default => 1, value => \$cssShapesSupport },
198 { option => "css-grid-layout", desc => "Toggle CSS Grid Layout support",
199 define => "ENABLE_CSS_GRID_LAYOUT", default => 1, value => \$cssGridLayoutSupport },
201 { option => "css3-text", desc => "Toggle CSS3 Text support",
202 define => "ENABLE_CSS3_TEXT", default => (isEfl() || isGtk()), value => \$css3TextSupport },
204 { option => "css3-text-line-break", desc => "Toggle CSS3 Text Line Break support",
205 define => "ENABLE_CSS3_TEXT_LINE_BREAK", default => 0, value => \$css3TextLineBreakSupport },
207 { option => "css-box-decoration-break", desc => "Toggle CSS box-decoration-break support",
208 define => "ENABLE_CSS_BOX_DECORATION_BREAK", default => 1, value => \$cssBoxDecorationBreakSupport },
210 { option => "css-image-orientation", desc => "Toggle CSS image-orientation support",
211 define => "ENABLE_CSS_IMAGE_ORIENTATION", default => (isEfl() || isGtk()), value => \$cssImageOrientationSupport },
213 { option => "css-image-resolution", desc => "Toggle CSS image-resolution support",
214 define => "ENABLE_CSS_IMAGE_RESOLUTION", default => isGtk(), value => \$cssImageResolutionSupport },
216 { option => "css-image-set", desc => "Toggle CSS image-set support",
217 define => "ENABLE_CSS_IMAGE_SET", default => (isEfl() || isGtk()), value => \$cssImageSetSupport },
219 { option => "css-regions", desc => "Toggle CSS Regions support",
220 define => "ENABLE_CSS_REGIONS", default => 1, value => \$cssRegionsSupport },
222 { option => "css-compositing", desc => "Toggle CSS Compositing support",
223 define => "ENABLE_CSS_COMPOSITING", default => isAppleWebKit(), value => \$cssCompositingSupport },
225 { option => "custom-elements", desc => "Toggle custom elements support",
226 define => "ENABLE_CUSTOM_ELEMENTS", default => (isAppleMacWebKit() || isIOSWebKit()), value => \$customElementsSupport },
228 { option => "custom-scheme-handler", desc => "Toggle Custom Scheme Handler support",
229 define => "ENABLE_CUSTOM_SCHEME_HANDLER", default => isEfl(), value => \$customSchemeHandlerSupport },
231 { option => "datalist-element", desc => "Toggle Datalist Element support",
232 define => "ENABLE_DATALIST_ELEMENT", default => isEfl(), value => \$datalistElementSupport },
234 { option => "data-transfer-items", desc => "Toggle Data Transfer Items support",
235 define => "ENABLE_DATA_TRANSFER_ITEMS", default => 0, value => \$dataTransferItemsSupport },
237 { option => "details-element", desc => "Toggle Details Element support",
238 define => "ENABLE_DETAILS_ELEMENT", default => 1, value => \$detailsElementSupport },
240 { option => "device-orientation", desc => "Toggle Device Orientation support",
241 define => "ENABLE_DEVICE_ORIENTATION", default => isIOSWebKit(), value => \$deviceOrientationSupport },
243 { option => "dom4-events-constructor", desc => "Expose DOM4 Events constructors",
244 define => "ENABLE_DOM4_EVENTS_CONSTRUCTOR", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$dom4EventsConstructor },
246 { option => "download-attribute", desc => "Toggle Download Attribute support",
247 define => "ENABLE_DOWNLOAD_ATTRIBUTE", default => (isEfl() || isGtk()), value => \$downloadAttributeSupport },
249 { option => "fetch-api", desc => "Toggle Fetch API support",
250 define => "ENABLE_FETCH_API", default => 1, value => \$fetchAPISupport },
252 { option => "font-load-events", desc => "Toggle Font Load Events support",
253 define => "ENABLE_FONT_LOAD_EVENTS", default => 0, value => \$fontLoadEventsSupport },
255 { option => "ftpdir", desc => "Toggle FTP Directory support",
256 define => "ENABLE_FTPDIR", default => 1, value => \$ftpDirSupport },
258 { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
259 define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isEfl() || isGtk()), value => \$fullscreenAPISupport },
261 { option => "gamepad", desc => "Toggle Gamepad support",
262 define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },
264 { option => "geolocation", desc => "Toggle Geolocation support",
265 define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$geolocationSupport },
267 { option => "high-dpi-canvas", desc => "Toggle High DPI Canvas support",
268 define => "ENABLE_HIGH_DPI_CANVAS", default => (isAppleWebKit()), value => \$highDPICanvasSupport },
270 { option => "icon-database", desc => "Toggle Icondatabase support",
271 define => "ENABLE_ICONDATABASE", default => !isIOSWebKit(), value => \$icondatabaseSupport },
273 { option => "indexed-database", desc => "Toggle Indexed Database support",
274 define => "ENABLE_INDEXED_DATABASE", default => (isAppleMacWebKit() || isEfl() || isGtk()), value => \$indexedDatabaseSupport },
276 { option => "input-speech", desc => "Toggle Input Speech support",
277 define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
279 { option => "input-type-color", desc => "Toggle Input Type Color support",
280 define => "ENABLE_INPUT_TYPE_COLOR", default => (isEfl() || isGtk()), value => \$inputTypeColorSupport },
282 { option => "input-type-date", desc => "Toggle Input Type Date support",
283 define => "ENABLE_INPUT_TYPE_DATE", default => 0, value => \$inputTypeDateSupport },
285 { option => "input-type-datetime", desc => "Toggle broken Input Type Datetime support",
286 define => "ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE", default => 0, value => \$inputTypeDatetimeSupport },
288 { option => "input-type-datetimelocal", desc => "Toggle Input Type Datetimelocal support",
289 define => "ENABLE_INPUT_TYPE_DATETIMELOCAL", default => 0, value => \$inputTypeDatetimelocalSupport },
291 { option => "input-type-month", desc => "Toggle Input Type Month support",
292 define => "ENABLE_INPUT_TYPE_MONTH", default => 0, value => \$inputTypeMonthSupport },
294 { option => "input-type-time", desc => "Toggle Input Type Time support",
295 define => "ENABLE_INPUT_TYPE_TIME", default => 0, value => \$inputTypeTimeSupport },
297 { option => "input-type-week", desc => "Toggle Input Type Week support",
298 define => "ENABLE_INPUT_TYPE_WEEK", default => 0, value => \$inputTypeWeekSupport },
300 { option => "intl", desc => "Toggle Intl support",
301 define => "ENABLE_INTL", default => 1, value => \$intlSupport },
303 { option => "legacy-notifications", desc => "Toggle Legacy Notifications support",
304 define => "ENABLE_LEGACY_NOTIFICATIONS", default => 0, value => \$legacyNotificationsSupport },
306 { option => "legacy-vendor-prefixes", desc => "Toggle Legacy Vendor Prefix support",
307 define => "ENABLE_LEGACY_VENDOR_PREFIXES", default => 1, value => \$legacyVendorPrefixSupport },
309 { option => "legacy-web-audio", desc => "Toggle Legacy Web Audio support",
310 define => "ENABLE_LEGACY_WEB_AUDIO", default => 1, value => \$legacyWebAudioSupport },
312 { option => "link-prefetch", desc => "Toggle Link Prefetch support",
313 define => "ENABLE_LINK_PREFETCH", default => (isGtk() || isEfl()), value => \$linkPrefetchSupport },
315 { option => "jit", desc => "Enable just-in-time JavaScript support",
316 define => "ENABLE_JIT", default => 1, value => \$jitSupport },
318 { option => "mathml", desc => "Toggle MathML support",
319 define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
321 { option => "media-capture", desc => "Toggle Media Capture support",
322 define => "ENABLE_MEDIA_CAPTURE", default => isEfl(), value => \$mediaCaptureSupport },
324 { option => "media-source", desc => "Toggle Media Source support",
325 define => "ENABLE_MEDIA_SOURCE", default => (isGtk() || isEfl()), value => \$mediaSourceSupport },
327 { option => "media-statistics", desc => "Toggle Media Statistics support",
328 define => "ENABLE_MEDIA_STATISTICS", default => 0, value => \$mediaStatisticsSupport },
330 { option => "media-stream", desc => "Toggle Media Stream support",
331 define => "ENABLE_MEDIA_STREAM", default => (isGtk()), value => \$mediaStreamSupport },
333 { option => "web-rtc", desc => "Toggle WebRTC support",
334 define => "ENABLE_WEB_RTC", default => (isGtk()), value => \$webRTCSupport },
336 { option => "meter-element", desc => "Toggle Meter Element support",
337 define => "ENABLE_METER_ELEMENT", default => !isAppleWinWebKit(), value => \$meterElementSupport },
339 { option => "mhtml", desc => "Toggle MHTML support",
340 define => "ENABLE_MHTML", default => (isGtk() || isEfl()), value => \$mhtmlSupport },
342 { option => "mouse-cursor-scale", desc => "Toggle Scaled mouse cursor support",
343 define => "ENABLE_MOUSE_CURSOR_SCALE", default => isEfl(), value => \$mouseCursorScaleSupport },
345 { option => "navigator-content-utils", desc => "Toggle Navigator Content Utils support",
346 define => "ENABLE_NAVIGATOR_CONTENT_UTILS", default => isEfl(), value => \$registerProtocolHandlerSupport },
348 { option => "navigator-hardware-concurrency", desc => "Toggle Navigator hardware concurrenct support",
349 define => "ENABLE_NAVIGATOR_HWCONCURRENCY", default => 1, value => \$hardwareConcurrencySupport },
351 { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
352 define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isIOSWebKit(), value => \$netscapePluginAPISupport },
354 { option => "nosniff", desc => "Toggle support for 'X-Content-Type-Options: nosniff'",
355 define => "ENABLE_NOSNIFF", default => isEfl(), value => \$nosniffSupport },
357 { option => "notifications", desc => "Toggle Notifications support",
358 define => "ENABLE_NOTIFICATIONS", default => isGtk(), value => \$notificationsSupport },
360 { option => "orientation-events", desc => "Toggle Orientation Events support",
361 define => "ENABLE_ORIENTATION_EVENTS", default => isIOSWebKit(), value => \$orientationEventsSupport },
363 { option => "performance-timeline", desc => "Toggle Performance Timeline support",
364 define => "ENABLE_PERFORMANCE_TIMELINE", default => isGtk(), value => \$performanceTimelineSupport },
366 { option => "promises", desc => "Toggle Promise support",
367 define => "ENABLE_PROMISES", default => 1, value => \$promiseSupport },
369 { option => "proximity-events", desc => "Toggle Proximity Events support",
370 define => "ENABLE_PROXIMITY_EVENTS", default => 0, value => \$proximityEventsSupport },
372 { option => "quota", desc => "Toggle Quota support",
373 define => "ENABLE_QUOTA", default => 0, value => \$quotaSupport },
375 { option => "resolution-media-query", desc => "Toggle resolution media query support",
376 define => "ENABLE_RESOLUTION_MEDIA_QUERY", default => isEfl(), value => \$resolutionMediaQuerySupport },
378 { option => "resource-timing", desc => "Toggle Resource Timing support",
379 define => "ENABLE_RESOURCE_TIMING", default => isGtk(), value => \$resourceTimingSupport },
381 { option => "request-animation-frame", desc => "Toggle Request Animation Frame support",
382 define => "ENABLE_REQUEST_ANIMATION_FRAME", default => 1, value => \$requestAnimationFrameSupport },
384 { option => "scripted-speech", desc => "Toggle Scripted Speech support",
385 define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
387 { option => "shadow-dom", desc => "Toggle Shadow DOM support",
388 define => "ENABLE_SHADOW_DOM", default => (isAppleMacWebKit() || isIOSWebKit()), value => \$shadowDOMSupport },
390 { option => "streams-api", desc => "Toggle Streams API support",
391 define => "ENABLE_STREAMS_API", default => 1, value => \$streamsAPISupport },
393 { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
394 define => "ENABLE_SUBTLE_CRYPTO", default => (isGtk() || isEfl() || isAppleMacWebKit() || isIOSWebKit()), value => \$subtleCrypto },
396 { option => "svg-fonts", desc => "Toggle SVG Fonts support",
397 define => "ENABLE_SVG_FONTS", default => 1, value => \$svgFontsSupport },
399 { option => "system-malloc", desc => "Toggle system allocator instead of bmalloc",
400 define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
402 { option => "threaded-compositor", desc => "Toggle threaded compositor support",
403 define => "ENABLE_THREADED_COMPOSITOR", default => 0, value => \$threadedCompositorSupport },
405 { option => "text-autosizing", desc => "Toggle Text Autosizing support",
406 define => "ENABLE_TEXT_AUTOSIZING", default => 0, value => \$textAutosizingSupport },
408 { option => "touch-events", desc => "Toggle Touch Events support",
409 define => "ENABLE_TOUCH_EVENTS", default => (isIOSWebKit() || isEfl() || isGtk()), value => \$touchEventsSupport },
411 { option => "touch-slider", desc => "Toggle Touch Slider support",
412 define => "ENABLE_TOUCH_SLIDER", default => isEfl(), value => \$touchSliderSupport },
414 { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
415 define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
417 { option => "user-timing", desc => "Toggle User Timing support",
418 define => "ENABLE_USER_TIMING", default => isGtk(), value => \$userTimingSupport },
420 { option => "vibration", desc => "Toggle Vibration support",
421 define => "ENABLE_VIBRATION", default => isEfl(), value => \$vibrationSupport },
423 { option => "video", desc => "Toggle Video support",
424 define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoSupport },
426 { option => "video-track", desc => "Toggle Video Track support",
427 define => "ENABLE_VIDEO_TRACK", default => (isAppleWebKit() || isGtk() || isEfl()), value => \$videoTrackSupport },
429 { option => "webgl", desc => "Toggle WebGL support",
430 define => "ENABLE_WEBGL", default => (isAppleMacWebKit() || isIOSWebKit() || isGtk() || isEfl()), value => \$webglSupport },
432 { option => "webassembly", desc => "Toggle WebAssembly support",
433 define => "ENABLE_WEBASSEMBLY", default => 0, value => \$webAssemblySupport },
435 { option => "web-animations", desc => "Toggle Web Animations support",
436 define => "ENABLE_WEB_ANIMATIONS", default => 1, value => \$webAnimationsSupport },
438 { option => "web-audio", desc => "Toggle Web Audio support",
439 define => "ENABLE_WEB_AUDIO", default => (isEfl() || isGtk()), value => \$webAudioSupport },
441 { option => "web-replay", desc => "Toggle Web Replay support",
442 define => "ENABLE_WEB_REPLAY", default => isAppleMacWebKit(), value => \$webReplaySupport },
444 { option => "web-sockets", desc => "Toggle Web Sockets support",
445 define => "ENABLE_WEB_SOCKETS", default => 1, value => \$webSocketsSupport },
447 { option => "web-timing", desc => "Toggle Web Timing support",
448 define => "ENABLE_WEB_TIMING", default => 1, value => \$webTimingSupport },
450 { option => "xslt", desc => "Toggle XSLT support",
451 define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
453 { option => "ftl-jit", desc => "Toggle FTLJIT support",
454 define => "ENABLE_FTL_JIT", default => (isX86_64() && (isGtk() || isEfl())) , value => \$ftlJITSupport },
457 sub getFeatureOptionList()