/platform/external/webkit/WebCore/bindings/v8/V8Index.cpp

https://github.com/aharish/totoro-gb-opensource-update2 · C++ · 488 lines · 430 code · 27 blank · 31 comment · 2 complexity · d7ce0d3c77ab273810571cfee9521b50 MD5 · raw file

  1. /*
  2. * Copyright (C) 2008, 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 "V8Index.h"
  32. #include "V8Attr.h"
  33. #include "V8BarInfo.h"
  34. #include "V8BeforeLoadEvent.h"
  35. #include "V8Blob.h"
  36. #include "V8WebGLActiveInfo.h"
  37. #include "V8CanvasRenderingContext.h"
  38. #include "V8CanvasRenderingContext2D.h"
  39. #include "V8CanvasGradient.h"
  40. #include "V8CanvasPattern.h"
  41. #include "V8CanvasPixelArray.h"
  42. #include "V8CDATASection.h"
  43. #include "V8CharacterData.h"
  44. #include "V8ClientRect.h"
  45. #include "V8ClientRectList.h"
  46. #include "V8Clipboard.h"
  47. #include "V8Comment.h"
  48. #include "V8CompositionEvent.h"
  49. #include "V8Console.h"
  50. #include "V8Counter.h"
  51. #include "V8CSSStyleDeclaration.h"
  52. #include "V8CSSRule.h"
  53. #include "V8CSSStyleRule.h"
  54. #include "V8CSSCharsetRule.h"
  55. #include "V8CSSImportRule.h"
  56. #include "V8CSSMediaRule.h"
  57. #include "V8CSSFontFaceRule.h"
  58. #include "V8CSSPageRule.h"
  59. #include "V8CSSRuleList.h"
  60. #include "V8CSSPrimitiveValue.h"
  61. #include "V8CSSValue.h"
  62. #include "V8CSSValueList.h"
  63. #include "V8CSSStyleSheet.h"
  64. #include "V8CSSVariablesDeclaration.h"
  65. #include "V8CSSVariablesRule.h"
  66. #include "V8DataGridColumn.h"
  67. #include "V8DataGridColumnList.h"
  68. #include "V8Document.h"
  69. #include "V8DocumentFragment.h"
  70. #include "V8DocumentType.h"
  71. #include "V8Element.h"
  72. #include "V8Entity.h"
  73. #include "V8EntityReference.h"
  74. #include "V8File.h"
  75. #include "V8FileList.h"
  76. #include "V8History.h"
  77. #include "V8HTMLAllCollection.h"
  78. #include "V8HTMLCanvasElement.h"
  79. #include "V8HTMLCollection.h"
  80. #include "V8HTMLDocument.h"
  81. #include "V8HTMLElement.h"
  82. #include "V8HTMLOptionsCollection.h"
  83. #include "V8HTMLAnchorElement.h"
  84. #include "V8HTMLAppletElement.h"
  85. #include "V8HTMLAreaElement.h"
  86. #include "V8HTMLBaseElement.h"
  87. #include "V8HTMLBaseFontElement.h"
  88. #include "V8HTMLBlockquoteElement.h"
  89. #include "V8HTMLBodyElement.h"
  90. #include "V8HTMLBRElement.h"
  91. #include "V8HTMLButtonElement.h"
  92. #include "V8HTMLCanvasElement.h"
  93. #include "V8HTMLModElement.h"
  94. #include "V8HTMLDataGridCellElement.h"
  95. #include "V8HTMLDataGridColElement.h"
  96. #include "V8HTMLDataGridElement.h"
  97. #include "V8HTMLDataGridRowElement.h"
  98. #include "V8HTMLDirectoryElement.h"
  99. #include "V8HTMLDivElement.h"
  100. #include "V8HTMLDListElement.h"
  101. #include "V8HTMLEmbedElement.h"
  102. #include "V8HTMLFieldSetElement.h"
  103. #include "V8HTMLFormElement.h"
  104. #include "V8HTMLFontElement.h"
  105. #include "V8HTMLFrameElement.h"
  106. #include "V8HTMLFrameSetElement.h"
  107. #include "V8HTMLHeadingElement.h"
  108. #include "V8HTMLHeadElement.h"
  109. #include "V8HTMLHRElement.h"
  110. #include "V8HTMLHtmlElement.h"
  111. #include "V8HTMLIFrameElement.h"
  112. #include "V8HTMLImageElement.h"
  113. #include "V8HTMLImageElementConstructor.h"
  114. #include "V8HTMLInputElement.h"
  115. #include "V8HTMLIsIndexElement.h"
  116. #include "V8HTMLLabelElement.h"
  117. #include "V8HTMLLegendElement.h"
  118. #include "V8HTMLLIElement.h"
  119. #include "V8HTMLLinkElement.h"
  120. #include "V8HTMLMapElement.h"
  121. #include "V8HTMLMarqueeElement.h"
  122. #include "V8HTMLMenuElement.h"
  123. #include "V8HTMLMetaElement.h"
  124. #include "V8HTMLObjectElement.h"
  125. #include "V8HTMLOListElement.h"
  126. #include "V8HTMLOptGroupElement.h"
  127. #include "V8HTMLOptionElement.h"
  128. #include "V8HTMLOptionElementConstructor.h"
  129. #include "V8HTMLParagraphElement.h"
  130. #include "V8HTMLParamElement.h"
  131. #include "V8HTMLPreElement.h"
  132. #include "V8HTMLQuoteElement.h"
  133. #include "V8HTMLScriptElement.h"
  134. #include "V8HTMLSelectElement.h"
  135. #include "V8HTMLStyleElement.h"
  136. #include "V8HTMLTableCaptionElement.h"
  137. #include "V8HTMLTableColElement.h"
  138. #include "V8HTMLTableElement.h"
  139. #include "V8HTMLTableSectionElement.h"
  140. #include "V8HTMLTableCellElement.h"
  141. #include "V8HTMLTableRowElement.h"
  142. #include "V8HTMLTextAreaElement.h"
  143. #include "V8HTMLTitleElement.h"
  144. #include "V8HTMLUListElement.h"
  145. #include "V8ImageData.h"
  146. #include "V8Media.h"
  147. #include "V8MediaList.h"
  148. #include "V8MessageChannel.h"
  149. #include "V8MessageEvent.h"
  150. #include "V8MessagePort.h"
  151. #include "V8NamedNodeMap.h"
  152. #include "V8Node.h"
  153. #include "V8NodeList.h"
  154. #include "V8NodeFilter.h"
  155. #include "V8Notation.h"
  156. #include "V8PopStateEvent.h"
  157. #include "V8ProcessingInstruction.h"
  158. #include "V8ProgressEvent.h"
  159. #include "V8StyleSheet.h"
  160. #include "V8Text.h"
  161. #include "V8TextEvent.h"
  162. #include "V8Touch.h"
  163. #include "V8TouchEvent.h"
  164. #include "V8TouchList.h"
  165. #include "V8DOMCoreException.h"
  166. #include "V8DOMParser.h"
  167. #include "V8DOMWindow.h"
  168. #include "V8ErrorEvent.h"
  169. #include "V8Event.h"
  170. #include "V8EventException.h"
  171. #include "V8KeyboardEvent.h"
  172. #include "V8MouseEvent.h"
  173. #include "V8ValidityState.h"
  174. #include "V8WebKitAnimationEvent.h"
  175. #include "V8WebKitCSSKeyframeRule.h"
  176. #include "V8WebKitCSSKeyframesRule.h"
  177. #include "V8WebKitCSSMatrix.h"
  178. #include "V8WebKitCSSTransformValue.h"
  179. #include "V8WebKitPoint.h"
  180. #include "V8WebKitTransitionEvent.h"
  181. #include "V8WheelEvent.h"
  182. #include "V8UIEvent.h"
  183. #include "V8MutationEvent.h"
  184. #include "V8OverflowEvent.h"
  185. #include "V8Location.h"
  186. #include "V8Screen.h"
  187. #include "V8DOMSelection.h"
  188. #include "V8Navigator.h"
  189. #include "V8MimeType.h"
  190. #include "V8MimeTypeArray.h"
  191. #include "V8PageTransitionEvent.h"
  192. #include "V8Plugin.h"
  193. #include "V8PluginArray.h"
  194. #include "V8Range.h"
  195. #include "V8RangeException.h"
  196. #include "V8Rect.h"
  197. #include "V8NodeIterator.h"
  198. #include "V8TextMetrics.h"
  199. #include "V8TreeWalker.h"
  200. #include "V8StyleSheetList.h"
  201. #include "V8DOMImplementation.h"
  202. #include "V8XMLHttpRequest.h"
  203. #include "V8XMLHttpRequestException.h"
  204. #include "V8XMLHttpRequestProgressEvent.h"
  205. #include "V8XMLHttpRequestUpload.h"
  206. #include "V8XMLSerializer.h"
  207. #include "V8RGBColor.h"
  208. #if ENABLE(OFFLINE_WEB_APPLICATIONS)
  209. #include "V8DOMApplicationCache.h"
  210. #endif
  211. #if ENABLE(DOM_STORAGE)
  212. #include "V8Storage.h"
  213. #include "V8StorageEvent.h"
  214. #endif
  215. #if ENABLE(SVG_ANIMATION)
  216. #include "V8SVGAnimateColorElement.h"
  217. #include "V8SVGAnimateElement.h"
  218. #include "V8SVGAnimateTransformElement.h"
  219. #include "V8SVGAnimationElement.h"
  220. #include "V8SVGSetElement.h"
  221. #endif
  222. #if ENABLE(SVG) && ENABLE(FILTERS)
  223. #include "V8SVGComponentTransferFunctionElement.h"
  224. #include "V8SVGFEBlendElement.h"
  225. #include "V8SVGFEColorMatrixElement.h"
  226. #include "V8SVGFEComponentTransferElement.h"
  227. #include "V8SVGFECompositeElement.h"
  228. #include "V8SVGFEDiffuseLightingElement.h"
  229. #include "V8SVGFEDisplacementMapElement.h"
  230. #include "V8SVGFEDistantLightElement.h"
  231. #include "V8SVGFEFloodElement.h"
  232. #include "V8SVGFEFuncAElement.h"
  233. #include "V8SVGFEFuncBElement.h"
  234. #include "V8SVGFEFuncGElement.h"
  235. #include "V8SVGFEFuncRElement.h"
  236. #include "V8SVGFEGaussianBlurElement.h"
  237. #include "V8SVGFEImageElement.h"
  238. #include "V8SVGFEMergeElement.h"
  239. #include "V8SVGFEMergeNodeElement.h"
  240. #include "V8SVGFEMorphologyElement.h"
  241. #include "V8SVGFEOffsetElement.h"
  242. #include "V8SVGFEPointLightElement.h"
  243. #include "V8SVGFESpecularLightingElement.h"
  244. #include "V8SVGFESpotLightElement.h"
  245. #include "V8SVGFETileElement.h"
  246. #include "V8SVGFETurbulenceElement.h"
  247. #include "V8SVGFilterElement.h"
  248. #endif
  249. #if ENABLE(SVG_FONTS)
  250. #include "V8SVGFontElement.h"
  251. #include "V8SVGFontFaceElement.h"
  252. #include "V8SVGFontFaceFormatElement.h"
  253. #include "V8SVGFontFaceNameElement.h"
  254. #include "V8SVGFontFaceSrcElement.h"
  255. #include "V8SVGFontFaceUriElement.h"
  256. #include "V8SVGMissingGlyphElement.h"
  257. #endif
  258. #if ENABLE(SVG_FOREIGN_OBJECT)
  259. #include "V8SVGForeignObjectElement.h"
  260. #endif
  261. #if ENABLE(SVG_USE)
  262. #include "V8SVGUseElement.h"
  263. #endif
  264. #if ENABLE(SVG)
  265. #include "V8SVGAElement.h"
  266. #include "V8SVGAltGlyphElement.h"
  267. #include "V8SVGCircleElement.h"
  268. #include "V8SVGClipPathElement.h"
  269. #include "V8SVGCursorElement.h"
  270. #include "V8SVGDefsElement.h"
  271. #include "V8SVGDescElement.h"
  272. #include "V8SVGElement.h"
  273. #include "V8SVGEllipseElement.h"
  274. #include "V8SVGException.h"
  275. #include "V8SVGGElement.h"
  276. #include "V8SVGGlyphElement.h"
  277. #include "V8SVGGradientElement.h"
  278. #include "V8SVGImageElement.h"
  279. #include "V8SVGLinearGradientElement.h"
  280. #include "V8SVGLineElement.h"
  281. #include "V8SVGMarkerElement.h"
  282. #include "V8SVGMaskElement.h"
  283. #include "V8SVGMetadataElement.h"
  284. #include "V8SVGPathElement.h"
  285. #include "V8SVGPatternElement.h"
  286. #include "V8SVGPolygonElement.h"
  287. #include "V8SVGPolylineElement.h"
  288. #include "V8SVGRadialGradientElement.h"
  289. #include "V8SVGRectElement.h"
  290. #include "V8SVGScriptElement.h"
  291. #include "V8SVGStopElement.h"
  292. #include "V8SVGStyleElement.h"
  293. #include "V8SVGSVGElement.h"
  294. #include "V8SVGSwitchElement.h"
  295. #include "V8SVGSymbolElement.h"
  296. #include "V8SVGTextContentElement.h"
  297. #include "V8SVGTextElement.h"
  298. #include "V8SVGTextPathElement.h"
  299. #include "V8SVGTextPositioningElement.h"
  300. #include "V8SVGTitleElement.h"
  301. #include "V8SVGTRefElement.h"
  302. #include "V8SVGTSpanElement.h"
  303. #include "V8SVGViewElement.h"
  304. #include "V8SVGAngle.h"
  305. #include "V8SVGAnimatedAngle.h"
  306. #include "V8SVGAnimatedBoolean.h"
  307. #include "V8SVGAnimatedEnumeration.h"
  308. #include "V8SVGAnimatedInteger.h"
  309. #include "V8SVGAnimatedLength.h"
  310. #include "V8SVGAnimatedLengthList.h"
  311. #include "V8SVGAnimatedNumber.h"
  312. #include "V8SVGAnimatedNumberList.h"
  313. #include "V8SVGAnimatedPoints.h"
  314. #include "V8SVGAnimatedPreserveAspectRatio.h"
  315. #include "V8SVGAnimatedRect.h"
  316. #include "V8SVGAnimatedString.h"
  317. #include "V8SVGAnimatedTransformList.h"
  318. #include "V8SVGColor.h"
  319. #include "V8SVGDocument.h"
  320. #include "V8SVGElementInstance.h"
  321. #include "V8SVGElementInstanceList.h"
  322. #include "V8SVGLength.h"
  323. #include "V8SVGLengthList.h"
  324. #include "V8SVGMatrix.h"
  325. #include "V8SVGNumber.h"
  326. #include "V8SVGNumberList.h"
  327. #include "V8SVGPaint.h"
  328. #include "V8SVGPathSeg.h"
  329. #include "V8SVGPathSegArcAbs.h"
  330. #include "V8SVGPathSegArcRel.h"
  331. #include "V8SVGPathSegClosePath.h"
  332. #include "V8SVGPathSegCurvetoCubicAbs.h"
  333. #include "V8SVGPathSegCurvetoCubicRel.h"
  334. #include "V8SVGPathSegCurvetoCubicSmoothAbs.h"
  335. #include "V8SVGPathSegCurvetoCubicSmoothRel.h"
  336. #include "V8SVGPathSegCurvetoQuadraticAbs.h"
  337. #include "V8SVGPathSegCurvetoQuadraticRel.h"
  338. #include "V8SVGPathSegCurvetoQuadraticSmoothAbs.h"
  339. #include "V8SVGPathSegCurvetoQuadraticSmoothRel.h"
  340. #include "V8SVGPathSegLinetoAbs.h"
  341. #include "V8SVGPathSegLinetoHorizontalAbs.h"
  342. #include "V8SVGPathSegLinetoHorizontalRel.h"
  343. #include "V8SVGPathSegLinetoRel.h"
  344. #include "V8SVGPathSegLinetoVerticalAbs.h"
  345. #include "V8SVGPathSegLinetoVerticalRel.h"
  346. #include "V8SVGPathSegList.h"
  347. #include "V8SVGPathSegMovetoAbs.h"
  348. #include "V8SVGPathSegMovetoRel.h"
  349. #include "V8SVGPoint.h"
  350. #include "V8SVGPointList.h"
  351. #include "V8SVGPreserveAspectRatio.h"
  352. #include "V8SVGRect.h"
  353. #include "V8SVGRenderingIntent.h"
  354. #include "V8SVGStringList.h"
  355. #include "V8SVGTransform.h"
  356. #include "V8SVGTransformList.h"
  357. #include "V8SVGUnitTypes.h"
  358. #include "V8SVGZoomEvent.h"
  359. #endif
  360. #if ENABLE(VIDEO)
  361. #include "V8HTMLAudioElement.h"
  362. #include "V8HTMLAudioElementConstructor.h"
  363. #include "V8HTMLMediaElement.h"
  364. #include "V8HTMLSourceElement.h"
  365. #include "V8HTMLVideoElement.h"
  366. #include "V8MediaError.h"
  367. #include "V8TimeRanges.h"
  368. #endif
  369. #if ENABLE(WEB_SOCKETS)
  370. #include "V8WebSocket.h"
  371. #endif
  372. #if ENABLE(WORKERS)
  373. #include "V8AbstractWorker.h"
  374. #include "V8DedicatedWorkerContext.h"
  375. #include "V8Worker.h"
  376. #include "V8WorkerContext.h"
  377. #include "V8WorkerLocation.h"
  378. #include "V8WorkerNavigator.h"
  379. #endif
  380. #if ENABLE(NOTIFICATIONS)
  381. #include "V8Notification.h"
  382. #include "V8NotificationCenter.h"
  383. #endif
  384. #if ENABLE(SHARED_WORKERS)
  385. #include "V8SharedWorker.h"
  386. #include "V8SharedWorkerContext.h"
  387. #endif
  388. #if ENABLE(3D_CANVAS)
  389. #include "V8WebGLRenderingContext.h"
  390. #include "V8WebGLArrayBuffer.h"
  391. #include "V8WebGLArray.h"
  392. #include "V8WebGLByteArray.h"
  393. #include "V8WebGLBuffer.h"
  394. #include "V8WebGLContextAttributes.h"
  395. #include "V8WebGLFloatArray.h"
  396. #include "V8WebGLFramebuffer.h"
  397. #include "V8WebGLIntArray.h"
  398. #include "V8WebGLProgram.h"
  399. #include "V8WebGLRenderbuffer.h"
  400. #include "V8WebGLShader.h"
  401. #include "V8WebGLShortArray.h"
  402. #include "V8WebGLTexture.h"
  403. #include "V8WebGLUniformLocation.h"
  404. #include "V8WebGLUnsignedByteArray.h"
  405. #include "V8WebGLUnsignedIntArray.h"
  406. #include "V8WebGLUnsignedShortArray.h"
  407. #endif
  408. #if ENABLE(DATABASE)
  409. #include "V8Database.h"
  410. #include "V8SQLError.h"
  411. #include "V8SQLResultSet.h"
  412. #include "V8SQLResultSetRowList.h"
  413. #include "V8SQLTransaction.h"
  414. #endif
  415. #if ENABLE(INDEXED_DATABASE)
  416. #include "V8IDBDatabaseError.h"
  417. #include "V8IDBDatabaseException.h"
  418. #include "V8IDBRequest.h"
  419. #include "V8IndexedDatabaseRequest.h"
  420. #endif
  421. #if ENABLE(XPATH)
  422. #include "V8XPathResult.h"
  423. #include "V8XPathException.h"
  424. #include "V8XPathExpression.h"
  425. #include "V8XPathNSResolver.h"
  426. #include "V8XPathEvaluator.h"
  427. #endif
  428. #if ENABLE(XSLT)
  429. #include "V8XSLTProcessor.h"
  430. #endif
  431. #if ENABLE(INSPECTOR)
  432. #include "V8InjectedScriptHost.h"
  433. #include "V8InspectorBackend.h"
  434. #include "V8InspectorFrontendHost.h"
  435. #endif
  436. #if ENABLE(EVENTSOURCE)
  437. #include "V8EventSource.h"
  438. #endif
  439. // Geolocation
  440. #include "V8Coordinates.h"
  441. #include "V8Geolocation.h"
  442. #include "V8Geoposition.h"
  443. #include "V8PositionError.h"
  444. #if PLATFORM(ANDROID)
  445. // Temporary modification - will not be upstreamed
  446. #include "V8Connection.h"
  447. #endif // PLATFORM(ANDROID)
  448. namespace WebCore {
  449. v8::Persistent<v8::FunctionTemplate> V8ClassIndex::getTemplate(V8WrapperType type)
  450. {
  451. switch (type) {
  452. #define MAKE_CASE(type, name)\
  453. case V8ClassIndex::type: return V8##name::GetTemplate();
  454. WRAPPER_TYPES(MAKE_CASE)
  455. #undef MAKE_CASE
  456. default:
  457. ASSERT_NOT_REACHED();
  458. return v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
  459. }
  460. }
  461. } // namespace WebCore