| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8_CUSTOM_H__ | |
| 6 #define V8_CUSTOM_H__ | |
| 7 | |
| 8 #include <v8.h> | |
| 9 #include "v8_index.h" | |
| 10 | |
| 11 struct NPObject; | |
| 12 | |
| 13 #define CALLBACK_FUNC_DECL(NAME) \ | |
| 14 v8::Handle<v8::Value> V8Custom::v8##NAME##Callback(const v8::Arguments& args) | |
| 15 | |
| 16 #define ACCESSOR_GETTER(NAME) \ | |
| 17 v8::Handle<v8::Value> V8Custom::v8##NAME##AccessorGetter(\ | |
| 18 v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 19 | |
| 20 #define ACCESSOR_SETTER(NAME) \ | |
| 21 void V8Custom::v8##NAME##AccessorSetter(v8::Local<v8::String> name, \ | |
| 22 v8::Local<v8::Value> value, \ | |
| 23 const v8::AccessorInfo& info) | |
| 24 | |
| 25 #define INDEXED_PROPERTY_GETTER(NAME) \ | |
| 26 v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertyGetter(\ | |
| 27 uint32_t index, const v8::AccessorInfo& info) | |
| 28 | |
| 29 #define INDEXED_PROPERTY_SETTER(NAME) \ | |
| 30 v8::Handle<v8::Value> V8Custom::v8##NAME##IndexedPropertySetter(\ | |
| 31 uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info) | |
| 32 | |
| 33 #define INDEXED_PROPERTY_DELETER(NAME) \ | |
| 34 v8::Handle<v8::Boolean> V8Custom::v8##NAME##IndexedPropertyDeleter(\ | |
| 35 uint32_t index, const v8::AccessorInfo& info) | |
| 36 | |
| 37 #define NAMED_PROPERTY_GETTER(NAME) \ | |
| 38 v8::Handle<v8::Value> V8Custom::v8##NAME##NamedPropertyGetter(\ | |
| 39 v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 40 | |
| 41 #define NAMED_PROPERTY_SETTER(NAME) \ | |
| 42 v8::Handle<v8::Value> V8Custom::v8##NAME##NamedPropertySetter(\ | |
| 43 v8::Local<v8::String> name, v8::Local<v8::Value> value, \ | |
| 44 const v8::AccessorInfo& info) | |
| 45 | |
| 46 #define NAMED_PROPERTY_DELETER(NAME) \ | |
| 47 v8::Handle<v8::Boolean> V8Custom::v8##NAME##NamedPropertyDeleter(\ | |
| 48 v8::Local<v8::String> name, const v8::AccessorInfo& info) | |
| 49 | |
| 50 #define NAMED_ACCESS_CHECK(NAME) \ | |
| 51 bool V8Custom::v8##NAME##NamedSecurityCheck(v8::Local<v8::Object> host, \ | |
| 52 v8::Local<v8::Value> key, \ | |
| 53 v8::AccessType type, \ | |
| 54 v8::Local<v8::Value> data) | |
| 55 | |
| 56 #define INDEXED_ACCESS_CHECK(NAME) \ | |
| 57 bool V8Custom::v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \ | |
| 58 uint32_t index, \ | |
| 59 v8::AccessType type, \ | |
| 60 v8::Local<v8::Value> data) | |
| 61 | |
| 62 namespace WebCore { | |
| 63 | |
| 64 class Frame; | |
| 65 class V8Proxy; | |
| 66 class String; | |
| 67 class HTMLCollection; | |
| 68 class DOMWindow; | |
| 69 | |
| 70 class V8Custom { | |
| 71 public: | |
| 72 | |
| 73 // Constants. | |
| 74 static const int kDOMWrapperTypeIndex = 0; | |
| 75 static const int kDOMWrapperObjectIndex = 1; | |
| 76 static const int kDefaultWrapperInternalFieldCount = 2; | |
| 77 | |
| 78 static const int kNPObjectInternalFieldCount = | |
| 79 kDefaultWrapperInternalFieldCount + 0; | |
| 80 | |
| 81 static const int kDocumentImplementationIndex = | |
| 82 kDefaultWrapperInternalFieldCount + 0; | |
| 83 static const int kDocumentMinimumInternalFieldCount = | |
| 84 kDefaultWrapperInternalFieldCount + 1; | |
| 85 | |
| 86 static const int kHTMLDocumentMarkerIndex = | |
| 87 kDocumentMinimumInternalFieldCount + 0; | |
| 88 static const int kHTMLDocumentShadowIndex = | |
| 89 kDocumentMinimumInternalFieldCount + 1; | |
| 90 static const int kHTMLDocumentInternalFieldCount = | |
| 91 kDocumentMinimumInternalFieldCount + 2; | |
| 92 | |
| 93 static const int kXMLHttpRequestCacheIndex = | |
| 94 kDefaultWrapperInternalFieldCount + 0; | |
| 95 static const int kXMLHttpRequestInternalFieldCount = | |
| 96 kDefaultWrapperInternalFieldCount + 1; | |
| 97 | |
| 98 static const int kMessageChannelPort1Index = | |
| 99 kDefaultWrapperInternalFieldCount + 0; | |
| 100 static const int kMessageChannelPort2Index = | |
| 101 kDefaultWrapperInternalFieldCount + 1; | |
| 102 static const int kMessageChannelInternalFieldCount = | |
| 103 kDefaultWrapperInternalFieldCount + 2; | |
| 104 | |
| 105 static const int kMessagePortRequestCacheIndex = | |
| 106 kDefaultWrapperInternalFieldCount + 0; | |
| 107 static const int kMessagePortEntangledPortIndex = | |
| 108 kDefaultWrapperInternalFieldCount + 1; | |
| 109 static const int kMessagePortInternalFieldCount = | |
| 110 kDefaultWrapperInternalFieldCount + 2; | |
| 111 | |
| 112 #if ENABLE(WORKERS) | |
| 113 static const int kWorkerRequestCacheIndex = | |
| 114 kDefaultWrapperInternalFieldCount + 0; | |
| 115 static const int kWorkerInternalFieldCount = | |
| 116 kDefaultWrapperInternalFieldCount + 1; | |
| 117 | |
| 118 static const int kWorkerContextRequestCacheIndex = | |
| 119 kDefaultWrapperInternalFieldCount + 0; | |
| 120 static const int kWorkerContextInternalFieldCount = | |
| 121 kDefaultWrapperInternalFieldCount + 1; | |
| 122 #endif | |
| 123 | |
| 124 static const int kDOMWindowConsoleIndex = | |
| 125 kDefaultWrapperInternalFieldCount + 0; | |
| 126 static const int kDOMWindowHistoryIndex = | |
| 127 kDefaultWrapperInternalFieldCount + 1; | |
| 128 static const int kDOMWindowLocationbarIndex = | |
| 129 kDefaultWrapperInternalFieldCount + 2; | |
| 130 static const int kDOMWindowMenubarIndex = | |
| 131 kDefaultWrapperInternalFieldCount + 3; | |
| 132 static const int kDOMWindowNavigatorIndex = | |
| 133 kDefaultWrapperInternalFieldCount + 4; | |
| 134 static const int kDOMWindowPersonalbarIndex = | |
| 135 kDefaultWrapperInternalFieldCount + 5; | |
| 136 static const int kDOMWindowScreenIndex = | |
| 137 kDefaultWrapperInternalFieldCount + 6; | |
| 138 static const int kDOMWindowScrollbarsIndex = | |
| 139 kDefaultWrapperInternalFieldCount + 7; | |
| 140 static const int kDOMWindowSelectionIndex = | |
| 141 kDefaultWrapperInternalFieldCount + 8; | |
| 142 static const int kDOMWindowStatusbarIndex = | |
| 143 kDefaultWrapperInternalFieldCount + 9; | |
| 144 static const int kDOMWindowToolbarIndex = | |
| 145 kDefaultWrapperInternalFieldCount + 10; | |
| 146 static const int kDOMWindowLocationIndex = | |
| 147 kDefaultWrapperInternalFieldCount + 11; | |
| 148 static const int kDOMWindowDOMSelectionIndex = | |
| 149 kDefaultWrapperInternalFieldCount + 12; | |
| 150 static const int kDOMWindowInternalFieldCount = | |
| 151 kDefaultWrapperInternalFieldCount + 13; | |
| 152 | |
| 153 static const int kStyleSheetOwnerNodeIndex = | |
| 154 kDefaultWrapperInternalFieldCount + 0; | |
| 155 static const int kStyleSheetInternalFieldCount = | |
| 156 kDefaultWrapperInternalFieldCount + 1; | |
| 157 | |
| 158 #define DECLARE_PROPERTY_ACCESSOR_GETTER(NAME) \ | |
| 159 static v8::Handle<v8::Value> v8##NAME##AccessorGetter(\ | |
| 160 v8::Local<v8::String> name, const v8::AccessorInfo& info); | |
| 161 | |
| 162 #define DECLARE_PROPERTY_ACCESSOR_SETTER(NAME) \ | |
| 163 static void v8##NAME##AccessorSetter(v8::Local<v8::String> name, \ | |
| 164 v8::Local<v8::Value> value, \ | |
| 165 const v8::AccessorInfo& info); | |
| 166 | |
| 167 #define DECLARE_PROPERTY_ACCESSOR(NAME) \ | |
| 168 DECLARE_PROPERTY_ACCESSOR_GETTER(NAME) \ | |
| 169 DECLARE_PROPERTY_ACCESSOR_SETTER(NAME) | |
| 170 | |
| 171 | |
| 172 #define DECLARE_NAMED_PROPERTY_GETTER(NAME) \ | |
| 173 static v8::Handle<v8::Value> v8##NAME##NamedPropertyGetter(\ | |
| 174 v8::Local<v8::String> name, const v8::AccessorInfo& info); | |
| 175 | |
| 176 #define DECLARE_NAMED_PROPERTY_SETTER(NAME) \ | |
| 177 static v8::Handle<v8::Value> v8##NAME##NamedPropertySetter(\ | |
| 178 v8::Local<v8::String> name, \ | |
| 179 v8::Local<v8::Value> value, \ | |
| 180 const v8::AccessorInfo& info); | |
| 181 | |
| 182 #define DECLARE_NAMED_PROPERTY_DELETER(NAME) \ | |
| 183 static v8::Handle<v8::Boolean> v8##NAME##NamedPropertyDeleter(\ | |
| 184 v8::Local<v8::String> name, const v8::AccessorInfo& info); | |
| 185 | |
| 186 #define USE_NAMED_PROPERTY_GETTER(NAME) \ | |
| 187 V8Custom::v8##NAME##NamedPropertyGetter | |
| 188 | |
| 189 #define USE_NAMED_PROPERTY_SETTER(NAME) \ | |
| 190 V8Custom::v8##NAME##NamedPropertySetter | |
| 191 | |
| 192 #define USE_NAMED_PROPERTY_DELETER(NAME) \ | |
| 193 V8Custom::v8##NAME##NamedPropertyDeleter | |
| 194 | |
| 195 #define DECLARE_INDEXED_PROPERTY_GETTER(NAME) \ | |
| 196 static v8::Handle<v8::Value> v8##NAME##IndexedPropertyGetter(\ | |
| 197 uint32_t index, const v8::AccessorInfo& info); | |
| 198 | |
| 199 #define DECLARE_INDEXED_PROPERTY_SETTER(NAME) \ | |
| 200 static v8::Handle<v8::Value> v8##NAME##IndexedPropertySetter(\ | |
| 201 uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info); | |
| 202 | |
| 203 #define DECLARE_INDEXED_PROPERTY_DELETER(NAME) \ | |
| 204 static v8::Handle<v8::Boolean> v8##NAME##IndexedPropertyDeleter(\ | |
| 205 uint32_t index, const v8::AccessorInfo& info); | |
| 206 | |
| 207 #define USE_INDEXED_PROPERTY_GETTER(NAME) \ | |
| 208 V8Custom::v8##NAME##IndexedPropertyGetter | |
| 209 | |
| 210 #define USE_INDEXED_PROPERTY_SETTER(NAME) \ | |
| 211 V8Custom::v8##NAME##IndexedPropertySetter | |
| 212 | |
| 213 #define USE_INDEXED_PROPERTY_DELETER(NAME) \ | |
| 214 V8Custom::v8##NAME##IndexedPropertyDeleter | |
| 215 | |
| 216 #define DECLARE_CALLBACK(NAME) \ | |
| 217 static v8::Handle<v8::Value> v8##NAME##Callback(const v8::Arguments& args); | |
| 218 | |
| 219 #define USE_CALLBACK(NAME) \ | |
| 220 V8Custom::v8##NAME##Callback | |
| 221 | |
| 222 #define DECLARE_NAMED_ACCESS_CHECK(NAME) \ | |
| 223 static bool v8##NAME##NamedSecurityCheck(v8::Local<v8::Object> host, \ | |
| 224 v8::Local<v8::Value> key, \ | |
| 225 v8::AccessType type, \ | |
| 226 v8::Local<v8::Value> data); | |
| 227 | |
| 228 #define DECLARE_INDEXED_ACCESS_CHECK(NAME) \ | |
| 229 static bool v8##NAME##IndexedSecurityCheck(v8::Local<v8::Object> host, \ | |
| 230 uint32_t index, \ | |
| 231 v8::AccessType type, \ | |
| 232 v8::Local<v8::Value> data); | |
| 233 | |
| 234 DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DStrokeStyle) | |
| 235 DECLARE_PROPERTY_ACCESSOR(CanvasRenderingContext2DFillStyle) | |
| 236 DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowEvent) | |
| 237 DECLARE_PROPERTY_ACCESSOR_GETTER(DOMWindowCrypto) | |
| 238 // Customized getter&setter of DOMWindow.location | |
| 239 DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowLocation) | |
| 240 // Customized setter of DOMWindow.opener | |
| 241 DECLARE_PROPERTY_ACCESSOR_SETTER(DOMWindowOpener) | |
| 242 | |
| 243 DECLARE_PROPERTY_ACCESSOR(DocumentLocation) | |
| 244 DECLARE_PROPERTY_ACCESSOR(DocumentImplementation) | |
| 245 DECLARE_PROPERTY_ACCESSOR_GETTER(EventSrcElement) | |
| 246 DECLARE_PROPERTY_ACCESSOR(EventReturnValue) | |
| 247 DECLARE_PROPERTY_ACCESSOR_GETTER(EventDataTransfer) | |
| 248 DECLARE_PROPERTY_ACCESSOR_GETTER(EventClipboardData) | |
| 249 | |
| 250 // Getter/Setter for window event handlers | |
| 251 DECLARE_PROPERTY_ACCESSOR(DOMWindowEventHandler) | |
| 252 // Getter/Setter for Element event handlers | |
| 253 DECLARE_PROPERTY_ACCESSOR(ElementEventHandler) | |
| 254 | |
| 255 // HTMLCanvasElement | |
| 256 DECLARE_CALLBACK(HTMLCanvasElementGetContext) | |
| 257 | |
| 258 // Customized setter of src and location on HTMLFrameElement | |
| 259 DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementSrc) | |
| 260 DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLFrameElementLocation) | |
| 261 // Customized setter of src on HTMLIFrameElement | |
| 262 DECLARE_PROPERTY_ACCESSOR_SETTER(HTMLIFrameElementSrc) | |
| 263 // Customized setter of Attr.value | |
| 264 DECLARE_PROPERTY_ACCESSOR_SETTER(AttrValue) | |
| 265 | |
| 266 // Customized setter of HTMLOptionsCollection length | |
| 267 DECLARE_PROPERTY_ACCESSOR(HTMLOptionsCollectionLength) | |
| 268 | |
| 269 DECLARE_CALLBACK(HTMLInputElementSetSelectionRange) | |
| 270 | |
| 271 // Customized accessors for HTMLInputElement | |
| 272 DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionStart) | |
| 273 DECLARE_PROPERTY_ACCESSOR(HTMLInputElementSelectionEnd) | |
| 274 | |
| 275 DECLARE_NAMED_ACCESS_CHECK(Location) | |
| 276 DECLARE_INDEXED_ACCESS_CHECK(History) | |
| 277 | |
| 278 DECLARE_NAMED_ACCESS_CHECK(History) | |
| 279 DECLARE_INDEXED_ACCESS_CHECK(Location) | |
| 280 | |
| 281 // HTMLCollection customized functions. | |
| 282 DECLARE_CALLBACK(HTMLCollectionItem) | |
| 283 DECLARE_CALLBACK(HTMLCollectionNamedItem) | |
| 284 // HTMLCollections are callable as functions. | |
| 285 DECLARE_CALLBACK(HTMLCollectionCallAsFunction) | |
| 286 | |
| 287 // HTMLSelectElement customized functions. | |
| 288 DECLARE_CALLBACK(HTMLSelectElementRemove) | |
| 289 | |
| 290 // HTMLOptionsCollection customized functions. | |
| 291 DECLARE_CALLBACK(HTMLOptionsCollectionRemove) | |
| 292 DECLARE_CALLBACK(HTMLOptionsCollectionAdd) | |
| 293 | |
| 294 // HTMLDocument customized functions | |
| 295 DECLARE_CALLBACK(HTMLDocumentWrite) | |
| 296 DECLARE_CALLBACK(HTMLDocumentWriteln) | |
| 297 DECLARE_CALLBACK(HTMLDocumentOpen) | |
| 298 DECLARE_PROPERTY_ACCESSOR(HTMLDocumentAll) | |
| 299 DECLARE_NAMED_PROPERTY_GETTER(HTMLDocument) | |
| 300 DECLARE_NAMED_PROPERTY_DELETER(HTMLDocument) | |
| 301 | |
| 302 // Document customized functions | |
| 303 DECLARE_CALLBACK(DocumentEvaluate) | |
| 304 DECLARE_CALLBACK(DocumentGetCSSCanvasContext) | |
| 305 | |
| 306 // Window customized functions | |
| 307 DECLARE_CALLBACK(DOMWindowAddEventListener) | |
| 308 DECLARE_CALLBACK(DOMWindowRemoveEventListener) | |
| 309 DECLARE_CALLBACK(DOMWindowPostMessage) | |
| 310 DECLARE_CALLBACK(DOMWindowSetTimeout) | |
| 311 DECLARE_CALLBACK(DOMWindowSetInterval) | |
| 312 DECLARE_CALLBACK(DOMWindowAtob) | |
| 313 DECLARE_CALLBACK(DOMWindowBtoa) | |
| 314 DECLARE_CALLBACK(DOMWindowNOP) | |
| 315 DECLARE_CALLBACK(DOMWindowToString) | |
| 316 DECLARE_CALLBACK(DOMWindowShowModalDialog) | |
| 317 DECLARE_CALLBACK(DOMWindowOpen) | |
| 318 DECLARE_CALLBACK(DOMWindowClearTimeout) | |
| 319 DECLARE_CALLBACK(DOMWindowClearInterval) | |
| 320 | |
| 321 DECLARE_CALLBACK(DOMParserConstructor) | |
| 322 DECLARE_CALLBACK(HTMLImageElementConstructor) | |
| 323 DECLARE_CALLBACK(HTMLOptionElementConstructor) | |
| 324 DECLARE_CALLBACK(MessageChannelConstructor) | |
| 325 DECLARE_CALLBACK(WebKitCSSMatrixConstructor) | |
| 326 DECLARE_CALLBACK(WebKitPointConstructor) | |
| 327 DECLARE_CALLBACK(XMLHttpRequestConstructor) | |
| 328 DECLARE_CALLBACK(XMLSerializerConstructor) | |
| 329 DECLARE_CALLBACK(XPathEvaluatorConstructor) | |
| 330 DECLARE_CALLBACK(XSLTProcessorConstructor) | |
| 331 | |
| 332 // Implementation of custom XSLTProcessor methods. | |
| 333 DECLARE_CALLBACK(XSLTProcessorImportStylesheet) | |
| 334 DECLARE_CALLBACK(XSLTProcessorTransformToFragment) | |
| 335 DECLARE_CALLBACK(XSLTProcessorTransformToDocument) | |
| 336 DECLARE_CALLBACK(XSLTProcessorSetParameter) | |
| 337 DECLARE_CALLBACK(XSLTProcessorGetParameter) | |
| 338 DECLARE_CALLBACK(XSLTProcessorRemoveParameter) | |
| 339 | |
| 340 // CSSPrimitiveValue customized functions | |
| 341 DECLARE_CALLBACK(CSSPrimitiveValueGetRGBColorValue) | |
| 342 | |
| 343 // Canvas 2D customized functions | |
| 344 DECLARE_CALLBACK(CanvasRenderingContext2DSetStrokeColor) | |
| 345 DECLARE_CALLBACK(CanvasRenderingContext2DSetFillColor) | |
| 346 DECLARE_CALLBACK(CanvasRenderingContext2DStrokeRect) | |
| 347 DECLARE_CALLBACK(CanvasRenderingContext2DSetShadow) | |
| 348 DECLARE_CALLBACK(CanvasRenderingContext2DDrawImage) | |
| 349 DECLARE_CALLBACK(CanvasRenderingContext2DDrawImageFromRect) | |
| 350 DECLARE_CALLBACK(CanvasRenderingContext2DCreatePattern) | |
| 351 DECLARE_CALLBACK(CanvasRenderingContext2DFillText) | |
| 352 DECLARE_CALLBACK(CanvasRenderingContext2DStrokeText) | |
| 353 DECLARE_CALLBACK(CanvasRenderingContext2DPutImageData) | |
| 354 | |
| 355 // Implementation of Clipboard attributes and methods. | |
| 356 DECLARE_PROPERTY_ACCESSOR_GETTER(ClipboardTypes) | |
| 357 DECLARE_CALLBACK(ClipboardClearData) | |
| 358 DECLARE_CALLBACK(ClipboardGetData) | |
| 359 DECLARE_CALLBACK(ClipboardSetData) | |
| 360 DECLARE_CALLBACK(ClipboardSetDragImage); | |
| 361 | |
| 362 // Implementation of Element methods. | |
| 363 DECLARE_CALLBACK(ElementQuerySelector) | |
| 364 DECLARE_CALLBACK(ElementQuerySelectorAll) | |
| 365 DECLARE_CALLBACK(ElementSetAttribute) | |
| 366 DECLARE_CALLBACK(ElementSetAttributeNode) | |
| 367 DECLARE_CALLBACK(ElementSetAttributeNS) | |
| 368 DECLARE_CALLBACK(ElementSetAttributeNodeNS) | |
| 369 | |
| 370 // Implementation of custom Location methods. | |
| 371 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationProtocol) | |
| 372 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHost) | |
| 373 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHostname) | |
| 374 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationPort) | |
| 375 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationPathname) | |
| 376 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationSearch) | |
| 377 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHash) | |
| 378 DECLARE_PROPERTY_ACCESSOR_SETTER(LocationHref) | |
| 379 DECLARE_PROPERTY_ACCESSOR_GETTER(LocationAssign) | |
| 380 DECLARE_PROPERTY_ACCESSOR_GETTER(LocationReplace) | |
| 381 DECLARE_PROPERTY_ACCESSOR_GETTER(LocationReload) | |
| 382 DECLARE_CALLBACK(LocationAssign) | |
| 383 DECLARE_CALLBACK(LocationReplace) | |
| 384 DECLARE_CALLBACK(LocationReload) | |
| 385 DECLARE_CALLBACK(LocationToString) | |
| 386 DECLARE_CALLBACK(LocationValueOf) | |
| 387 | |
| 388 // Implementation of custom Node methods. | |
| 389 DECLARE_CALLBACK(NodeAddEventListener) | |
| 390 DECLARE_CALLBACK(NodeRemoveEventListener) | |
| 391 DECLARE_CALLBACK(NodeInsertBefore) | |
| 392 DECLARE_CALLBACK(NodeReplaceChild) | |
| 393 DECLARE_CALLBACK(NodeRemoveChild) | |
| 394 DECLARE_CALLBACK(NodeAppendChild) | |
| 395 | |
| 396 // Custom implementation is Navigator properties. | |
| 397 // We actually only need this because WebKit has | |
| 398 // navigator.appVersion as custom. Our version just | |
| 399 // passes through. | |
| 400 DECLARE_PROPERTY_ACCESSOR(NavigatorAppVersion) | |
| 401 | |
| 402 // Custom implementation of XMLHttpRequest properties | |
| 403 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnabort) | |
| 404 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnerror) | |
| 405 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnload) | |
| 406 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnloadstart) | |
| 407 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnprogress) | |
| 408 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestOnreadystatechange) | |
| 409 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestResponseText) | |
| 410 DECLARE_CALLBACK(XMLHttpRequestAddEventListener) | |
| 411 DECLARE_CALLBACK(XMLHttpRequestRemoveEventListener) | |
| 412 DECLARE_CALLBACK(XMLHttpRequestOpen) | |
| 413 DECLARE_CALLBACK(XMLHttpRequestSend) | |
| 414 DECLARE_CALLBACK(XMLHttpRequestSetRequestHeader) | |
| 415 DECLARE_CALLBACK(XMLHttpRequestGetResponseHeader) | |
| 416 DECLARE_CALLBACK(XMLHttpRequestOverrideMimeType) | |
| 417 DECLARE_CALLBACK(XMLHttpRequestDispatchEvent) | |
| 418 | |
| 419 // Custom implementation of XMLHttpRequestUpload properties | |
| 420 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnabort) | |
| 421 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnerror) | |
| 422 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnload) | |
| 423 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnloadstart) | |
| 424 DECLARE_PROPERTY_ACCESSOR(XMLHttpRequestUploadOnprogress) | |
| 425 DECLARE_CALLBACK(XMLHttpRequestUploadAddEventListener) | |
| 426 DECLARE_CALLBACK(XMLHttpRequestUploadRemoveEventListener) | |
| 427 DECLARE_CALLBACK(XMLHttpRequestUploadDispatchEvent) | |
| 428 | |
| 429 // Custom implementation of TreeWalker functions | |
| 430 DECLARE_CALLBACK(TreeWalkerParentNode) | |
| 431 DECLARE_CALLBACK(TreeWalkerFirstChild) | |
| 432 DECLARE_CALLBACK(TreeWalkerLastChild) | |
| 433 DECLARE_CALLBACK(TreeWalkerNextNode) | |
| 434 DECLARE_CALLBACK(TreeWalkerPreviousNode) | |
| 435 DECLARE_CALLBACK(TreeWalkerNextSibling) | |
| 436 DECLARE_CALLBACK(TreeWalkerPreviousSibling) | |
| 437 | |
| 438 // Custom implementation of InspectorController functions | |
| 439 DECLARE_CALLBACK(InspectorControllerProfiles) | |
| 440 DECLARE_CALLBACK(InspectorControllerHighlightDOMNode) | |
| 441 DECLARE_CALLBACK(InspectorControllerAddResourceSourceToFrame) | |
| 442 DECLARE_CALLBACK(InspectorControllerGetResourceDocumentNode) | |
| 443 DECLARE_CALLBACK(InspectorControllerAddSourceToFrame) | |
| 444 DECLARE_CALLBACK(InspectorControllerSearch) | |
| 445 DECLARE_CALLBACK(InspectorControllerSetting) | |
| 446 DECLARE_CALLBACK(InspectorControllerInspectedWindow) | |
| 447 DECLARE_CALLBACK(InspectorControllerSetSetting) | |
| 448 DECLARE_CALLBACK(InspectorControllerCurrentCallFrame) | |
| 449 DECLARE_CALLBACK(InspectorControllerDebuggerEnabled) | |
| 450 DECLARE_CALLBACK(InspectorControllerPauseOnExceptions) | |
| 451 DECLARE_CALLBACK(InspectorControllerProfilerEnabled) | |
| 452 #if ENABLE(DATABASE) | |
| 453 DECLARE_CALLBACK(InspectorControllerDatabaseTableNames) | |
| 454 #endif | |
| 455 DECLARE_CALLBACK(InspectorControllerWrapCallback) | |
| 456 | |
| 457 // Custom implementation of NodeIterator functions | |
| 458 DECLARE_CALLBACK(NodeIteratorNextNode) | |
| 459 DECLARE_CALLBACK(NodeIteratorPreviousNode) | |
| 460 | |
| 461 // Custom implementation of NodeFilter function | |
| 462 DECLARE_CALLBACK(NodeFilterAcceptNode) | |
| 463 | |
| 464 // Custom implementation of HTMLFormElement | |
| 465 DECLARE_CALLBACK(HTMLFormElementSubmit) | |
| 466 | |
| 467 DECLARE_INDEXED_PROPERTY_GETTER(DOMStringList) | |
| 468 DECLARE_CALLBACK(DOMStringListItem) | |
| 469 | |
| 470 DECLARE_NAMED_PROPERTY_GETTER(DOMWindow) | |
| 471 DECLARE_INDEXED_PROPERTY_GETTER(DOMWindow) | |
| 472 DECLARE_NAMED_ACCESS_CHECK(DOMWindow) | |
| 473 DECLARE_INDEXED_ACCESS_CHECK(DOMWindow) | |
| 474 | |
| 475 DECLARE_NAMED_PROPERTY_GETTER(HTMLFrameSetElement) | |
| 476 DECLARE_NAMED_PROPERTY_GETTER(HTMLFormElement) | |
| 477 DECLARE_NAMED_PROPERTY_GETTER(NodeList) | |
| 478 DECLARE_NAMED_PROPERTY_GETTER(NamedNodeMap) | |
| 479 DECLARE_NAMED_PROPERTY_GETTER(CSSStyleDeclaration) | |
| 480 DECLARE_NAMED_PROPERTY_SETTER(CSSStyleDeclaration) | |
| 481 DECLARE_NAMED_PROPERTY_GETTER(HTMLPlugInElement) | |
| 482 DECLARE_NAMED_PROPERTY_SETTER(HTMLPlugInElement) | |
| 483 DECLARE_INDEXED_PROPERTY_GETTER(HTMLPlugInElement) | |
| 484 DECLARE_INDEXED_PROPERTY_SETTER(HTMLPlugInElement) | |
| 485 | |
| 486 // Plugin object can be called as function. | |
| 487 DECLARE_CALLBACK(HTMLPlugInElement) | |
| 488 | |
| 489 DECLARE_NAMED_PROPERTY_GETTER(StyleSheetList) | |
| 490 DECLARE_INDEXED_PROPERTY_GETTER(NamedNodeMap) | |
| 491 DECLARE_INDEXED_PROPERTY_GETTER(HTMLFormElement) | |
| 492 DECLARE_INDEXED_PROPERTY_GETTER(HTMLOptionsCollection) | |
| 493 DECLARE_INDEXED_PROPERTY_SETTER(HTMLOptionsCollection) | |
| 494 DECLARE_NAMED_PROPERTY_GETTER(HTMLSelectElementCollection) | |
| 495 DECLARE_INDEXED_PROPERTY_SETTER(HTMLSelectElementCollection) | |
| 496 DECLARE_NAMED_PROPERTY_GETTER(HTMLCollection) | |
| 497 | |
| 498 // Canvas and supporting classes | |
| 499 DECLARE_INDEXED_PROPERTY_GETTER(CanvasPixelArray) | |
| 500 DECLARE_INDEXED_PROPERTY_SETTER(CanvasPixelArray) | |
| 501 | |
| 502 // MessagePort | |
| 503 DECLARE_PROPERTY_ACCESSOR(MessagePortOnmessage) | |
| 504 DECLARE_PROPERTY_ACCESSOR(MessagePortOnclose) | |
| 505 DECLARE_CALLBACK(MessagePortStartConversation) | |
| 506 DECLARE_CALLBACK(MessagePortAddEventListener) | |
| 507 DECLARE_CALLBACK(MessagePortRemoveEventListener) | |
| 508 | |
| 509 // Database | |
| 510 DECLARE_CALLBACK(DatabaseChangeVersion) | |
| 511 DECLARE_CALLBACK(DatabaseTransaction) | |
| 512 DECLARE_CALLBACK(SQLTransactionExecuteSql) | |
| 513 DECLARE_CALLBACK(SQLResultSetRowListItem) | |
| 514 | |
| 515 // ClientRectList | |
| 516 DECLARE_INDEXED_PROPERTY_GETTER(ClientRectList) | |
| 517 | |
| 518 // SVG custom properties and callbacks | |
| 519 #if ENABLE(SVG) | |
| 520 DECLARE_PROPERTY_ACCESSOR_GETTER(SVGLengthValue) | |
| 521 DECLARE_CALLBACK(SVGLengthConvertToSpecifiedUnits) | |
| 522 DECLARE_CALLBACK(SVGMatrixInverse) | |
| 523 DECLARE_CALLBACK(SVGMatrixRotateFromVector) | |
| 524 DECLARE_CALLBACK(SVGElementInstanceAddEventListener) | |
| 525 DECLARE_CALLBACK(SVGElementInstanceRemoveEventListener) | |
| 526 #endif | |
| 527 | |
| 528 // Worker | |
| 529 #if ENABLE(WORKERS) | |
| 530 DECLARE_PROPERTY_ACCESSOR(WorkerOnmessage) | |
| 531 DECLARE_PROPERTY_ACCESSOR(WorkerOnerror) | |
| 532 DECLARE_CALLBACK(WorkerConstructor) | |
| 533 DECLARE_CALLBACK(WorkerAddEventListener) | |
| 534 DECLARE_CALLBACK(WorkerRemoveEventListener) | |
| 535 | |
| 536 DECLARE_PROPERTY_ACCESSOR_GETTER(WorkerContextSelf) | |
| 537 DECLARE_PROPERTY_ACCESSOR(WorkerContextOnmessage) | |
| 538 DECLARE_CALLBACK(WorkerContextImportScripts) | |
| 539 DECLARE_CALLBACK(WorkerContextSetTimeout) | |
| 540 DECLARE_CALLBACK(WorkerContextClearTimeout) | |
| 541 DECLARE_CALLBACK(WorkerContextSetInterval) | |
| 542 DECLARE_CALLBACK(WorkerContextClearInterval) | |
| 543 DECLARE_CALLBACK(WorkerContextAddEventListener) | |
| 544 DECLARE_CALLBACK(WorkerContextRemoveEventListener) | |
| 545 #endif | |
| 546 | |
| 547 #undef DECLARE_INDEXED_ACCESS_CHECK | |
| 548 #undef DECLARE_NAMED_ACCESS_CHECK | |
| 549 | |
| 550 #undef DECLARE_PROPERTY_ACCESSOR_SETTER | |
| 551 #undef DECLARE_PROPERTY_ACCESSOR_GETTER | |
| 552 #undef DECLARE_PROPERTY_ACCESSOR | |
| 553 | |
| 554 #undef DECLARE_NAMED_PROPERTY_GETTER | |
| 555 #undef DECLARE_NAMED_PROPERTY_SETTER | |
| 556 #undef DECLARE_NAMED_PROPERTY_DELETER | |
| 557 | |
| 558 #undef DECLARE_INDEXED_PROPERTY_GETTER | |
| 559 #undef DECLARE_INDEXED_PROPERTY_SETTER | |
| 560 #undef DECLARE_INDEXED_PROPERTY_DELETER | |
| 561 | |
| 562 #undef DECLARE_CALLBACK | |
| 563 | |
| 564 // Returns the NPObject corresponding to an HTMLElement object. | |
| 565 static NPObject* GetHTMLPlugInElementNPObject(v8::Handle<v8::Object> object); | |
| 566 | |
| 567 // Returns the owner frame pointer of a DOM wrapper object. It only works for | |
| 568 // these DOM objects requiring cross-domain access check. | |
| 569 static Frame* GetTargetFrame(v8::Local<v8::Object> host, | |
| 570 v8::Local<v8::Value> data); | |
| 571 | |
| 572 // Special case for downcasting SVG path segments | |
| 573 #if ENABLE(SVG) | |
| 574 static V8ClassIndex::V8WrapperType DowncastSVGPathSeg(void* path_seg); | |
| 575 #endif | |
| 576 | |
| 577 private: | |
| 578 static v8::Handle<v8::Value> WindowSetTimeoutImpl(const v8::Arguments& args, | |
| 579 bool single_shot); | |
| 580 static void ClearTimeoutImpl(const v8::Arguments& args); | |
| 581 static void WindowSetLocation(DOMWindow*, const String&); | |
| 582 }; | |
| 583 | |
| 584 } // namespace WebCore | |
| 585 | |
| 586 #endif // V8_CUSTOM_H__ | |
| OLD | NEW |