Changes between Version 28 and Version 29 of WebKitIDL
- Timestamp:
- Feb 14, 2012 2:29:20 AM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WebKitIDL
v28 v29 35 35 36 36 Usage: The possible usage is [TreatNullAs=NullString] or [TreatUndefinedAs=NullString]. 37 They can be specified on DOMString attributes or DOMString parameters only , like this:37 They can be specified on DOMString attributes or DOMString parameters only: 38 38 {{{ 39 39 attribute [TreatNullAs=NullString] DOMString str; … … 63 63 64 64 Usage: The possible usage is [TreatReturnedNullStringAs=Null], [TreatReturnedNullStringAs=Undefined] or [TreatReturnedNullStringAs=False]. 65 They can be specified on DOMString attributes or methods which return a DOMString value , like this:65 They can be specified on DOMString attributes or methods which return a DOMString value: 66 66 {{{ 67 67 attribute [TreatReturnedNullStringAs=Null] DOMString str; … … 83 83 Usage: The possible usage is [Optional], [Optional=DefaultIsUndefined] or [Optional=DefaultIsNullString]. 84 84 [Optional] and [Optional=DefaultIsUndefined] can be specified on parameters. 85 [Optional=DefaultIsNullString] can be specified on DOMString parameters , like this:85 [Optional=DefaultIsNullString] can be specified on DOMString parameters: 86 86 {{{ 87 87 interface HTMLFoo { … … 111 111 Summary: ADD SUMMARY 112 112 113 Usage: [Callback] can be specified on interfaces and parameters , like this:113 Usage: [Callback] can be specified on interfaces and parameters: 114 114 {{{ 115 115 interface [ … … 126 126 Summary: If your bindings require special (i.e. "custom") handling, you can write the bindings code as you like. 127 127 128 Usage: [Custom], [JSCustom] and [V8Custom] can be specified on methods or attributes. [CustomGetter], [JSCustomGetter], [V8CustomGetter], [CustomSetter], [JSCustomSetter], [V8CustomSetter] can be specified on attributes , like this:128 Usage: [Custom], [JSCustom] and [V8Custom] can be specified on methods or attributes. [CustomGetter], [JSCustomGetter], [V8CustomGetter], [CustomSetter], [JSCustomSetter], [V8CustomSetter] can be specified on attributes: 129 129 {{{ 130 130 [Custom] void func(); … … 154 154 } 155 155 }}} 156 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings , like this:156 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: 157 157 {{{ 158 158 JSValue JSXXX::func(ExecState* exec) … … 170 170 } 171 171 }}} 172 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings , like this:172 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: 173 173 {{{ 174 174 JSValue JSXXX::str(ExecState* exec) const … … 186 186 } 187 187 }}} 188 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings , like this:188 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings: 189 189 {{{ 190 190 void JSXXX::setStr(ExecState*, JSValue value) … … 278 278 === * [CheckAccessToNode](m,a) === 279 279 280 Summary: It checks if a given Node access is allowed in terms of security. 281 282 Usage: It can be specified on methods and attributes: 283 {{{ 284 attribute [CheckAccessToNode] Node contentDocument; 285 [CheckAccessToNode] SVGDocument getSVGDocument(); 286 }}} 287 288 In terms of security, node.contentDocument should return undefined if the parent frame and the child frame are from different origins. 289 If the security check is needed, you should specify [CheckAccessToNode]. 290 280 291 === * [StrictTypeChecking](m,a) FIXME === 281 292 282 293 Summary: ADD SUMMARY 283 294 284 Usage: [StrictTypeChecking] can be specified on methods and attributes , like this:295 Usage: [StrictTypeChecking] can be specified on methods and attributes: 285 296 {{{ 286 297 attribute [StringTypeChecking] float x; … … 292 303 === * [ReturnNewObject](m,a) === 293 304 305 Summary: It controls whether WebCore can return a cached wrapper object or not. 306 307 Usage: It can be specified on methods or attributes: 308 {{{ 309 attribute [ReturnNewObject] Node node; 310 [ReturnNewObject] Node createTextNode(); 311 }}} 312 313 Without [ReturnNewObject], JavaScriptCore and V8 cache a wrapper object for performance. 314 For example, consider the case where node.firstChild is accessed: 315 316 * Node::firstChild() is called 317 * The result is passed to toJS() or toV8() 318 * toJS() or toV8() checks if a wrapper object of the result is already cached on the node 319 * If cached, the cached wrapper object is returned 320 * Otherwise, toJS() or toV8() creates the wrapper object of the result 321 * The created wrapper object is cached on the node 322 * The wrapper object is returned 323 324 On the other hand, if you do not want to cache the wrapper object and want to create the wrapper object every time, 325 you can specify [ReturnNewObject]. 326 327 294 328 === * [ImplementedAs](m) === 295 329 296 330 Summary: It specifies a method name in WebCore implementation, if the IDL method name and the WebCore method name are different. 297 331 298 Usage: The possible usage is [ImplementedAs=XXX], where XXX is a method name of the WebCore implementation. It can be specified on methods , like this:299 {{{ 300 void [ImplementedAs=deleteFunction]delete();332 Usage: The possible usage is [ImplementedAs=XXX], where XXX is a method name of the WebCore implementation. It can be specified on methods: 333 {{{ 334 [ImplementedAs=deleteFunction] void delete(); 301 335 }}} 302 336 … … 319 353 === * [Replaceable](a) === 320 354 355 * [http://dev.w3.org/2006/webapi/WebIDL/#Replaceable The spec of replaceable] 356 357 Summary: It controls if a given attribute is "replaceable" or not. 358 359 Usage: It can be specified on attributes: 360 {{{ 361 interface DOMWindow { 362 attribute [Replaceable] screenX; 363 } 364 }}} 365 366 Intuitively, "replaceable" means that you can set a new value to the attribute without overwriting the current value. 367 If you delete the new value, then the old value still remains. 368 369 Specifically, without [Replaceable], the attribute behaves as follows: 370 {{{ 371 window.screenX; // Evaluates to 0 372 window.screenX = "foo"; 373 window.screenX; // Evaluates to "foo" 374 delete window.screenX; 375 window.screenX; // Evaluates to undefined 376 }}} 377 378 With [Replaceable], the attribute behaves as follows: 379 {{{ 380 window.screenX; // Evaluates to 0 381 window.screenX = "foo"; 382 window.screenX; // Evaluates to "foo" 383 delete window.screenX; 384 window.screenX; // Evaluates to 0 385 }}} 386 387 Whether you should specify [Replaceable] or not depends on the spec of each attribute. 388 389 321 390 === * [Deletable](a), [NotEnumerable](a), [V8ReadOnly](a) === 322 391 … … 325 394 Summary: They control Writability, Enumerability and Configurability of attributes. 326 395 327 Usage: They can be specified on attributes , like this:396 Usage: They can be specified on attributes: 328 397 {{{ 329 398 attribute [NotEnumerable, Deletable] DOMString str; … … 340 409 Summary: For performance optimization, it indicates to cache a wrapped object in a DOM object. 341 410 342 Usage: It can be specified on attributes , like this:411 Usage: It can be specified on attributes: 343 412 {{{ 344 413 interface HTMLFoo { … … 393 462 Summary: They control where a given attribute getter/setter is defined. 394 463 395 Usage: They can be specified on attributes , like this:464 Usage: They can be specified on attributes: 396 465 {{{ 397 466 attribute [V8Unforgeable] DOMString str1; … … 415 484 Summary: It indicates that a given DOMString is a URL. 416 485 417 Usage: It can be specified on DOMString attributes , like this:486 Usage: It can be specified on DOMString attributes: 418 487 {{{ 419 488 attribute [Reflect, V8URL] DOMString url; … … 448 517 * we need to modify WebCore/page/DOMWindow.{h,cpp} to add the C++ implementation of the attribute getters and setters or the method callbacks. 449 518 450 On the other hand, in the modularized world with [Supplemental], we just need to modify the code under WebCore/Modules/XXX/ , like this:519 On the other hand, in the modularized world with [Supplemental], we just need to modify the code under WebCore/Modules/XXX/: 451 520 452 521 * WebCore/Modules/XXX/DOMWindowXXX.idl