PageRenderTime 49ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/src/qt/qtwebkit/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp

https://gitlab.com/x33n/phantomjs
C++ | 213 lines | 144 code | 40 blank | 29 comment | 6 complexity | 2ca4c2c1972728815d8c03e578c0f4ce MD5 | raw file
  1. /*
  2. * Copyright (C) 2009 Google Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are
  6. * met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above
  11. * copyright notice, this list of conditions and the following disclaimer
  12. * in the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Google Inc. nor the names of its
  15. * contributors may be used to endorse or promote products derived from
  16. * this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. */
  30. #include "config.h"
  31. #include "RuntimeEnabledFeatures.h"
  32. #include "DatabaseManager.h"
  33. #include "MediaPlayer.h"
  34. #include "SharedWorkerRepository.h"
  35. #include "WebSocket.h"
  36. #if ENABLE(FILE_SYSTEM)
  37. #include "AsyncFileSystem.h"
  38. #endif
  39. namespace WebCore {
  40. bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
  41. bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
  42. bool RuntimeEnabledFeatures::isWebkitNotificationsEnabled = false;
  43. bool RuntimeEnabledFeatures::isApplicationCacheEnabled = true;
  44. bool RuntimeEnabledFeatures::isDataTransferItemsEnabled = true;
  45. bool RuntimeEnabledFeatures::isGeolocationEnabled = true;
  46. bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
  47. bool RuntimeEnabledFeatures::isTouchEnabled = true;
  48. bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true;
  49. bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
  50. bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
  51. bool RuntimeEnabledFeatures::isCSSExclusionsEnabled = true;
  52. bool RuntimeEnabledFeatures::isCSSShapesEnabled = true;
  53. bool RuntimeEnabledFeatures::isCSSRegionsEnabled = false;
  54. bool RuntimeEnabledFeatures::isCSSCompositingEnabled = false;
  55. bool RuntimeEnabledFeatures::isLangAttributeAwareFormControlUIEnabled = false;
  56. #if ENABLE(SCRIPTED_SPEECH)
  57. bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false;
  58. #endif
  59. #if ENABLE(MEDIA_STREAM)
  60. bool RuntimeEnabledFeatures::isMediaStreamEnabled = true;
  61. bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true;
  62. #endif
  63. #if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
  64. bool RuntimeEnabledFeatures::isLegacyCSSVendorPrefixesEnabled = false;
  65. #endif
  66. #if ENABLE(FILE_SYSTEM)
  67. bool RuntimeEnabledFeatures::isFileSystemEnabled = false;
  68. bool RuntimeEnabledFeatures::fileSystemEnabled()
  69. {
  70. return isFileSystemEnabled && AsyncFileSystem::isAvailable();
  71. }
  72. #endif
  73. #if ENABLE(JAVASCRIPT_I18N_API)
  74. bool RuntimeEnabledFeatures::isJavaScriptI18NAPIEnabled = false;
  75. bool RuntimeEnabledFeatures::javaScriptI18NAPIEnabled()
  76. {
  77. return isJavaScriptI18NAPIEnabled;
  78. }
  79. #endif
  80. #if ENABLE(VIDEO)
  81. bool RuntimeEnabledFeatures::audioEnabled()
  82. {
  83. return MediaPlayer::isAvailable();
  84. }
  85. bool RuntimeEnabledFeatures::htmlMediaElementEnabled()
  86. {
  87. return MediaPlayer::isAvailable();
  88. }
  89. bool RuntimeEnabledFeatures::htmlAudioElementEnabled()
  90. {
  91. return MediaPlayer::isAvailable();
  92. }
  93. bool RuntimeEnabledFeatures::htmlVideoElementEnabled()
  94. {
  95. return MediaPlayer::isAvailable();
  96. }
  97. bool RuntimeEnabledFeatures::htmlSourceElementEnabled()
  98. {
  99. return MediaPlayer::isAvailable();
  100. }
  101. bool RuntimeEnabledFeatures::mediaControllerEnabled()
  102. {
  103. return MediaPlayer::isAvailable();
  104. }
  105. bool RuntimeEnabledFeatures::mediaErrorEnabled()
  106. {
  107. return MediaPlayer::isAvailable();
  108. }
  109. bool RuntimeEnabledFeatures::timeRangesEnabled()
  110. {
  111. return MediaPlayer::isAvailable();
  112. }
  113. #endif
  114. #if ENABLE(SHARED_WORKERS)
  115. bool RuntimeEnabledFeatures::sharedWorkerEnabled()
  116. {
  117. return SharedWorkerRepository::isAvailable();
  118. }
  119. #endif
  120. #if ENABLE(WEB_SOCKETS)
  121. bool RuntimeEnabledFeatures::webSocketEnabled()
  122. {
  123. return WebSocket::isAvailable();
  124. }
  125. #endif
  126. #if ENABLE(VIDEO_TRACK)
  127. #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(QT)
  128. bool RuntimeEnabledFeatures::isVideoTrackEnabled = true;
  129. #else
  130. bool RuntimeEnabledFeatures::isVideoTrackEnabled = false;
  131. #endif
  132. #endif
  133. #if ENABLE(SHADOW_DOM)
  134. bool RuntimeEnabledFeatures::isShadowDOMEnabled = false;
  135. bool RuntimeEnabledFeatures::isAuthorShadowDOMForAnyElementEnabled = false;
  136. #endif
  137. #if ENABLE(CUSTOM_ELEMENTS)
  138. bool RuntimeEnabledFeatures::isCustomDOMElementsEnabled = false;
  139. #endif
  140. #if ENABLE(STYLE_SCOPED)
  141. bool RuntimeEnabledFeatures::isStyleScopedEnabled = false;
  142. #endif
  143. #if ENABLE(INPUT_TYPE_DATE)
  144. bool RuntimeEnabledFeatures::isInputTypeDateEnabled = true;
  145. #endif
  146. #if ENABLE(INPUT_TYPE_DATETIME_INCOMPLETE)
  147. bool RuntimeEnabledFeatures::isInputTypeDateTimeEnabled = false;
  148. #endif
  149. #if ENABLE(INPUT_TYPE_DATETIMELOCAL)
  150. bool RuntimeEnabledFeatures::isInputTypeDateTimeLocalEnabled = true;
  151. #endif
  152. #if ENABLE(INPUT_TYPE_MONTH)
  153. bool RuntimeEnabledFeatures::isInputTypeMonthEnabled = true;
  154. #endif
  155. #if ENABLE(INPUT_TYPE_TIME)
  156. bool RuntimeEnabledFeatures::isInputTypeTimeEnabled = true;
  157. #endif
  158. #if ENABLE(INPUT_TYPE_WEEK)
  159. bool RuntimeEnabledFeatures::isInputTypeWeekEnabled = true;
  160. #endif
  161. #if ENABLE(DIALOG_ELEMENT)
  162. bool RuntimeEnabledFeatures::isDialogElementEnabled = false;
  163. #endif
  164. #if ENABLE(CSP_NEXT)
  165. bool RuntimeEnabledFeatures::areExperimentalContentSecurityPolicyFeaturesEnabled = false;
  166. #endif
  167. #if ENABLE(IFRAME_SEAMLESS)
  168. bool RuntimeEnabledFeatures::areSeamlessIFramesEnabled = false;
  169. #endif
  170. #if ENABLE(FONT_LOAD_EVENTS)
  171. bool RuntimeEnabledFeatures::isFontLoadEventsEnabled = false;
  172. #endif
  173. } // namespace WebCore