349 | | Calling the non-[Clamp] version of setColor() uses ToUint8 to coerce the Numbers to octets. |
350 | | Hence calling context.setColor(-1, 255, 257) is equivalent to calling setColor(255, 255, 1). |
351 | | |
352 | | Calling the [Clamp] version of setColor() uses clampTo() to coerce the Numbers to octets. |
353 | | Hence calling context.setColor(-1, 255, 257) is equivalent to calling setColorClamped(0, 255, 255). |
354 | | |
355 | | == [Custom](m,a), [JSCustom](m,a), [V8Custom](m,a), [CustomGetter](a), [JSCustomGetter](a), [V8CustomGetter](a), [CustomSetter](a), [JSCustomSetter](a), [V8CustomSetter](a) == #Custom |
| 349 | Calling the non-`[Clamp]` version of `setColor()` uses ToUint8 to coerce the Numbers to octets. |
| 350 | Hence calling `context.setColor(-1, 255, 257)` is equivalent to calling `setColor(255, 255, 1)`. |
| 351 | |
| 352 | Calling the `[Clamp]` version of `setColor()` uses `clampTo()` to coerce the Numbers to octets. |
| 353 | Hence calling `context.setColor(-1, 255, 257)` is equivalent to calling `setColorClamped(0, 255, 255)`. |
| 354 | |
| 355 | == `[Custom]`(m,a), `[JSCustom]`(m,a), `[V8Custom]`(m,a), `[CustomGetter]`(a), `[JSCustomGetter]`(a), `[V8CustomGetter]`(a), `[CustomSetter]`(a), `[JSCustomSetter]`(a), `[V8CustomSetter]`(a) == #Custom |
359 | | Usage: [Custom], [JSCustom] and [V8Custom] can be specified on methods or attributes. [CustomGetter], [JSCustomGetter], [V8CustomGetter], [CustomSetter], [JSCustomSetter], [V8CustomSetter] can be specified on attributes: |
| 359 | Usage: `[Custom]`, `[JSCustom]` and `[V8Custom]` can be specified on methods or attributes. `[CustomGetter]`, `[JSCustomGetter]`, `[V8CustomGetter]`, `[CustomSetter]`, `[JSCustomSetter]`, `[V8CustomSetter]` can be specified on attributes: |
371 | | * [JSCustom] on a method indicates that you can write JavaScriptCore custom bindings for the method. |
372 | | * [V8Custom] on a method indicates that you can write V8 custom bindings for the method. |
373 | | * [Custom] on a method is equivalent to [JSCustom, V8Custom]. |
374 | | * [JSCustomGetter] or [JSCustomSetter] on an attribute indicates that you can write JavaScriptCore custom bindings for the attribute getter or setter. |
375 | | * [V8CustomGetter] or [V8CustomSetter] on an attribute indicates that you can write V8 custom bindings for the attribute getter or setter. |
376 | | * [JSCustom] on an attribute is equivalent to [JSCustomGetter, JSCustomSetter]. |
377 | | * [V8Custom] on an attribute is equivalent to [V8CustomGetter, V8CustomSetter]. |
378 | | * [Custom] on an attribute is equivalent to [JSCustom, V8Custom], i.e. [JSCustomGetter, JSCustomSetter, V8CustomGetter, V8CustomSetter]. |
379 | | |
380 | | For example, if you want to write custom bindings only for an attribute getter of JavaScriptCore and V8 and an attribute setter of JavaScriptCore, you can specify [CustomGetter, JSCustomSetter]. |
| 371 | * `[JSCustom]` on a method indicates that you can write JavaScriptCore custom bindings for the method. |
| 372 | * `[V8Custom]` on a method indicates that you can write V8 custom bindings for the method. |
| 373 | * `[Custom]` on a method is equivalent to `[JSCustom, V8Custom]`. |
| 374 | * `[JSCustomGetter]` or `[JSCustomSetter]` on an attribute indicates that you can write JavaScriptCore custom bindings for the attribute getter or setter. |
| 375 | * `[V8CustomGetter]` or `[V8CustomSetter]` on an attribute indicates that you can write V8 custom bindings for the attribute getter or setter. |
| 376 | * `[JSCustom]` on an attribute is equivalent to `[JSCustomGetter, JSCustomSetter]`. |
| 377 | * `[V8Custom]` on an attribute is equivalent to `[V8CustomGetter, V8CustomSetter]`. |
| 378 | * `[Custom]` on an attribute is equivalent to `[JSCustom, V8Custom]`, i.e. `[JSCustomGetter, JSCustomSetter, V8CustomGetter, V8CustomSetter]`. |
| 379 | |
| 380 | For example, if you want to write custom bindings only for an attribute getter of JavaScriptCore and V8 and an attribute setter of JavaScriptCore, you can specify `[CustomGetter, JSCustomSetter]`. |
482 | | == [CallWith](i,m,a) == #CallWith |
483 | | |
484 | | Summary: [CallWith] indicates that the bindings code calls a WebCore method with additional information. |
485 | | |
486 | | Usage: The possible usage is [CallWith=X1|X2|X3|...], where X1, X2, X3, ... is "ScriptExecutionContext", "ScriptState", "ScriptArguments" or "CallStack". |
| 482 | == `[CallWith]`(i,m,a) == #CallWith |
| 483 | |
| 484 | Summary: `[CallWith]` indicates that the bindings code calls a WebCore method with additional information. |
| 485 | |
| 486 | Usage: The possible usage is `[CallWith=X1|X2|X3|...]`, where X1, X2, X3, ... is "ScriptExecutionContext", "ScriptState", "ScriptArguments" or "CallStack". |
511 | | despite the order specified in [CallWith=X1|X2|X3|...]. |
512 | | For example, in case of func4(...), HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b) is called in WebCore. |
513 | | |
514 | | == [StrictTypeChecking](m,a,p) FIXME == #StrictTypeChecking |
| 511 | despite the order specified in `[CallWith=X1|X2|X3|...]`. |
| 512 | For example, in case of `func4(...)`, `HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b)` is called in WebCore. |
| 513 | |
| 514 | == `[StrictTypeChecking]`(m,a,p) FIXME == #StrictTypeChecking |
547 | | Without [ReturnNewObject], JavaScriptCore and V8 cache a wrapped object for performance. |
548 | | For example, consider the case where node.firstChild is accessed: |
549 | | |
550 | | 1. Node::firstChild() is called in WebCore. |
551 | | 1. The result of Node::firstChild() is passed to toJS() or toV8(). |
552 | | 1. toJS() or toV8() checks if a wrapped object of the result is already cached on the node. |
| 547 | Without `[ReturnNewObject]`, JavaScriptCore and V8 cache a wrapped object for performance. |
| 548 | For example, consider the case where `node.firstChild` is accessed: |
| 549 | |
| 550 | 1. `Node::firstChild()` is called in WebCore. |
| 551 | 1. The result of `Node::firstChild()` is passed to `toJS()` or `toV8()`. |
| 552 | 1. `toJS()` or `toV8()` checks if a wrapped object of the result is already cached on the node. |
559 | | you can specify [ReturnNewObject]. |
560 | | |
561 | | == [ImplementedAs](m,a) == #ImplementedAs |
562 | | |
563 | | Summary: [ImplementedAs] specifies a method name in WebCore, if the method name in an IDL file and the method name in WebCore are different. |
564 | | |
565 | | Usage: The possible usage is [ImplementedAs=XXX], where XXX is a method name in WebCore. |
566 | | [ImplementedAs] can be specified on methods: |
| 559 | you can specify `[ReturnNewObject]`. |
| 560 | |
| 561 | == `[ImplementedAs]`(m,a) == #ImplementedAs |
| 562 | |
| 563 | Summary: `[ImplementedAs]` specifies a method name in WebCore, if the method name in an IDL file and the method name in WebCore are different. |
| 564 | |
| 565 | Usage: The possible usage is `[ImplementedAs=XXX]`, where `XXX` is a method name in WebCore. |
| 566 | `[ImplementedAs]` can be specified on methods: |
604 | | you can specify the content attribute name by [Reflect=X]. |
605 | | For example, in case of [Reflect=class], if 'div.className="barClass"' is evaluated, then "barClass" is set to the 'class' content attribute. |
606 | | |
607 | | Whether [Reflect] should be specified or not depends on the spec of each attribute. |
| 604 | you can specify the content attribute name by `[Reflect=X]`. |
| 605 | For example, in case of `[Reflect=class]`, if `'div.className="barClass"'` is evaluated, then "barClass" is set to the 'class' content attribute. |
| 606 | |
| 607 | Whether `[Reflect]` should be specified or not depends on the spec of each attribute. |