Changes between Version 99 and Version 100 of WebKitIDL


Ignore:
Timestamp:
May 8, 2013 1:29:13 AM (8 years ago)
Author:
Christophe Dumez
Comment:

Remove mentions of JSCustom and V8Custom

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v99 v100  
    1212 - [#Default Default(p)][[br]]
    1313 - [#Clamp Clamp(a,p)][[br]]
    14  - [#Custom Custom(m,a), JSCustom(m,a), V8Custom(m,a), CustomGetter(a), JSCustomGetter(a), V8CustomGetter(a), CustomSetter(a), JSCustomSetter(a), V8CustomSetter(a)][[br]]
     14 - [#Custom Custom(m,a), CustomGetter(a), CustomSetter(a)][[br]]
    1515 - [#CallWith CallWith(i,m,a)][[br]]
    1616 - [#StrictTypeChecking StrictTypeChecking(m,a,p)][[br]]
     
    2727 - [#ConstructorTemplate ConstructorTemplate(i), InitializedByEventConstructor(a)][[br]]
    2828 - [#NamedConstructor NamedConstructor(i)][[br]]
    29  - [#CustomConstructor CustomConstructor(i), JSCustomConstructor(i), V8CustomConstructor(i), ConstructorParameters(i)][[br]]
     29 - [#CustomConstructor CustomConstructor(i), ConstructorParameters(i)][[br]]
    3030 - [#Conditional Conditional(i,m,a)][[br]]
    3131 - [#V8EnabledAtRuntime V8EnabledAtRuntime(i,m,a)][[br]]
     
    238238 * IDL attributes for custom bindings are prefixed by "Custom".
    239239
    240 For example, `[JSNoStaticTables]`, `[CustomGetter]`, `[V8CustomGetter]`, etc.
     240For example, `[JSNoStaticTables]`, `[CustomGetter]`, etc.
    241241
    242242= IDL attributes = #IDLAttributes
     
    353353Hence calling `context.setColor(-1, 255, 257)` is equivalent to calling `setColorClamped(0, 255, 255)`.
    354354
    355 == `[Custom]`(m,a), `[JSCustom]`(m,a), `[V8Custom]`(m,a), `[CustomGetter]`(a), `[JSCustomGetter]`(a), `[V8CustomGetter]`(a), `[CustomSetter]`(a), `[JSCustomSetter]`(a), `[V8CustomSetter]`(a) == #Custom
     355== `[Custom]`(m,a), `[CustomGetter]`(a), `[CustomSetter]`(a) == #Custom
    356356
    357357Summary: They allow you to write bindings code manually as you like.
    358358
    359 Usage: `[Custom]`, `[JSCustom]` and `[V8Custom]` can be specified on methods or attributes. `[CustomGetter]`, `[JSCustomGetter]`, `[V8CustomGetter]`, `[CustomSetter]`, `[JSCustomSetter]`, `[V8CustomSetter]` can be specified on attributes:
     359Usage: `[Custom]` can be specified on methods or attributes. `[CustomGetter]`, `[CustomSetter]` can be specified on attributes:
    360360{{{
    361361    [Custom] void func();
     
    369369Before explaining the details, let us clarify the relationship of these IDL attributes.
    370370
    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]`.
     371 * `[Custom]` on a method indicates that you can write JavaScriptCore custom bindings for the method.
     372 * `[CustomGetter]` or `[CustomSetter]` on an attribute indicates that you can write JavaScriptCore custom bindings for the attribute getter or setter.
    379373
    380374For 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]`.
    381375
    382 How to write custom bindings is different between JavaScriptCore and V8 or between a method and an attribute getter/setter, as follows:
    383 
    384  * Method in JavaScriptCore: Consider the following example:
     376You can write custom bindings with JavaScriptCore for a method or an attribute getter/setter, as follows:
     377
     378 * Method: Consider the following example:
    385379
    386380{{{
    387381    interface XXX {
    388         [JSCustom] void func(int a, int b);
     382        [Custom] void func(int a, int b);
    389383    };
    390384}}}
     
    398392Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    399393
    400  * Attribute getter in JavaScriptCore: Consider the following example:
     394 * Attribute getter: Consider the following example:
    401395
    402396{{{
    403397    interface XXX {
    404         attribute [JSCustomGetter] DOMString str;
     398        attribute [CustomGetter] DOMString str;
    405399    };
    406400}}}
     
    414408Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    415409
    416  * Attribute setter in JavaScriptCore: Consider the following example:
     410 * Attribute setter: Consider the following example:
    417411
    418412{{{
    419413    interface XXX {
    420         attribute [JSCustomSetter] DOMString str;
     414        attribute [CustomSetter] DOMString str;
    421415    };
    422416}}}
     
    428422    }
    429423}}}
    430 Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    431 
    432  * Method in V8: Consider the following example:
    433 
    434 {{{
    435     interface XXX {
    436         [V8Custom] void func(int a, int b);
    437     };
    438 }}}
    439 You can write custom bindings in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    440 {{{
    441     v8::Handle<v8::Value> V8XXX::funcCallback(const v8::Arguments& args)
    442     {
    443         ...;
    444     }
    445 }}}
    446 Refer to WebCore/bindings/v8/custom/V8XXXCustom.cpp for more details.
    447 
    448  * Attribute getter in V8: Consider the following example:
    449 
    450 {{{
    451     interface XXX {
    452         attribute [V8CustomGetter] DOMString str;
    453     };
    454 }}}
    455 You can write custom bindings in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    456 {{{
    457     v8::Handle<v8::Value> V8XXX::strAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    458     {
    459         ...;
    460     }
    461 }}}
    462 Refer to WebCore/bindings/v8/custom/V8XXXCustom.cpp for more details.
    463 
    464  * Attribute setter in V8: Consider the following example:
    465 
    466 {{{
    467     interface XXX {
    468         attribute [V8CustomSetter] DOMString str;
    469     };
    470 }}}
    471 You can write custom bindings in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    472 {{{
    473     void V8XXX::strAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
    474     {
    475         ...;
    476     }
    477 }}}
    478 Refer to WebCore/bindings/v8/custom/V8XXXCustom.cpp for more details.
    479424
    480425Note: ObjC, GObject and CPP bindings do not support custom bindings.
     
    890835Whether you should allow an interface to have a named constructor or not depends on the spec of each interface.
    891836
    892 == `[CustomConstructor]`(i), `[JSCustomConstructor]`(i), `[V8CustomConstructor]`(i), `[ConstructorParameters]`(i) == #CustomConstructor
     837== `[CustomConstructor]`(i), `[ConstructorParameters]`(i) == #CustomConstructor
    893838
    894839Summary: They allow you to write custom bindings for constructors.
    895840
    896841Usage: They can be specified on interfaces.
    897 Regarding `[ConstructorParameters]`, the possible usage is `[ConstructorParameters=X]`, where `X` is the maximum number of arguments of the constructor:
     842Regarding `[ConstructorParameters]`, the possible usage is `[ConstructorParameters=X]`, where `X` is the number of mandatory arguments of the constructor:
    898843{{{
    899844    interface [
     
    910855Before explaining the details, let us clarify the relationship of these IDL attributes.
    911856
    912  * `[JSCustomConstructor]` on an interface indicates that you can write JavaScriptCore custom bindings for the constructor.
    913  * `[V8CustomConstructor]` on an interface indicates that you can write V8 custom bindings for the constructor.
    914  * `[CustomConstructor]` is equivalent to `[JSCustomConstructor, V8CustomConstructor]`.
    915 
    916 For example, if you specify `[Constructor, JSCustomConstructor]`,
    917 then the constructor is generated only for V8 and you need to write JavaScriptCore custom bindings for the constructor.
    918 
    919 How to write custom bindings is different between JavaScriptCore and V8.
    920 
    921  * JavaScriptCore: Consider the following example:
     857 * `[CustomConstructor]` on an interface indicates that you can write JavaScriptCore custom bindings for the constructor.
     858
     859You can write custom bindings for JavaScriptCore as follows.
     860
     861 * Consider the following example:
    922862
    923863{{{
     
    937877Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    938878
    939  * V8: Consider the following example:
    940 
    941 {{{
    942     interface [
    943         CustomConstructor,
    944         ConstructorParameters=2
    945     ] XXX {
    946     };
    947 }}}
    948 Then you can write custom bindings in WebCore/bindings/v8/custom/V8XXXConstructorCustom.cpp:
    949 {{{
    950     v8::Handle<v8::Value> V8XXX::constructorCallback(const v8::Arguments& args)
    951     {
    952         ...;
    953     }
    954 }}}
    955 Refer to WebCore/bindings/v8/custom/V8XXXConstructorCustom.cpp for more details.
    956 
    957879`X` of `[ConstructorParameters=X]` is the number of mandatory arguments.
    958880For example, if a constructor signature is `[Constructor(int a, int b, [Default=Undefined] optional int c, [Default=DefaultIsUndefined] optional int d)]`, then `X` is 2.
    959881
    960 You do not need to specify `[ConstructorParameters]` if the interface does not have any of `[JSCustomConstructor]`, `[V8CustomConstructor]` or `[CustomConstructor]`.
     882You do not need to specify `[ConstructorParameters]` if the interface does not have `[CustomConstructor]` extended attribute.
    961883
    962884== `[Conditional]`(i,m,a) == #Conditional