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