Changes between Version 85 and Version 116 of WebKitIDL


Ignore:
Timestamp:
(multiple changes)
Author:
(multiple changes)
Comment:
(multiple changes)

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v85 v116  
    1010 - [#TreatNullAs TreatNullAs(a,p), TreatUndefinedAs(a,p)][[br]]
    1111 - [#TreatReturnedNullStringAs TreatReturnedNullStringAs(m,a)][[br]]
    12  - [#Optional Optional(p)][[br]]
     12 - [#Default Default(p)][[br]]
    1313 - [#Clamp Clamp(a,p)][[br]]
    14  - [#Callback Callback(i,p)][[br]]
    15  - [#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]]
    1615 - [#CallWith CallWith(i,m,a)][[br]]
    1716 - [#StrictTypeChecking StrictTypeChecking(m,a,p)][[br]]
     
    2019 - [#Reflect Reflect(a)][[br]]
    2120 - [#Replaceable Replaceable(a)][[br]]
    22  - [#Deletable Deletable(a), NotEnumerable(a), V8ReadOnly(a)][[br]]
     21 - [#Deletable Deletable(a), NotEnumerable(a)][[br]]
    2322 - [#CachedAttribute CachedAttribute(a)][[br]]
    24  - [#V8Unforgeable V8Unforgeable(m,a), V8OnProto(m,a)][[br]]
    25  - [#URL URL(a)][[br]]
    2623 - [#JSWindowEventListener JSWindowEventListener(a)][[br]]
    27  - [#Supplemental Supplemental(i)][[br]]
    2824 - [#Constructor Constructor(i), CallWith(i,m,a), ConstructorRaisesException(i)][[br]]
    2925 - [#ConstructorTemplate ConstructorTemplate(i), InitializedByEventConstructor(a)][[br]]
    3026 - [#NamedConstructor NamedConstructor(i)][[br]]
    31  - [#CustomConstructor CustomConstructor(i), JSCustomConstructor(i), V8CustomConstructor(i), ConstructorParameters(i)][[br]]
     27 - [#CustomConstructor CustomConstructor(i), ConstructorParameters(i)][[br]]
    3228 - [#Conditional Conditional(i,m,a)][[br]]
    33  - [#V8EnabledAtRuntime V8EnabledAtRuntime(i,m,a)][[br]]
    34  - [#V8EnabledPerContext V8EnabledPerContext(i,m,a)][[br]]
    35  - [#CustomToJSObject CustomToJSObject(i), JSCustomToJSObject(i), V8CustomToJSObject(i), SuppressToJSObject(i)][[br]]
    3629 - [#CheckSecurity CheckSecurity(i), DoNotCheckSecurity(m,a), DoNotCheckSecurityOnGetter(a), DoNotCheckSecurityOnSetter(a)][[br]]
    3730 - [#CheckSecurityForNode CheckSecurityForNode(m,a)][[br]]
    3831 - [#IndexedGetter IndexedGetter(i)][[br]]
    39  - [#V8CustomIndexedGetter V8CustomIndexedGetter(i)][[br]]
    4032 - [#CustomIndexedSetter CustomIndexedSetter(i)][[br]]
    4133 - [#NamedGetter NamedGetter(i)][[br]]
     
    4537 - [#DoNotCheckConstants DoNotCheckConstants(i)][[br]]
    4638 - [#ActiveDOMObject ActiveDOMObject(i)][[br]]
    47  - [#V8DependentLifeTime V8DependentLifeTime(i)][[br]]
    4839 - [#CustomEnumerateProperty CustomEnumerateProperty(i), CustomDeleteProperty(i)][[br]]
    4940 - [#IsWorkerContext IsWorkerContext(i)][[br]]
    50  - [#TransferList TransferList(p)][[br]]
    5141 - [#TypedArray TypedArray(i), [ConstructorTemplate=TypedArray](i)][[br]]
    5242 - [#CustomCall CustomCall(i)][[br]]
    53  - [#JSCustomToNativeObject JSCustomToNativeObject(i), JSCustomFinalize(i), JSCustomIsReachable(i), JSCustomMarkFunction(i), JSCustomNamedGetterOnPrototype(i), JSCustomPushEventHandlerScope(i), JSCustomDefineOwnProperty(i), JSCustomDefineOwnPropertyOnPrototype(i), JSCustomGetOwnPropertySlotAndDescriptor(i)][[br]]
     43 - [#JSCustomToNativeObject JSCustomToNativeObject(i), JSCustomFinalize(i), CustomIsReachable(i), JSCustomMarkFunction(i), JSCustomNamedGetterOnPrototype(i), JSCustomPushEventHandlerScope(i), JSCustomDefineOwnProperty(i), JSCustomDefineOwnPropertyOnPrototype(i), JSCustomGetOwnPropertySlotAndDescriptor(i)][[br]]
    5444 - [#JSGenerateToJSObject JSGenerateToJSObject(i), JSGenerateToNativeObject(i)][[br]]
    55  - [#JSGenerateIsReachable JSGenerateIsReachable(i)]
    56  - [#V8GenerateIsReachable V8GenerateIsReachable(i)]
    57  - [#V8CustomIsReachable V8CustomIsReachable(i)]
    5845 - [#GenerateIsReachable GenerateIsReachable(i)]
    59  - [#JSCustomHeader JSCustomHeader(i)][[br]]
    6046 - [#JSLegacyParent JSLegacyParent(i)][[br]]
    6147 - [#JSInlineGetOwnPropertySlot JSInlineGetOwnPropertySlot(i)][[br]]
     
    6551 - [#CustomReturn CustomReturn(p)][[br]]
    6652 - [#ArrayClass ArrayClass(i)][[br]]
    67  - [#OmitConstructor OmitConstructor, Immutable, MasqueradesAsUndefined, CustomGetOwnPropertySlot, ReplaceableConstructor, ExtendsDOMGlobalObject, IsIndex, V8DoNotCheckSignature, NumericIndexedGetter][[br]]
     53 - [#OmitConstructor OmitConstructor, Immutable, MasqueradesAsUndefined, CustomGetOwnPropertySlot, ReplaceableConstructor, ExtendsDOMGlobalObject, IsIndex, NumericIndexedGetter][[br]]
    6854 - [#ImplementationNamespace ImplementationNamespace(i)][[br]]
    69  - [#V8SkipVTableValidation V8SkipVTableValidation(i), ImplementationLacksVTable(i),][[br]]
     55 - [#SkipVTableValidation SkipVTableValidation(i), ImplementationLacksVTable(i),][[br]]
     56 - [#NoInterfaceObject NoInterfaceObject(i)][[br]]
    7057
    7158
    7259= Overview = #Overview
    7360
    74 The [http://www.w3.org/TR/WebIDL/ Web IDL] is a language that defines how WebCore interfaces are bound to external languages such as JavaScriptCore, V8, ObjC, GObject and CPP. You need to write IDL files (e.g. XMLHttpRequest.idl, Element.idl, etc) to expose WebCore interfaces to those external languages. When WebKit is built, the IDL files are parsed, and the code to bind WebCore implementations and JavaScriptCore, V8, ObjC, GObject and CPP interfaces is automatically generated.
     61The [http://www.w3.org/TR/WebIDL/ Web IDL] is a language that defines how WebCore interfaces are bound to external languages such as JavaScriptCore, ObjC, GObject and CPP. You need to write IDL files (e.g. XMLHttpRequest.idl, Element.idl, etc) to expose WebCore interfaces to those external languages. When WebKit is built, the IDL files are parsed, and the code to bind WebCore implementations and JavaScriptCore, ObjC, GObject and CPP interfaces is automatically generated.
    7562
    7663This document describes practical information about how the IDL bindings work and how you can write IDL files in WebKit. The syntax of IDL files is fairly well documented in the [http://www.w3.org/TR/WebIDL/ Web IDL spec], but it is too formal to read:-) and there are several differences between the Web IDL spec and the WebKit IDL due to implementation issues.
     
    8168{{{
    8269module core {
    83     interface [
    84         JSCustomHeader,
     70    [
    8571        CustomToJSObject
    86     ] Node {
     72    ] interface Node {
    8773        const unsigned short ELEMENT_NODE = 1;
    8874        attribute Node parentNode;
    89         attribute [TreatReturnedNullStringAs=Null] DOMString nodeName;
    90         [Custom] Node appendChild(in [CustomReturn] Node newChild);
    91         void addEventListener(in DOMString type, in EventListener listener, in [Optional] boolean useCapture);
     75        [TreatReturnedNullStringAs=Null] attribute DOMString nodeName;
     76        [Custom] Node appendChild([CustomReturn] Node newChild);
     77        void addEventListener(DOMString type, EventListener listener, optional boolean useCapture);
    9278    };
    9379}
     
    10187 * appendChild(...) and addEventListener(...) are '''method'''s of the Node interface.
    10288 * type, listener and useCapture are '''parameter'''s of the Node interface.
    103  * [JSCustomHeader], [CustomToJSObject], [TreatReturnedNullStringAs=Null], [Custom], [CustomReturn] and [Optional] are '''IDL attribute'''s.
     89 * `[CustomToJSObject]`, `[TreatReturnedNullStringAs=Null]`, `[Custom]` and `[CustomReturn]` are '''IDL attribute'''s.
    10490
    10591Note: These terminologies are not aligned with the Web IDL spec.
     
    119105{{{
    120106module MODULE_NAME {
    121     interface [
     107    [
    122108        IDL_ATTRIBUTE_ON_INTERFACE1,
    123109        IDL_ATTRIBUTE_ON_INTERFACE2,
    124         ...;
    125     ] INTERFACE_NAME {
     110        ...
     111    ] interface INTERFACE_NAME {
    126112        const unsigned long value = 12345;
    127         attribute [IDL_ATTRIBUTE_ON_ATTRIBUTE1, IDL_ATTRIBUTE_ON_ATTRIBUTE2, ...] Node node;
    128         [IDL_ATTRIBUTE_ON_METHOD1, IDL_ATTRIBUTE_ON_METHOD2, ...] void func(in [IDL_ATTRIBUTE_ON_PARAMETER1, IDL_ATTRIBUTE_ON_PARAMETER2, ...] int param, ...);
     113        [IDL_ATTRIBUTE_ON_ATTRIBUTE1, IDL_ATTRIBUTE_ON_ATTRIBUTE2, ...] attribute Node node;
     114        [IDL_ATTRIBUTE_ON_METHOD1, IDL_ATTRIBUTE_ON_METHOD2, ...] void func([IDL_ATTRIBUTE_ON_PARAMETER1, IDL_ATTRIBUTE_ON_PARAMETER2, ...] int param, ...);
    129115    };
    130116}
     
    136122    interface INTERFACE_NAME {
    137123        const unsigned long value = 12345;
    138         attribute [IDL_ATTRIBUTE_ON_ATTRIBUTE1, IDL_ATTRIBUTE_ON_ATTRIBUTE2, ...] Node node;
    139         [IDL_ATTRIBUTE_ON_METHOD1, IDL_ATTRIBUTE_ON_METHOD2, ...] void func(in [IDL_ATTRIBUTE_ON_PARAMETER1, IDL_ATTRIBUTE_ON_PARAMETER2, ...] int param, ...);
     124        [IDL_ATTRIBUTE_ON_ATTRIBUTE1, IDL_ATTRIBUTE_ON_ATTRIBUTE2, ...] attribute Node node;
     125        [IDL_ATTRIBUTE_ON_METHOD1, IDL_ATTRIBUTE_ON_METHOD2, ...] void func([IDL_ATTRIBUTE_ON_PARAMETER1, IDL_ATTRIBUTE_ON_PARAMETER2, ...] int param, ...);
    140126    };
    141127}
     
    160146Tools/Scripts/run-bindings-tests tests IDL attributes.
    161147Specifically, run-bindings-tests reads WebCore/bindings/scripts/test/*.idl,
    162 and then generates bindings code to WebCore/bindings/scripts/test/{JS,V8,ObjC,GObject,CPP}/*.
     148and then generates bindings code to WebCore/bindings/scripts/test/{JS,ObjC,GObject,CPP}/*.
    163149For example, run-bindings-tests reads WebCore/bindings/scripts/test/TestObj.idl,
    164150and then generates bindings code to WebCore/bindings/scripts/test/JS/JSTestObj.h, WebCore/bindings/scripts/test/JS/JSTestObj.cpp, etc.
     
    203189    WebKitBuild/Release/DerivedSources/WebCore/JSXXX.cpp
    204190}}}
    205  * V8:
    206 
    207 {{{
    208     out/Release/obj/gen/webkit/bindings/V8XXX.h
    209     out/Release/obj/gen/webcore/bindings/V8XXX.cpp
    210 }}}
    211191 * ObjC:
    212192
     
    234214 * A name should be aligned with the Web IDL spec as much as possible.
    235215 * JavaScriptCore-specific IDL attributes are prefixed by "JS".
    236  * V8-specific IDL attributes are prefixed by "V8".
    237216 * ObjC-specific IDL attributes are prefixed by "ObjC".
    238217 * GObject-specific IDL attributes are prefixed by "GObject".
     
    240219 * IDL attributes for custom bindings are prefixed by "Custom".
    241220
    242 For example, [JSNoStaticTables], [CustomGetter], [V8CustomGetter], etc.
     221For example, `[JSNoStaticTables]`, `[CustomGetter]`, etc.
    243222
    244223= IDL attributes = #IDLAttributes
     
    246225In the following explanations, (i), (m), (a) or (p) means that a given IDL attribute can be specified on interfaces, methods, attributes and parameters, respectively. For example, (a,p) means that the IDL attribute can be specified on attributes and parameters.
    247226
    248 == [TreatNullAs](a,p), [TreatUndefinedAs](a,p) == #TreatNullAs
     227== `[TreatNullAs]`(a,p), `[TreatUndefinedAs]`(a,p) == #TreatNullAs
    249228
    250229 * [http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs The spec of TreatNullAs] (Note: The WebKit behavior explained below is different from the spec)
     
    253232Summary: They control the behavior when a JavaScript null or undefined is passed to a DOMString attribute or parameter.
    254233
    255 Usage: The possible usage is [TreatNullAs=NullString] or [TreatUndefinedAs=NullString].
     234Usage: The possible usage is `[TreatNullAs=NullString]` or `[TreatUndefinedAs=NullString]`.
    256235They can be specified on DOMString attributes or DOMString parameters only:
    257236{{{
    258     attribute [TreatNullAs=NullString] DOMString str;
    259     void func(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString str);
    260 }}}
    261 
    262 [TreatNullAs=NullString] indicates that if a JavaScript null is passed to the attribute or parameter,
     237    [TreatNullAs=NullString] attribute DOMString str;
     238    void func([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString str);
     239}}}
     240
     241`[TreatNullAs=NullString]` indicates that if a JavaScript null is passed to the attribute or parameter,
    263242then it is converted to a WebKit null string, for which both String::IsEmpty() and String::IsNull() will return true.
    264 Without [TreatNullAs=NullString], a JavaScript null is converted to a WebKit string "null".
    265 
    266 [TreatNullAs=NullString] in WebKit corresponds to [TreatNullAs=EmptyString] in the Web IDL spec.
    267 Unless the spec specifies [TreatNullAs=EmptyString], you should not specify [TreatNullAs=NullString] in WebKit.
    268 
    269 [TreatUndefinedAs=NullString] indicates that if a JavaScript undefined is passed to the attribute or parameter,
     243Without `[TreatNullAs=NullString]`, a JavaScript null is converted to a WebKit string "null".
     244
     245`[TreatNullAs=NullString]` in WebKit corresponds to `[TreatNullAs=EmptyString]` in the Web IDL spec.
     246Unless the spec specifies `[TreatNullAs=EmptyString]`, you should not specify `[TreatNullAs=NullString]` in WebKit.
     247
     248`[TreatUndefinedAs=NullString]` indicates that if a JavaScript undefined is passed to the attribute or parameter,
    270249then it is converted to a WebKit null string, for which both String::IsEmpty() and String::IsNull() will return true.
    271 Without [TreatUndefinedAs=NullString], a JavaScript undefined is converted to a WebKit string "undefined".
    272 
    273 [TreatUndefinedAs=NullString] in WebKit corresponds to [TreatUndefinedAs=EmptyString] in the Web IDL spec.
    274 Unless the spec specifies [TreatUndefinedAs=EmptyString], you should not specify [TreatUndefinedAs=NullString] in WebKit.
    275 
    276 Note: For now the sole usage of [TreatUndefinedAs=NullString] is not allowed.
    277 [TreatUndefinedAs=NullString] must be used with [TreatNullAs=NullString], i.e. [TreatNullAs=NullString, TreatUndefinedAs=NullString].
    278 
    279 == [TreatReturnedNullStringAs](m,a) == #TreatReturnedNullStringAs
    280 
    281 Summary: [TreatReturnedNullStringAs] controls the behavior when a WebKit null string is returned from the WebCore implementation.
    282 
    283 Usage: The possible usage is [TreatReturnedNullStringAs=Null], [TreatReturnedNullStringAs=Undefined] or [TreatReturnedNullStringAs=False].
     250Without `[TreatUndefinedAs=NullString]`, a JavaScript undefined is converted to a WebKit string "undefined".
     251
     252`[TreatUndefinedAs=NullString]` in WebKit corresponds to `[TreatUndefinedAs=EmptyString]` in the Web IDL spec.
     253Unless the spec specifies `[TreatUndefinedAs=EmptyString]`, you should not specify `[TreatUndefinedAs=NullString]` in WebKit.
     254
     255Note: For now the sole usage of `[TreatUndefinedAs=NullString]` is not allowed.
     256`[TreatUndefinedAs=NullString]` must be used with `[TreatNullAs=NullString]`, i.e. `[TreatNullAs=NullString, TreatUndefinedAs=NullString]`.
     257
     258== `[TreatReturnedNullStringAs]`(m,a) == #TreatReturnedNullStringAs
     259
     260Summary: `[TreatReturnedNullStringAs]` controls the behavior when a WebKit null string is returned from the WebCore implementation.
     261
     262Usage: The possible usage is `[TreatReturnedNullStringAs=Null]`, `[TreatReturnedNullStringAs=Undefined]` or `[TreatReturnedNullStringAs=False]`.
    284263They can be specified on DOMString attributes or methods that return a DOMString value:
    285264{{{
    286     attribute [TreatReturnedNullStringAs=Null] DOMString str;
     265    [TreatReturnedNullStringAs=Null] attribute DOMString str;
    287266    [TreatReturnedNullStringAs=Undefined] DOMString func();
    288267}}}
    289268
    290  * [TreatReturnedNullStringAs=Null] indicates that if the returned DOMString is a WebKit null string, the returned value is treated as a JavaScript null.
    291  * [TreatReturnedNullStringAs=Undefined] indicates that if the returned DOMString is a WebKit null string, the returned value is treated as a JavaScript undefined.
    292  * [TreatReturnedNullStringAs=False] indicates that if the returned DOMString is a WebKit null string, the returned value is treated as a JavaScript false.
    293 
    294 Without [TreatReturnedNullStringAs=...], if the returned DOMString is a WebKit null string, then the returned value is treated as a JavaScript empty string ''.
    295 
    296 Note that what should be specified on [TreatReturnedNullStringAs=...] depends on the spec of each attribute or method.
    297 
    298 == [Optional](p) == #Optional
    299 
    300 Summary: [Optional] allows method overloading for methods whose argument counts are different with each other.
    301 
    302 Usage: The possible usage is [Optional], [Optional=DefaultIsUndefined] or [Optional=DefaultIsNullString].
    303 [Optional] and [Optional=DefaultIsUndefined] can be specified on parameters.
    304 [Optional=DefaultIsNullString] can be specified on DOMString parameters only:
     269 * `[TreatReturnedNullStringAs=Null]` indicates that if the returned DOMString is a WebKit null string, the returned value is treated as a JavaScript null.
     270 * `[TreatReturnedNullStringAs=Undefined]` indicates that if the returned DOMString is a WebKit null string, the returned value is treated as a JavaScript undefined.
     271 * `[TreatReturnedNullStringAs=False]` indicates that if the returned DOMString is a WebKit null string, the returned value is treated as a JavaScript false.
     272
     273Without `[TreatReturnedNullStringAs=...]`, if the returned DOMString is a WebKit null string, then the returned value is treated as a JavaScript empty string ''.
     274
     275Note that what should be specified on `[TreatReturnedNullStringAs=...]` depends on the spec of each attribute or method.
     276
     277== `[Default]`(p) == #Default
     278
     279Summary: `[Default]` allows specifying the default values for optional parameters to simplify WebCore implementations which otherwise require overloads.
     280
     281Standard: In Web IDL, `[Default=NullString]` is written as `"type identifier = default"`, e.g. `optional DOMString? str = null`
     282
     283Usage: The possible usages are `[Default=Undefined]` or `[Default=NullString]`. `[Default=Undefined]` can be specified on any optional parameter. `[Default=NullString]` can be specified on DOMString parameters only:
     284
    305285{{{
    306286    interface HTMLFoo {
    307         void func1(in int a, in int b, in [Optional] int c, in [Optional] int d);
    308         void func2(in int a, in int b, in [Optional=DefaultIsUndefined] int c);
    309         void func3(in int a, in int b, in [Optional=DefaultIsUndefined] DOMString c, in [Optional=DefaultIsNullString] DOMString d);
    310     };
    311 }}}
    312 
    313 The parameters marked with [Optional=...] are optional, and JavaScript can omit the parameters. Obviously, if parameter X is marked with [Optional=...], then all subsequent parameters of X should be marked with [Optional=...].
    314 
    315 The difference between [Optional] and [Optional=DefaultIsUndefined] is whether the WebCore implementation has overloaded methods or not, as explained below.
    316 
    317 In case of func1(...), if JavaScript calls func1(100, 200), then HTMLFoo::func1(int a, int b) is called in WebCore.
    318 If JavaScript calls func1(100, 200, 300), then HTMLFoo::func1(int a, int b, int c) is called in WebCore.
    319 If JavaScript calls func1(100, 200, 300, 400), then HTMLFoo::func1(int a, int b, int c, int d) is called in WebCore.
    320 In other words, if the WebCore implementation has overloaded methods, you can use [Optional].
    321 
    322 In case of func2(...), if JavaScript calls func2(100, 200), then it behaves as if JavaScript called func2(100, 200, undefined).
    323 Consequently, HTMLFoo::func2(int a, int b, int c) is called in WebCore.
    324 100 is passed to a, 200 is passed to b, and 0 is passed to c.
    325 (A JavaScript undefined is converted to 0, following the value conversion rule in the Web IDL spec.)
    326 In this way, WebCore needs to just implement func2(int a, int b, int c) and needs not to implement both func2(int a, int b) and func2(int a, int b, int c).
    327 
    328 The difference between [Optional=DefalutIsUndefined] and [Optional=DefaultIsNullString] appears only when the parameter type is DOMString.
    329 In [Optional=DefalutIsUndefined], the "supplemented" JavaScript undefined is converted to a WebKit string "undefined".
    330 On the other hand, in [Optional=DefaultIsNullString], the "supplemented" JavaScript undefined is converted to a WebKit null string.
    331 For example, if JavaScript calls func3(100, 200), then HTMLFoo::func3(int a, int b, String c, String d) is called in WebCore.
    332 At this point, 100 is passed to a, 200 is passed to b, a WebKit string "undefined" is passed to c, and a WebKit null string is passed to d.
    333 d.IsEmpty() and d.IsNull() return true.
    334 
    335 == [Clamp](a,p) == #Clamp
     287        void func1(int a, int b, optional int c, optional int d);
     288        void func2(int a, int b, [Default=Undefined] optional int c);
     289        void func3(int a, int b, [Default=Undefined] optional DOMString c, [Default=NullString] optional DOMString d);
     290    };
     291}}}
     292
     293The parameters marked with the standard Web IDL optional qualifier are optional, and JavaScript can omit the parameters. Obviously, if parameter X is marked with optional then all subsequent parameters of X should be marked with optional.
     294
     295The difference between optional and `[Default=Undefined]` optional is whether the WebCore implementation has overloaded methods or not, as explained below.
     296
     297In case of `func1(...)`, if JavaScript calls `func1(100, 200)`, then `HTMLFoo::func1(int a, int b)` is called in WebCore. If JavaScript calls `func1(100, 200, 300)`, then `HTMLFoo::func1(int a, int b, int c)` is called in WebCore. If JavaScript calls `func1(100, 200, 300, 400)`, then `HTMLFoo::func1(int a, int b, int c, int d)` is called in WebCore. In other words, if the WebCore implementation has overloaded methods, you can use optional.
     298
     299In case of `func2(...)` which adds `[Default=Undefined]`, if JavaScript calls `func2(100, 200)`, then it behaves as if JavaScript called `func2(100, 200, undefined)`. Consequently, `HTMLFoo::func2(int a, int b, int c)` is called in WebCore. 100 is passed to a, 200 is passed to b, and 0 is passed to c. (A JavaScript undefined is converted to 0, following the value conversion rule in the Web IDL spec.) In this way, WebCore needs to just implement `func2(int a, int b, int c)` and needs not to implement both `func2(int a, int b)` and `func2(int a, int b, int c)`.
     300
     301The difference between `[Default=Undefined]` and `[Default=NullString]` appears only when the parameter type is DOMString. In `[Default=Undefined]` the "supplemented" JavaScript undefined is converted to a WebKit string "undefined". On the other hand, in `[Default=NullString]` the "supplemented" JavaScript undefined is converted to a WebKit null string. For example, if JavaScript calls `func3(100, 200)`, then `HTMLFoo::func3(int a, int b, String c, String d)` is called in WebCore. At this point, 100 is passed to a, 200 is passed to b, a WebKit string "undefined" is passed to c, and a WebKit null string is passed to d. d.IsEmpty() and d.IsNull() return true.
     302
     303== `[Clamp]`(a,p) == #Clamp
    336304
    337305 * [http://www.w3.org/TR/2012/CR-WebIDL-20120419/#Clamp The spec of Clamp]
    338306
    339 Summary: [Clamp] indicates that when an ECMAScript Number is converted to the IDL type, out of range values will be clamped to the range of valid values,
     307Summary: `[Clamp]` indicates that when an ECMAScript Number is converted to the IDL type, out of range values will be clamped to the range of valid values,
    340308rather than using the operators that use a modulo operation (ToInt32, ToUint32, etc.).
    341309
    342 Usage: The [Clamp] extended attribute MUST NOT appear on a read only attribute, or an attribute, operation argument or dictionary member
     310Usage: The `[Clamp]` extended attribute MUST NOT appear on a read only attribute, or an attribute, operation argument or dictionary member
    343311that is not of an integer type.
    344312
     
    347315{{{
    348316    interface XXX {
    349         attribute [Clamp] unsigned short attributeName;
     317        [Clamp] attribute unsigned short attributeName;
    350318    };
    351319}}}
     
    360328}}}
    361329
    362 Calling the non-[Clamp] version of setColor() uses ToUint8 to coerce the Numbers to octets.
    363 Hence calling context.setColor(-1, 255, 257) is equivalent to calling setColor(255, 255, 1).
    364 
    365 Calling the [Clamp] version of setColor() uses clampTo() to coerce the Numbers to octets.
    366 Hence calling context.setColor(-1, 255, 257) is equivalent to calling setColorClamped(0, 255, 255).
    367 
    368 == [Callback](i,p) FIXME == #Callback
    369 
    370 Summary: ADD SUMMARY
    371 
    372 Usage: [Callback] can be specified on interfaces and parameters:
    373 {{{
    374     interface [
    375         Callback
    376     ] HTMLFoo {
    377         void func(in int a, in [Callback] int b);
    378     };
    379 }}}
    380 
    381 ADD EXPLANATIONS
    382 
    383 == [Custom](m,a), [JSCustom](m,a), [V8Custom](m,a), [CustomGetter](a), [JSCustomGetter](a), [V8CustomGetter](a), [CustomSetter](a), [JSCustomSetter](a), [V8CustomSetter](a) == #Custom
     330Calling the non-`[Clamp]` version of `setColor()` uses ToUint8 to coerce the Numbers to octets.
     331Hence calling `context.setColor(-1, 255, 257)` is equivalent to calling `setColor(255, 255, 1)`.
     332
     333Calling the `[Clamp]` version of `setColor()` uses `clampTo()` to coerce the Numbers to octets.
     334Hence calling `context.setColor(-1, 255, 257)` is equivalent to calling `setColorClamped(0, 255, 255)`.
     335
     336== `[Custom]`(m,a), `[CustomGetter]`(a), `[CustomSetter]`(a) == #Custom
    384337
    385338Summary: They allow you to write bindings code manually as you like.
    386339
    387 Usage: [Custom], [JSCustom] and [V8Custom] can be specified on methods or attributes. [CustomGetter], [JSCustomGetter], [V8CustomGetter], [CustomSetter], [JSCustomSetter], [V8CustomSetter] can be specified on attributes:
     340Usage: `[Custom]` can be specified on methods or attributes. `[CustomGetter]`, `[CustomSetter]` can be specified on attributes:
    388341{{{
    389342    [Custom] void func();
    390     attribute [CustomGetter, JSCustomSetter] DOMString str;
     343    [CustomGetter, JSCustomSetter] attribute DOMString str;
    391344}}}
    392345
    393346We should minimize the number of custom bindings as much as possible, since they are likely to be buggy.
    394 Before using [Custom], you should doubly consider if you really need custom bindings.
    395 You are recommended to modify code generators to avoid using [Custom].
     347Before using `[Custom]`, you should doubly consider if you really need custom bindings.
     348You are recommended to modify code generators to avoid using `[Custom]`.
    396349
    397350Before explaining the details, let us clarify the relationship of these IDL attributes.
    398351
    399  * [JSCustom] on a method indicates that you can write JavaScriptCore custom bindings for the method.
    400  * [V8Custom] on a method indicates that you can write V8 custom bindings for the method.
    401  * [Custom] on a method is equivalent to [JSCustom, V8Custom].
    402  * [JSCustomGetter] or [JSCustomSetter] on an attribute indicates that you can write JavaScriptCore custom bindings for the attribute getter or setter.
    403  * [V8CustomGetter] or [V8CustomSetter] on an attribute indicates that you can write V8 custom bindings for the attribute getter or setter.
    404  * [JSCustom] on an attribute is equivalent to [JSCustomGetter, JSCustomSetter].
    405  * [V8Custom] on an attribute is equivalent to [V8CustomGetter, V8CustomSetter].
    406  * [Custom] on an attribute is equivalent to [JSCustom, V8Custom], i.e. [JSCustomGetter, JSCustomSetter, V8CustomGetter, V8CustomSetter].
    407 
    408 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].
    409 
    410 How to write custom bindings is different between JavaScriptCore and V8 or between a method and an attribute getter/setter, as follows:
    411 
    412  * Method in JavaScriptCore: Consider the following example:
     352 * `[Custom]` on a method indicates that you can write JavaScriptCore custom bindings for the method.
     353 * `[CustomGetter]` or `[CustomSetter]` on an attribute indicates that you can write JavaScriptCore custom bindings for the attribute getter or setter.
     354
     355You can write custom bindings with JavaScriptCore for a method or an attribute getter/setter, as follows:
     356
     357 * Method: Consider the following example:
    413358
    414359{{{
    415360    interface XXX {
    416         [JSCustom] void func(in int a, in int b);
     361        [Custom] void func(int a, int b);
    417362    };
    418363}}}
     
    426371Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    427372
    428  * Attribute getter in JavaScriptCore: Consider the following example:
     373 * Attribute getter: Consider the following example:
    429374
    430375{{{
    431376    interface XXX {
    432         attribute [JSCustomGetter] DOMString str;
     377        [CustomGetter] attribute DOMString str;
    433378    };
    434379}}}
     
    442387Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    443388
    444  * Attribute setter in JavaScriptCore: Consider the following example:
     389 * Attribute setter: Consider the following example:
    445390
    446391{{{
    447392    interface XXX {
    448         attribute [JSCustomSetter] DOMString str;
     393        [CustomSetter] attribute DOMString str;
    449394    };
    450395}}}
     
    456401    }
    457402}}}
    458 Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    459 
    460  * Method in V8: Consider the following example:
    461 
    462 {{{
    463     interface XXX {
    464         [V8Custom] void func(in int a, in int b);
    465     };
    466 }}}
    467 You can write custom bindings in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    468 {{{
    469     v8::Handle<v8::Value> V8XXX::funcCallback(const v8::Arguments& args)
    470     {
    471         ...;
    472     }
    473 }}}
    474 Refer to WebCore/bindings/v8/custom/V8XXXCustom.cpp for more details.
    475 
    476  * Attribute getter in V8: Consider the following example:
    477 
    478 {{{
    479     interface XXX {
    480         attribute [V8CustomGetter] DOMString str;
    481     };
    482 }}}
    483 You can write custom bindings in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    484 {{{
    485     v8::Handle<v8::Value> V8XXX::strAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    486     {
    487         ...;
    488     }
    489 }}}
    490 Refer to WebCore/bindings/v8/custom/V8XXXCustom.cpp for more details.
    491 
    492  * Attribute setter in V8: Consider the following example:
    493 
    494 {{{
    495     interface XXX {
    496         attribute [V8CustomSetter] DOMString str;
    497     };
    498 }}}
    499 You can write custom bindings in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    500 {{{
    501     void V8XXX::strAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
    502     {
    503         ...;
    504     }
    505 }}}
    506 Refer to WebCore/bindings/v8/custom/V8XXXCustom.cpp for more details.
    507403
    508404Note: ObjC, GObject and CPP bindings do not support custom bindings.
    509405
    510 == [CallWith](i,m,a) == #CallWith
    511 
    512 Summary: [CallWith] indicates that the bindings code calls a WebCore method with additional information.
    513 
    514 Usage: The possible usage is [CallWith=X1|X2|X3|...], where X1, X2, X3, ... is "ScriptExecutionContext", "ScriptState", "ScriptArguments" or "CallStack".
     406== `[CallWith]`(i,m,a) == #CallWith
     407
     408Summary: `[CallWith]` indicates that the bindings code calls a WebCore method with additional information.
     409
     410Usage: The possible usage is `[CallWith=X1|X2|X3|...]`, where X1, X2, X3, ... is "ScriptExecutionContext", "ScriptState", "ScriptArguments" or "CallStack".
    515411"ScriptExecutionContext", "ScriptState" and "CallStack" can be specified on methods or attributes,
    516412but "ScriptArguments" can be specified on methods only:
    517413{{{
    518414    interface HTMLFoo {
    519         attribute [CallWith=ScriptExecutionContext] DOMString str;
    520         [CallWith=ScriptExecutionContext] void func1(in int a, in int b);
    521         [CallWith=ScriptState] void func2(in int a, in int b);
    522         [CallWith=ScriptArguments|CallStack] void func3(in int a, in int b);
    523         [CallWith=CallStack|ScriptArguments] void func4(in int a, in int b);
    524     };
    525 }}}
    526 
    527 Note: [CallWith] can be also specified on interfaces but it has a different meaning.
    528 Refer to [#Constructor the [Constructor] section] for [CallWith] on interfaces.
     415        [CallWith=ScriptExecutionContext] attribute DOMString str;
     416        [CallWith=ScriptExecutionContext] void func1(int a, int b);
     417        [CallWith=ScriptState] void func2(int a, int b);
     418        [CallWith=ScriptArguments|CallStack] void func3(int a, int b);
     419        [CallWith=CallStack|ScriptArguments] void func4(int a, int b);
     420    };
     421}}}
     422
     423Note: `[CallWith]` can be also specified on interfaces but it has a different meaning.
     424Refer to [#Constructor the `[Constructor]` section] for `[CallWith]` on interfaces.
    529425
    530426In case of func1(...), HTMLFoo::func1(ScriptExecutionContext* context, int a, int b) is called in WebCore.
     
    537433In this way, the additional information is added at the head of normal arguments.
    538434The order of additional information is "ScriptExecutionContext", "ScriptState", "ScriptArguments", and then "CallStack",
    539 despite the order specified in [CallWith=X1|X2|X3|...].
    540 For example, in case of func4(...), HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b) is called in WebCore.
    541 
    542 == [StrictTypeChecking](m,a,p) FIXME == #StrictTypeChecking
     435despite the order specified in `[CallWith=X1|X2|X3|...]`.
     436For example, in case of `func4(...)`, `HTMLFoo::func3(ScriptArguments* arguments, ScriptCallStack* callstack, int a, int b)` is called in WebCore.
     437
     438== `[StrictTypeChecking]`(m,a,p) FIXME == #StrictTypeChecking
    543439
    544440Summary: ADD SUMMARY
    545441
    546 Usage: [StrictTypeChecking] can be specified on methods and attributes:
    547 {{{
    548     attribute [StringTypeChecking] float x;
     442Usage: `[StrictTypeChecking]` can be specified on methods and attributes:
     443{{{
     444    [StringTypeChecking] attribute float x;
    549445    [StrictTypeChecking] DOMString func();
    550446}}}
     
    552448ADD EXPLANATIONS
    553449
    554 V8 and JSC: [StrictTypeChecking] can also be applied to a DOMString parameter in an overloaded method to make the
     450JSC: `[StrictTypeChecking]` can also be applied to a DOMString parameter in an overloaded method to make the
    555451overload resolution only match for ECMAScript types null, undefined, string or object - and not number or boolean.
    556452This is to permit overloads which are not "distinguishable" in WebIDL, for example:
     
    558454{{{
    559455    interface CanvasFoo {
    560         void setColor(in [StrictTypeChecking] DOMString color);
    561         void setColor(in float grayLevel);
    562     };
    563 }}}
    564 
    565 == [ReturnNewObject](m,a) == #ReturnNewObject
    566 
    567 Summary: [ReturnNewObject] controls whether WebCore can return a cached wrapped object or WebCore needs to return a newly created wrapped object every time.
    568 
    569 Usage: [ReturnNewObject] can be specified on methods or attributes:
    570 {{{
    571     attribute [ReturnNewObject] Node node;
     456        void setColor([StrictTypeChecking] DOMString color);
     457        void setColor(float grayLevel);
     458    };
     459}}}
     460
     461== `[ReturnNewObject]`(m,a) == #ReturnNewObject
     462
     463Summary: `[ReturnNewObject]` controls whether WebCore can return a cached wrapped object or WebCore needs to return a newly created wrapped object every time.
     464
     465Usage: `[ReturnNewObject]` can be specified on methods or attributes:
     466{{{
     467    [ReturnNewObject] attribute Node node;
    572468    [ReturnNewObject] Node createTextNode();
    573469}}}
    574470
    575 Without [ReturnNewObject], JavaScriptCore and V8 cache a wrapped object for performance.
    576 For example, consider the case where node.firstChild is accessed:
    577 
    578  1. Node::firstChild() is called in WebCore.
    579  1. The result of Node::firstChild() is passed to toJS() or toV8().
    580  1. toJS() or toV8() checks if a wrapped object of the result is already cached on the node.
     471Without `[ReturnNewObject]`, JavaScriptCore cache a wrapped object for performance.
     472For example, consider the case where `node.firstChild` is accessed:
     473
     474 1. `Node::firstChild()` is called in WebCore.
     475 1. The result of `Node::firstChild()` is passed to `toJS()`.
     476 1. `toJS()` checks if a wrapped object of the result is already cached on the node.
    581477 1. If cached, the cached wrapped object is returned. That's it.
    582  1. Otherwise, toJS() or toV8() creates the wrapped object of the result.
     478 1. Otherwise, `toJS()` creates the wrapped object of the result.
    583479 1. The created wrapped object is cached on the node.
    584480 1. The wrapped object is returned.
    585481
    586482On the other hand, if you do not want to cache the wrapped object and want to create the wrapped object every time,
    587 you can specify [ReturnNewObject].
    588 
    589 == [ImplementedAs](m,a) == #ImplementedAs
    590 
    591 Summary: [ImplementedAs] specifies a method name in WebCore, if the method name in an IDL file and the method name in WebCore are different.
    592 
    593 Usage: The possible usage is [ImplementedAs=XXX], where XXX is a method name in WebCore.
    594 [ImplementedAs] can be specified on methods:
     483you can specify `[ReturnNewObject]`.
     484
     485== `[ImplementedAs]`(m,a) == #ImplementedAs
     486
     487Summary: `[ImplementedAs]` specifies a method name in WebCore, if the method name in an IDL file and the method name in WebCore are different.
     488
     489Usage: The possible usage is `[ImplementedAs=XXX]`, where `XXX` is a method name in WebCore.
     490`[ImplementedAs]` can be specified on methods:
    595491{{{
    596492    [ImplementedAs=deleteFunction] void delete();
    597     attribute [ImplementedAs=classAttribute] int class;
     493    [ImplementedAs=classAttribute] attribute int class;
    598494}}}
    599495
    600496Basically a method name in WebCore should be the same as the method name in an IDL file.
    601497That being said, sometimes you cannot use the same method name; e.g. "delete" is reserved for a C++ keyword.
    602 In such cases, you can explicitly specify the method name in WebCore by [ImplementedAs].
    603 You should avoid using [ImplementedAs] as much as possible though.
    604 
    605 == [Reflect](a) == #Reflect
     498In such cases, you can explicitly specify the method name in WebCore by `[ImplementedAs]`.
     499You should avoid using `[ImplementedAs]` as much as possible though.
     500
     501== `[Reflect]`(a) == #Reflect
    606502
    607503 * [http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#reflect The spec of Reflect]
    608504
    609 Summary: [Reflect] indicates that a given attribute should reflect the values of a corresponding content attribute.
    610 
    611 Usage: The possible usage is [Reflect] or [Reflect=X], where X is the name of a corresponding content attribute.
    612 [Reflect] can be specified on attributes:
     505Summary: `[Reflect]` indicates that a given attribute should reflect the values of a corresponding content attribute.
     506
     507Usage: The possible usage is `[Reflect]` or `[Reflect=X]`, where `X` is the name of a corresponding content attribute.
     508`[Reflect]` can be specified on attributes:
    613509{{{
    614510    interface Element {
    615         attribute [Reflect] DOMString id;
    616         attribute [Reflect=class] DOMString className;
     511        [Reflect] attribute DOMString id;
     512        [Reflect=class] attribute DOMString className;
    617513    };
    618514}}}
     
    624520Here 'id' and 'class' are content attributes.
    625521
    626 If a given attribute in an IDL file is marked as [Reflect],
     522If a given attribute in an IDL file is marked as `[Reflect]`,
    627523it indicates that the attribute getter returns the value of the corresponding content attribute
    628524and that the attribute setter sets the value of the corresponding content attribute.
     
    630526
    631527If the name of the corresponding content attribute is different from the attribute name in an IDL file,
    632 you can specify the content attribute name by [Reflect=X].
    633 For example, in case of [Reflect=class], if 'div.className="barClass"' is evaluated, then "barClass" is set to the 'class' content attribute.
    634 
    635 Whether [Reflect] should be specified or not depends on the spec of each attribute.
    636 
    637 == [Replaceable](a) == #Replaceable
     528you can specify the content attribute name by `[Reflect=X]`.
     529For example, in case of `[Reflect=class]`, if `'div.className="barClass"'` is evaluated, then "barClass" is set to the 'class' content attribute.
     530
     531Whether `[Reflect]` should be specified or not depends on the spec of each attribute.
     532
     533== `[Replaceable]`(a) == #Replaceable
    638534
    639535 * [http://dev.w3.org/2006/webapi/WebIDL/#Replaceable The spec of Replaceable]
    640536
    641 Summary: [Replaceable] controls if a given attribute is "replaceable" or not.
    642 
    643 Usage: [Replaceable] can be specified on attributes:
     537Summary: `[Replaceable]` controls if a given attribute is "replaceable" or not.
     538
     539Usage: `[Replaceable]` can be specified on attributes:
    644540{{{
    645541    interface DOMWindow {
    646         attribute [Replaceable] screenX;
     542        [Replaceable] attribute screenX;
    647543    };
    648544}}}
     
    651547If you delete the new value, then the original value still remains.
    652548
    653 Specifically, without [Replaceable], the attribute behaves as follows:
     549Specifically, without `[Replaceable]`, the attribute behaves as follows:
    654550{{{
    655551    window.screenX; // Evaluates to 0
     
    660556}}}
    661557
    662 With [Replaceable], the attribute behaves as follows:
     558With `[Replaceable]`, the attribute behaves as follows:
    663559{{{
    664560    window.screenX; // Evaluates to 0
     
    669565}}}
    670566
    671 Whether [Replaceable] should be specified or not depends on the spec of each attribute.
    672 
    673 == [Deletable](a), [NotEnumerable](a), [V8ReadOnly](a) == #Deletable
     567Whether `[Replaceable]` should be specified or not depends on the spec of each attribute.
     568
     569== `[Deletable]`(a), `[NotEnumerable]`(a)`(a) == #Deletable
    674570
    675571 * [http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf The spec of Writable, Enumerable and Configurable (Section 8.6.1)]
    676572
    677 Summary: They control Writability, Enumerability and Configurability of attributes.
     573Summary: They control `Writability`, `Enumerability` attributes (`readonly` keyword controls the `Configurability` attributes).
    678574
    679575Usage: They can be specified on attributes:
    680576{{{
    681     attribute [NotEnumerable, Deletable] DOMString str;
     577    [NotEnumerable, Deletable] attribute DOMString str;
    682578    readonly attribute DOMString readonlyStr;
    683     attribute [V8ReadOnly] DOMString readonlyStrOnV8;
    684 }}}
    685 
    686 By default, non-"readonly" attributes are enumerable, writable and not deletable. "readonly" attributes are enumerable, not writable and not deletable. You can change the default behavior using [Deletable], [NotEnumerable] or [V8ReadOnly].
    687 
    688  * [Deletable] indicates that the attribute is deletable.
    689  * [NotEnumerable] indicates that the attribute is not enumerable.
    690  * [V8ReadOnly] indicates that the attribute is readonly in V8 even if the attribute is not prefixed by "readonly".
    691 
    692 == [CachedAttribute](a) == #CachedAttribute
    693 
    694 Summary: For performance optimization, [CachedAttribute] indicates that a wrapped object should be cached on a DOM object.
    695 
    696 Usage: [CachedAttribute] can be specified on attributes:
     579}}}
     580
     581By default, non-"readonly" attributes are enumerable, writable and not deletable. "readonly" attributes are enumerable, not writable and not deletable. You can change the default behavior using `[Deletable]`, `[NotEnumerable]` or `readonly`.
     582
     583 * `[Deletable]` indicates that the attribute is deletable.
     584 * `[NotEnumerable]` indicates that the attribute is not enumerable.
     585 * `readonly` indicates that the attribute is read only.
     586
     587== `[CachedAttribute]`(a) == #CachedAttribute
     588
     589Summary: For performance optimization, `[CachedAttribute]` indicates that a wrapped object should be cached on a DOM object.
     590
     591Usage: `[CachedAttribute]` can be specified on attributes:
    697592{{{
    698593    interface HTMLFoo {
    699         attribute [CachedAttribute] DOMString normalValue;
    700         attribute [CachedAttribute] SerializedScriptValue serializedValue;
    701     };
    702 }}}
    703 
    704 Without [CachedAttribute], the normalValue getter works in the following way:
    705 
    706  1. HTMLFoo::normalValue() is called in WebCore.
    707  1. The result of HTMLFoo::normalValue() is passed to toJS() or toV8(), and is converted to a wrapped object.
     594        [CachedAttribute] attribute DOMString normalValue;
     595        [CachedAttribute] attribute SerializedScriptValue serializedValue;
     596    };
     597}}}
     598
     599Without `[CachedAttribute]`, the normalValue getter works in the following way:
     600
     601 1. `HTMLFoo::normalValue()` is called in WebCore.
     602 1. The result of `HTMLFoo::normalValue()` is passed to `toJS()`, and is converted to a wrapped object.
    708603 1. The wrapped object is returned.
    709604
    710 In case where HTMLFoo::normalValue() or the operation to wrap the result is weight,
     605In case where `HTMLFoo::normalValue()` or the operation to wrap the result is weight,
    711606you can cache the wrapped object onto the DOM object.
    712 With [CachedAttribute], the normalValue getter works in the following way:
     607With `[CachedAttribute]`, the normalValue getter works in the following way:
    713608
    714609 1. If the wrapped object is cached, the cached wrapped object is returned. That's it.
    715  1. Otherwise, HTMLFoo::normalValue() is called in WebCore.
    716  1. The result of HTMLFoo::normalValue() is passed to toJS() or toV8(), and is converted to a wrapped object.
     610 1. Otherwise, `HTMLFoo::normalValue()` is called in WebCore.
     611 1. The result of `HTMLFoo::normalValue()` is passed to `toJS()`, and is converted to a wrapped object.
    717612 1. The wrapped object is cached.
    718613 1. The wrapped object is returned.
    719614
    720 In particular, [CachedAttribute] will be useful for serialized values, since deserialization can be weight.
    721 Without [CachedAttribute], the serializedValue getter works in the following way:
    722 
    723  1. HTMLFoo::serializedValue() is called in WebCore.
    724  1. The result of HTMLFoo::serializedValue() is deserialized.
    725  1. The deserialized result is passed to toJS() or toV8(), and is converted to a wrapped object.
     615In particular, `[CachedAttribute]` will be useful for serialized values, since deserialization can be weight.
     616Without `[CachedAttribute]`, the serializedValue getter works in the following way:
     617
     618 1. `HTMLFoo::serializedValue()` is called in WebCore.
     619 1. The result of `HTMLFoo::serializedValue()` is deserialized.
     620 1. The deserialized result is passed to `toJS()`, and is converted to a wrapped object.
    726621 1. The wrapped object is returned.
    727622
    728 In case where HTMLFoo::serializedValue(), the deserialization or the operation to wrap the result is weight,
     623In case where `HTMLFoo::serializedValue()`, the deserialization or the operation to wrap the result is weight,
    729624you can cache the wrapped object onto the DOM object.
    730 With [CachedAttribute], the serializedValue getter works in the following way:
     625With `[CachedAttribute]`, the serializedValue getter works in the following way:
    731626
    732627 1. If the wrapped object is cached, the cached wrapped object is returned. That's it.
    733  1. Otherwise, HTMLFoo::serializedValue() is called in WebCore.
    734  1. The result of HTMLFoo::serializedValue() is deserialized.
    735  1. The deserialized result is passed to toJS() or toV8(), and is converted to a wrapped object.
     628 1. Otherwise, `HTMLFoo::serializedValue()` is called in WebCore.
     629 1. The result of `HTMLFoo::serializedValue()` is deserialized.
     630 1. The deserialized result is passed to `toJS()`, and is converted to a wrapped object.
    736631 1. The wrapped object is cached.
    737632 1. The wrapped object is returned.
     
    742637In addition, setters always need to invalidate the cache.
    743638
    744 == [V8Unforgeable](m,a), [V8OnProto](m,a) == #V8Unforgeable
    745 
    746  * [http://dev.w3.org/2006/webapi/WebIDL/#Unforgeable The spec of Unforgeable]
    747 
    748 Summary: They control where a getter/setter of a given attribute is defined.
    749 
    750 Usage: They can be specified on methods or attributes:
    751 {{{
    752     [V8Unforgeable] void func();
    753     attribute [V8OnProto] DOMString str;
    754 }}}
    755 
    756 By default in JSC and V8, attribute getters/setters are defined on a DOM object, and methods are defined on a prototype chain
    757 (although the Web IDL spec requires that both attribute getters/setters and methods should be defined on a prototype chain).
    758 
    759 If you want to explicitly control where an attribute getter/setter or a method is defined in V8,
    760 you can use [V8Unforgeable] or [V8OnProto].
    761 
    762  * [V8Unforgeable] indicates that an attribute getter/setter or a method should be defined on a DOM object.
    763  * [V8OnProto] indicates that an attribute getter/setter or a method should be defined on a prototype chain.
    764 
    765 Note: As explained above, the current implementation of JSC and V8 is wrong with the Web IDL spec,
    766 and [V8Unforgeable] and [V8OnProto] are used for hack.
    767 You should not use them unless you have a strong reason to use them.
    768 
    769 == [URL](a) == #URL
    770 
    771 Summary: [URL] indicates that a given DOMString represents a URL.
    772 
    773 Usage: [URL] can be specified on DOMString attributes only:
    774 {{{
    775     attribute [Reflect, URL] DOMString url;
    776 }}}
    777 
    778 You need to specify [URL] if a given DOMString represents a URL,
    779 since getters of URL attributes need to be realized in a special routine in WebKit, i.e. Element::getURLAttribute(...).
    780 If you forgot to specify [URL], then the attribute getter might cause a bug.
    781 
    782 == [JSWindowEventListener](a) FIXME == #JSWindowEventListener
     639== `[JSWindowEventListener]`(a) FIXME == #JSWindowEventListener
    783640
    784641Summary: ADD SUMMARY
    785642
    786 Usage: [JSWindowEventListener] can be specified on EventListener attributes only:
    787 {{{
    788     attribute [JSWindowEventListener] EventListener onload;
     643Usage: `[JSWindowEventListener]` can be specified on `EventListener` attributes only:
     644{{{
     645    [JSWindowEventListener] attribute EventListener onload;
    789646}}}
    790647
    791648ADD EXPLANATIONS
    792649
    793 == [Supplemental](i) == #Supplemental
    794 
    795  * [http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface The spec of Supplemental]
    796 
    797  * [http://old.nabble.com/Things-missing-from-Web-IDL-for-HTML5-td24873773.html Easy explanation of Supplemental]
    798 
    799 Summary: [Supplemental] helps WebKit modularization.
    800 [Supplemental] makes it possible to add XXX's APIs (e.g. XXX=WebAudio, WebSocket, Blob, GamePad, ...etc) without modifying code outside of WebCore/Modules/XXX/.
    801 This helps make XXX a "self-contained module".
    802 
    803 Usage: The possible usage is
    804 {{{
    805     interface [
    806         Supplemental=YYY
    807     ] XXX {
    808     };
    809 }}}
    810 where XXX implements YYY.
    811 [Supplemental] can be specified on interfaces.
    812 
    813 Without [Supplemental], if you want to add XXX's attributes or methods to DOMWindow,
    814 
    815  * you need to modify WebCore/page/DOMWindow.idl to add the XXX's attributes or methods
    816 
    817  * you need to modify WebCore/page/DOMWindow.{h,cpp} to add the WebCore implementation of the attribute getters and setters or the method callbacks.
    818 
    819 On the other hand, in the modularized world with [Supplemental], you just need to modify the code under WebCore/Modules/XXX/:
    820 
    821  * WebCore/Modules/XXX/DOMWindowXXX.idl
    822 
    823 {{{
    824    interface [
    825        Conditional=XXX,
    826        Supplemental=DOMWindow    // The attributes and methods of this interface are exposed as those of DOMWindow.
    827    ] DOMWindowXXX {
    828        attribute int foo;
    829        void bar();
    830    };
    831 }}}
    832 
    833  * WebCore/Modules/XXX/DOMWindowXXX.h
    834 
    835 {{{
    836    DOMWindowXXX::foo(...) { ... }   // The WebCore implementation of the foo attribute getter.
    837    DOMWindowXXX::setFoo(...) { ... }   // The WebCore implementation of the foo attribute setter.
    838    DOMWindowXXX::bar(...) { ... }   // The WebCore implementation of the bar() method callback.
    839 }}}
    840 
    841 As shown above, [Supplemental=DOMWindow] indicates that all the attributes and methods of DOMWindowXXX should be exposed on DOMWindow,
    842 but should be implemented in DOMWindowXXX.
    843 In this way, you can implement the attributes and methods without modifying code of DOMWindow.{h,cpp,idl}.
    844 
    845 If you want to add APIs whose implementations are likely to be independent from WebCore,
    846 it is strongly recommended to put the APIs and .h/.cpp files into WebCore/Modules/XXX/ using [Supplemental].
    847 On the other hand, if the implementations need to touch WebCore much,
    848 the APIs might not be good candidates for [Supplemental].
    849 
    850 == [Constructor](i), [CallWith](i,m,a), [ConstructorRaisesException](i) == #Constructor
     650== `[Constructor]`(i), `[CallWith]`(i,m,a), `[ConstructorRaisesException]`(i) == #Constructor
    851651
    852652 * [http://dev.w3.org/2006/webapi/WebIDL/#Constructor The spec of Constructor]
    853653
    854 Summary: [Constructor] indicates that the interface should have constructor, i.e. "new XXX()".
    855 [CallWith] and [ConstructorRaisesException] adds information when the constructor callback is called in WebCore.
    856 
    857 Usage: [Constructor], [CallWith] and [ConstructorRaisesException] can be specified on interfaces:
    858 {{{
    859     interface [
    860         Constructor(in float x, in float y, in DOMString str),
     654Summary: `[Constructor]` indicates that the interface should have constructor, i.e. "new XXX()".
     655`[CallWith]` and `[ConstructorRaisesException]` adds information when the constructor callback is called in WebCore.
     656
     657Usage: `[Constructor]`, `[CallWith]` and `[ConstructorRaisesException]` can be specified on interfaces:
     658{{{
     659    [
     660        Constructor(float x, float y, DOMString str),
    861661        ConstructorRaisesException,
    862662        CallWith=ScriptExecutionContext|ScriptState
    863     ] XXX {
    864     };
    865 }}}
    866 
    867 [Constructor(in float x, in float y, in DOMString str)] means that the interface has a constructor
    868 and the constructor signature is (in float x, in float y, in DOMString str).
     663    ] interface XXX {
     664    };
     665}}}
     666
     667`[Constructor(float x, float y, DOMString str)]` means that the interface has a constructor
     668and the constructor signature is `(float x, float y, DOMString str)`.
    869669Specifically, JavaScript can create a DOM object of XXX by the following code:
    870670{{{
    871671    var x = new XXX(1.0, 2.0, "hello");
    872672}}}
    873 Then XXX::create(float x, float y, String str) is called in WebCore.
     673Then `XXX::create(float x, float y, String str)` is called in WebCore.
    874674That way WebCore needs to implement the following method as a constructor callback:
    875675{{{
     
    880680}}}
    881681
    882 [Constructor()] is equivalent to [Constructor].
    883 
    884 If XXX::create(...) can throw Exception, you can use [ConstructorRaisesException].
    885 With [ConstructorRaisesException], a placeholder for ExceptionCode is added to the tail argument of XXX::create(...).
     682`[Constructor()]` is equivalent to `[Constructor]`.
     683
     684If `XXX::create(...)` can throw Exception, you can use `[ConstructorRaisesException]`.
     685With `[ConstructorRaisesException]`, a placeholder for ExceptionCode is added to the tail argument of `XXX::create(...)`.
    886686{{{
    887687    PassRefPtr<XXX> XXX::create(float x, float y, String str, ExceptionCode& ec)
     
    895695}}}
    896696
    897 If XXX::create(...) needs additional information like ScriptExecutionContext and ScriptState,
    898 you can specify [CallWith=ScriptExecutionContext|ScriptState].
    899 Then XXX::create(...) can have the following signature:
     697If `XXX::create(...)` needs additional information like ScriptExecutionContext and ScriptState,
     698you can specify `[CallWith=ScriptExecutionContext|ScriptState]`.
     699Then `XXX::create(...)` can have the following signature:
    900700{{{
    901701    PassRefPtr<XXX> XXX::create(ScriptExecutionContext* context, ScriptState* state, float x, float y, String str)
     
    907707Please see [#CallWith another [CallWith] section] for more details.
    908708
    909 Note that [CallWith=...] arguments are added at the head of XXX::create(...)'s arguments,
    910 and the ExceptionCode argument is added at the tail of XXX::create(...)'s arguments.
     709Note that `[CallWith=...]` arguments are added at the head of `XXX::create(...)`'s arguments,
     710and the ExceptionCode argument is added at the tail of `XXX::create(...)`'s arguments.
    911711
    912712Whether you should allow an interface to have constructor depends on the spec of the interface.
    913713
    914 Note: Currently [Constructor(...)] does not yet support [Optional] arguments. It just supports [Optional=DefaultIsUndefined] or [Optional=DefaultIsNullString].
    915 
    916 == [ConstructorTemplate](i), [InitializedByEventConstructor](a) == #ConstructorTemplate
     714Note: Currently `[Constructor(...)]` does not yet support optional arguments w/o defaults. It just supports `[Default=Undefined] optional` or `[Default=NullString] optional`.
     715
     716== `[ConstructorTemplate]`(i), `[InitializedByEventConstructor]`(a) == #ConstructorTemplate
    917717
    918718Summary: They are used for Event constructors.
    919719
    920 Usage: The possible usage is [ConstructorTemplate=Event].
    921 [ConstructorTemplate=Event] can be specified on Event interfaces only.
    922 [InitializedByEventConstructor] can be specified on attributes in the Event interfaces:
    923 {{{
    924     interface [
     720Usage: The possible usage is `[ConstructorTemplate=Event]`.
     721`[ConstructorTemplate=Event]` can be specified on Event interfaces only.
     722`[InitializedByEventConstructor]` can be specified on attributes in the Event interfaces:
     723{{{
     724    [
    925725        ConstructorTemplate=Event
    926     ] FooEvent {
     726    ] interface FooEvent {
    927727        attribute DOMString str1;
    928         attribute [InitializedByEventConstructor] DOMString str2;
     728        [InitializedByEventConstructor] attribute DOMString str2;
    929729    };
    930730}}}
    931731
    932732Since constructors for Event interfaces require special bindings,
    933 you need to use [ConstructorTemplate=Event] instead of normal [Constructor].
    934 
    935 If you specify [ConstructorTemplate=Event] on FooEvent,
     733you need to use `[ConstructorTemplate=Event]` instead of normal `[Constructor]`.
     734
     735If you specify `[ConstructorTemplate=Event]` on FooEvent,
    936736JavaScript can create a DOM object of FooEvent in the following code:
    937737{{{
     
    947747}}}
    948748
    949 [InitializedByEventConstructor] should be specified on all the attributes
     749`[InitializedByEventConstructor]` should be specified on all the attributes
    950750that needs to be initialized by the constructor.
    951751Which attributes need initialization is defined in the spec of each Event interface.
     
    953753The EventInit dictionary has bubbles and cancelable, and thus bubbles and cancelable are the only attributes
    954754that need to be initialized by the Event constructor.
    955 In other words, in case of Event, you should specify [InitializedByEventConstructor] on bubbles and cancelable.
    956 
    957 == [NamedConstructor](i) == #NamedConstructor
     755In other words, in case of Event, you should specify `[InitializedByEventConstructor]` on bubbles and cancelable.
     756
     757== `[NamedConstructor]`(i) == #NamedConstructor
    958758
    959759 * [http://dev.w3.org/2006/webapi/WebIDL/#NamedConstructor The spec of NamedConstructor]
    960760
    961761Summary: If you want to allow JavaScript to create a DOM object of XXX using a different name constructor
    962 (i.e. allow JavaScript to create an XXX object using "new YYY()", where YYY != XXX), you can use [NamedConstructor].
    963 
    964 Usage: The possible usage is [NamedConstructor=YYY].
    965 [NamedConstructor] can be specified on interfaces:
    966 {{{
    967     interface [
     762(i.e. allow JavaScript to create an XXX object using "new YYY()", where YYY != XXX), you can use `[NamedConstructor]`.
     763
     764Usage: The possible usage is `[NamedConstructor=YYY]`.
     765`[NamedConstructor]` can be specified on interfaces:
     766{{{
     767    [
    968768        NamedConstructor=Audio()
    969     ] HTMLAudioElement {
    970     };
    971 }}}
    972 
    973 The semantics is the same as [Constructor], except that JavaScript can make a DOM object not by "new HTMLAudioElement()" but by "Audio()".
     769    ] interface HTMLAudioElement {
     770    };
     771}}}
     772
     773The semantics is the same as `[Constructor]`, except that JavaScript can make a DOM object not by "new HTMLAudioElement()" but by "Audio()".
    974774
    975775Whether you should allow an interface to have a named constructor or not depends on the spec of each interface.
    976776
    977 == [CustomConstructor](i), [JSCustomConstructor](i), [V8CustomConstructor](i), [ConstructorParameters](i) == #CustomConstructor
     777== `[CustomConstructor]`(i), `[ConstructorParameters]`(i) == #CustomConstructor
    978778
    979779Summary: They allow you to write custom bindings for constructors.
    980780
    981781Usage: They can be specified on interfaces.
    982 Regarding [ConstructorParameters], the possible usage is [ConstructorParameters=X], where X is the maximum number of arguments of the constructor:
    983 {{{
    984     interface [
     782Regarding `[ConstructorParameters]`, the possible usage is `[ConstructorParameters=X]`, where `X` is the number of mandatory arguments of the constructor:
     783{{{
     784    [
    985785        CustomConstructor,
    986786        ConstructorParameters=4
    987     ] XXX {
     787    ] interface XXX {
    988788    };
    989789}}}
    990790
    991791We should minimize the number of custom bindings as less as possible.
    992 Before using [CustomConstructor], you should doubly consider if you really need custom bindings.
    993 You are recommended to modify code generators to avoid using [Custom].
     792Before using `[CustomConstructor]`, you should doubly consider if you really need custom bindings.
     793You are recommended to modify code generators to avoid using `[Custom]`.
    994794
    995795Before explaining the details, let us clarify the relationship of these IDL attributes.
    996796
    997  * [JSCustomConstructor] on an interface indicates that you can write JavaScriptCore custom bindings for the constructor.
    998  * [V8CustomConstructor] on an interface indicates that you can write V8 custom bindings for the constructor.
    999  * [CustomConstructor] is equivalent to [JSCustomConstructor, V8CustomConstructor].
    1000 
    1001 For example, if you specify [Constructor, JSCustomConstructor],
    1002 then the constructor is generated only for V8 and you need to write JavaScriptCore custom bindings for the constructor.
    1003 
    1004 How to write custom bindings is different between JavaScriptCore and V8.
    1005 
    1006  * JavaScriptCore: Consider the following example:
    1007 
    1008 {{{
    1009     interface [
     797 * `[CustomConstructor]` on an interface indicates that you can write JavaScriptCore custom bindings for the constructor.
     798
     799You can write custom bindings for JavaScriptCore as follows.
     800
     801 * Consider the following example:
     802
     803{{{
     804    [
    1010805        CustomConstructor,
    1011806        ConstructorParameters=2
    1012     ] XXX {
     807    ] interface XXX {
    1013808    };
    1014809}}}
     
    1022817Refer to WebCore/bindings/js/JSXXXCustom.cpp for more details.
    1023818
    1024  * V8: Consider the following example:
    1025 
    1026 {{{
    1027     interface [
    1028         CustomConstructor,
    1029         ConstructorParameters=2
    1030     ] XXX {
    1031     };
    1032 }}}
    1033 Then you can write custom bindings in WebCore/bindings/v8/custom/V8XXXConstructorCustom.cpp:
    1034 {{{
    1035     v8::Handle<v8::Value> V8XXX::constructorCallback(const v8::Arguments& args)
    1036     {
    1037         ...;
    1038     }
    1039 }}}
    1040 Refer to WebCore/bindings/v8/custom/V8XXXConstructorCustom.cpp for more details.
    1041 
    1042 X of [ConstructorParameters=X] is the maximum number of arguments, including optional arguments.
    1043 For example, if a constructor signature is [Constructor(in int a, in int b, in [Optional=DefaultIsUndefined] int c, in [Optional=DefaultIsUndefined] int d)], then X is 4.
    1044 
    1045 You do not need to specify [ConstructorParameters] if the interface does not have any of [JSCustomConstructor], [V8CustomConstructor] or [CustomConstructor].
    1046 
    1047 == [Conditional](i,m,a) == #Conditional
    1048 
    1049 Summary: [Conditional] inserts "#if ENABLE(SOME_FLAG) ... #endif" into the generated code.
    1050 
    1051 Usage: [Conditional] can be specified on interfaces, methods and attributes:
    1052 {{{
    1053     interface [
     819`X` of `[ConstructorParameters=X]` is the number of mandatory arguments.
     820For 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.
     821
     822You do not need to specify `[ConstructorParameters]` if the interface does not have `[CustomConstructor]` extended attribute.
     823
     824== `[Conditional]`(i,m,a) == #Conditional
     825
     826Summary: `[Conditional]` inserts "#if ENABLE(SOME_FLAG) ... #endif" into the generated code.
     827
     828Usage: `[Conditional]` can be specified on interfaces, methods and attributes:
     829{{{
     830    [
    1054831        Conditional=INDEXED_DATABASE
    1055     ] XXX {
     832    ] interface XXX {
    1056833    };
    1057834}}}
    1058835{{{
    1059836    interface XXX {
    1060         attribute [Conditional=INDEXED_DATABASE] DOMString str;
     837        [Conditional=INDEXED_DATABASE] attribute DOMString str;
    1061838        [Conditional=INDEXED_DATABASE] void open();
    1062839    };
    1063840}}}
    1064841
    1065 [Conditional] is used to enable or disable the generated code based on a "flag".
     842`[Conditional]` is used to enable or disable the generated code based on a "flag".
    1066843If a given flag is enabled, the generated code is compiled. Otherwise, the generated code is not compiled.
    1067844Whether a flag is enabled or disabled is controlled (mostly) by Tools/Scripts/build-webkit.
    1068845
    1069 If [Conditional] is specified on an interface, it means that [Conditional] is specified on all attributes and methods of the interface.
    1070 
    1071 == [CheckSecurity](i), [DoNotCheckSecurity](m,a), [DoNotCheckSecurityOnGetter](a), [DoNotCheckSecurityOnSetter](a) == #CheckSecurity
     846If `[Conditional]` is specified on an interface, it means that `[Conditional]` is specified on all attributes and methods of the interface.
     847
     848== `[CheckSecurity]`(i), `[DoNotCheckSecurity]`(m,a), `[DoNotCheckSecurityOnGetter]`(a), `[DoNotCheckSecurityOnSetter]`(a) == #CheckSecurity
    1072849
    1073850Summary: They check whether a given access is allowed or not, in terms of the same-origin security policy.
    1074851
    1075 Usage: [CheckSecurity] can be specified on interfaces.
    1076 [DoNotCheckSecurity] can be specified on methods or attributes that belong to interfaces that have [CheckSecurity].
    1077 [DoNotCheckSecurityOnGetter] and [DoNotCheckSecurityOnSetter] can be specified on attributes
    1078 that belong to interfaces that have [CheckSecurity]:
    1079 {{{
    1080     interface [
     852Usage: `[CheckSecurity]` can be specified on interfaces.
     853`[DoNotCheckSecurity]` can be specified on methods or attributes that belong to interfaces that have `[CheckSecurity]`.
     854`[DoNotCheckSecurityOnGetter]` and `[DoNotCheckSecurityOnSetter]` can be specified on attributes
     855that belong to interfaces that have `[CheckSecurity]`:
     856{{{
     857    [
    1081858        CheckSecurity
    1082     ] DOMWindow {
     859    ] interface DOMWindow {
    1083860        attribute DOMString str1;
    1084         attribute [DoNotCheckSecurity] DOMString str2:
    1085         attribute [DoNotCheckSecurityOnGetter] DOMString str3:
    1086         attribute [DoNotCheckSecurityOnSetter] DOMString str4:
     861        [DoNotCheckSecurity] attribute DOMString str2:
     862        [DoNotCheckSecurityOnGetter] attribute DOMString str3:
     863        [DoNotCheckSecurityOnSetter] attribute DOMString str4:
    1087864        void func1();
    1088865        [DoNotCheckSecurity] void func2();
     
    1092869Consider the case where you access window.parent from inside an iframe that comes from a different origin.
    1093870While it is allowed to access window.parent, it is not allowed to access window.parent.document.
    1094 In such cases, you need to specify [CheckSecurity] in order to check
     871In such cases, you need to specify `[CheckSecurity]` in order to check
    1095872whether a given DOM object is allowed to access the attribute or method, in terms of the same-origin security policy.
    1096873This is really important for security.
    1097874
    1098 If you specify [CheckSecurity] on an interface, the security check is enabled on all the attributes and methods of the interface.
     875If you specify `[CheckSecurity]` on an interface, the security check is enabled on all the attributes and methods of the interface.
    1099876To disable the security check for particular attributes or methods,
    1100 you can use [DoNotCheckSecurity], [DoNotCheckSecurityOnGetter] or [DoNotCheckSecurityOnSetter].
    1101 
    1102  * [DoNotCheckSecurity] on a method disables the security check for the method.
    1103  * [DoNotCheckSecurity] on an attribute disables the security check for a getter and setter of the attribute.
    1104  * [DoNotCheckSecurityOnGetter] on an attribute disables the security check for a getter of the attribute.
    1105  * [DoNotCheckSecurityOnSetter] on an attribute disables the security check for a setter of the attribute.
    1106  * [DoNotCheckSecurity] on an attribute is equivalent to [DoNotCheckSecurityOnGetter, DoNotCheckSecurityOnSetter].
    1107 
    1108 == [CheckSecurityForNode](m,a) == #CheckSecurityForNode
    1109 
    1110 Summary: [CheckSecurityForNode] checks whether a given access to Node is allowed or not, in terms of the same-origin security policy.
    1111 
    1112 Usage: [CheckSecurityForNode] can be specified on methods or attributes:
    1113 {{{
    1114     attribute [CheckSecurityForNode] Node contentDocument;
     877you can use `[DoNotCheckSecurity]`, `[DoNotCheckSecurityOnGetter]` or `[DoNotCheckSecurityOnSetter]`.
     878
     879 * `[DoNotCheckSecurity]` on a method disables the security check for the method.
     880 * `[DoNotCheckSecurity]` on an attribute disables the security check for a getter and setter of the attribute.
     881 * `[DoNotCheckSecurityOnGetter]` on an attribute disables the security check for a getter of the attribute.
     882 * `[DoNotCheckSecurityOnSetter]` on an attribute disables the security check for a setter of the attribute.
     883 * `[DoNotCheckSecurity]` on an attribute is equivalent to `[DoNotCheckSecurityOnGetter, DoNotCheckSecurityOnSetter]`.
     884
     885== `[CheckSecurityForNode]`(m,a) == #CheckSecurityForNode
     886
     887Summary: `[CheckSecurityForNode]` checks whether a given access to Node is allowed or not, in terms of the same-origin security policy.
     888
     889Usage: `[CheckSecurityForNode]` can be specified on methods or attributes:
     890{{{
     891    [CheckSecurityForNode] attribute Node contentDocument;
    1115892    [CheckSecurityForNode] SVGDocument getSVGDocument();
    1116893}}}
    1117894
    1118 In terms of the same-origin security policy, node.contentDocument should return undefined if the parent frame and the child frame are from different origins.
    1119 If the security check is necessary, you should specify [CheckSecurityForNode].
     895In terms of the same-origin security policy, `node.contentDocument` should return undefined if the parent frame and the child frame are from different origins.
     896If the security check is necessary, you should specify `[CheckSecurityForNode]`.
    1120897This is really important for security.
    1121898
    1122 == [IndexedGetter](i) == #IndexedGetter
     899== `[IndexedGetter]`(i) == #IndexedGetter
    1123900
    1124901 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-indexed-properties The spec of indexed properties] (Note: The WebKit behavior explained below is different from the spec)
    1125902
    1126 Summary: [IndexedGetter] means that a given interface should have a getter of indexed properties.
    1127 
    1128 Usage: [IndexedGetter] can be specified on interfaces:
    1129 {{{
    1130     interface [
     903Summary: `[IndexedGetter]` means that a given interface should have a getter of indexed properties.
     904
     905Usage: `[IndexedGetter]` can be specified on interfaces:
     906{{{
     907    [
    1131908        IndexedGetter
    1132     ] XXX {
    1133     };
    1134 }}}
    1135 
    1136 Indexed getters define the behavior when XXX[i] is evaluated.
    1137 For example, if XXX is an array-type interface, it should have indexed getters (and setters).
    1138 The bindings code for indexed getters is generated automatically so that XXX[i] behaves equivalent to XXX.item(i).
    1139 
    1140 == [V8CustomIndexedGetter](i) == #V8CustomIndexedGetter
    1141 
    1142 Summary: [V8CustomIndexedGetter] allows you to write custom bindings for a getter of indexed properties.
    1143 
    1144 Usage: [V8CustomIndexedGetter] can be specified on interfaces:
    1145 {{{
    1146     interface [
    1147         V8CustomIndexedGetter
    1148     ] XXX {
    1149     };
    1150 }}}
    1151 
    1152 Interface that have V8CustomIndexedGetter attribute must have also IndexedGetter attribute.
    1153 
    1154 == [CustomIndexedSetter](i) == #CustomIndexedSetter
     909    ] interface XXX {
     910    };
     911}}}
     912
     913Indexed getters define the behavior when `XXX[i]` is evaluated.
     914For example, if `XXX` is an array-type interface, it should have indexed getters (and setters).
     915The bindings code for indexed getters is generated automatically so that `XXX[i]` behaves equivalent to `XXX.item(i)`.
     916
     917== `[CustomIndexedSetter]`(i) == #CustomIndexedSetter
    1155918
    1156919 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-indexed-properties The spec of indexed properties] (Note: The WebKit behavior explained below is different from the spec)
    1157920
    1158 Summary: [CustomIndexedSetter] allows you to write custom bindings for a setter of indexed properties.
     921Summary: `[CustomIndexedSetter]` allows you to write custom bindings for a setter of indexed properties.
    1159922
    1160923Usage: [CustomIndexedSetter] can be specified on interfaces:
    1161924{{{
    1162     interface [
     925    [
    1163926        CustomIndexedSetter
    1164     ] XXX {
     927    ] interface XXX {
    1165928    };
    1166929}}}
     
    1168931Indexed setters define the behavior when "XXX[i] = ..." is evaluated.
    1169932For example, if XXX is an array-type interface, it should have indexed (getters and) setters.
    1170 [CustomIndexedSetter] allows you to write the custom bindings, as follows.
    1171 
    1172  * JavaScriptCore: You can write custom JSXXX::indexSetter(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     933`[CustomIndexedSetter]` allows you to write the custom bindings, as follows.
     934
     935 * JavaScriptCore: You can write custom `JSXXX::indexSetter(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    1173936
    1174937{{{
     
    1178941    }
    1179942}}}
    1180  * In V8: You can write custom V8XXX::indexedPropertySetter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1181 
    1182 {{{
    1183     v8::Handle<v8::Value> V8XXX::indexedPropertySetter(uint32_t index, const v8::AccessorInfo& info)
    1184     {
    1185         ...;
    1186     }
    1187 }}}
    1188 
    1189 == [NamedGetter](i) == #NamedGetter
     943
     944== `[NamedGetter]`(i) == #NamedGetter
    1190945
    1191946 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-named-properties The spec of named properties] (Note: The WebKit behavior explained below is different from the spec)
    1192947
    1193 Summary: [NamedGetter] means that a given interface should have a getter of named properties.
    1194 
    1195 Usage: [NamedGetter] can be specified on interfaces:
    1196 {{{
    1197     interface [
     948Summary: `[NamedGetter]` means that a given interface should have a getter of named properties.
     949
     950Usage: `[NamedGetter]` can be specified on interfaces:
     951{{{
     952    [
    1198953        NamedGetter
    1199     ] XXX {
     954    ] interface XXX {
    1200955    };
    1201956}}}
     
    1204959The bindings code for named getters is generated automatically so that XXX.foooooooo behaves equivalent to XXX.namedItem(i).
    1205960
    1206 == [CustomNamedGetter](i), [CustomNamedSetter](i) == #CustomNamedGetter
     961== `[CustomNamedGetter]`(i), `[CustomNamedSetter]`(i) == #CustomNamedGetter
    1207962
    1208963 * [http://dev.w3.org/2006/webapi/WebIDL/#idl-named-properties The spec of named properties] (Note: The WebKit behavior explained below is different from the spec)
    1209964
    1210 Summary: [CustomNamedGetter] or [CustomNamedSetter] allows you to write custom bindings for a getter or setter of named properties.
     965Summary: `[CustomNamedGetter]` or `[CustomNamedSetter]` allows you to write custom bindings for a getter or setter of named properties.
    1211966
    1212967Usage: They can be specified on interfaces:
    1213968{{{
    1214     interface [
     969    [
    1215970        CustomNamedGetter,
    1216971        CustomNamedSetter
    1217     ] XXX {
     972    ] interface XXX {
    1218973    };
    1219974}}}
     
    1221976Named getters define the behavior when XXX.foooooooo is evaluated, where foooooooo is not an attribute of XXX.
    1222977Named setters define the behavior when "XXX.foooooooo = ..." is evaluated.
    1223 [CustomNamedGetter] or [CustomNamedSetter] allow you to write the custom bindings, as follows:
    1224 
    1225  * [CustomNamedGetter] in JavaScriptCore: You can write custom JSXXX::canGetItemsForName(...) and JSXXX::nameGetter(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     978`[CustomNamedGetter]` or `[CustomNamedSetter]` allow you to write the custom bindings, as follows:
     979
     980 * `[CustomNamedGetter]` in JavaScriptCore: You can write custom `JSXXX::canGetItemsForName(...)` and `JSXXX::nameGetter(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    1226981
    1227982{{{
     
    1236991    }
    1237992}}}
    1238  * [CustomNamedGetter] in V8: You can write custom V8XXX::namedPropertyGetter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1239 
    1240 {{{
    1241     v8::Handle<v8::Value> V8XXX::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    1242     {
    1243         ...;
    1244     }
    1245 }}}
    1246  * [CustomNamedSetter] in JavaScriptCore: You can write custom JSXXX::putDelegate(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     993 * `[CustomNamedSetter]` in JavaScriptCore: You can write custom `JSXXX::putDelegate(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    1247994
    1248995{{{
     
    1252999    }
    12531000}}}
    1254  * [CustomNamedSetter] in V8: You can write custom V8XXX::namedPropertySetter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1255 
    1256 {{{
    1257     v8::Handle<v8::Value> V8XXX::namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
    1258     {
    1259         ...;
    1260     }
    1261 }}}
    1262 
    1263 == [InterfaceName](i) == #InterfaceName
    1264 
    1265 Summary: If you want to expose a different interface name to JavaScript, you can specify the name by [InterfaceName].
    1266 
    1267 Usage: The possible usage is [InterfaceName=X], where X is the interface name exposed to JavaScript.
    1268 [InterfaceName] can be specified on interfaces:
     1001
     1002== `[InterfaceName]`(i) == #InterfaceName
     1003
     1004Summary: If you want to expose a different interface name to JavaScript, you can specify the name by `[InterfaceName]`.
     1005
     1006Usage: The possible usage is `[InterfaceName=X]`, where `X` is the interface name exposed to JavaScript.
     1007`[InterfaceName]` can be specified on interfaces:
    12691008{{{
    12701009    interface [
     
    12741013}}}
    12751014
    1276 Without [InterfaceName=...], the interface name exposed to JavaScript becomes the same as the interface name in an IDL file.
    1277 If you want change it based on the spec, you can use [InterfaceName=...].
     1015Without `[InterfaceName=...]`, the interface name exposed to JavaScript becomes the same as the interface name in an IDL file.
     1016If you want change it based on the spec, you can use `[InterfaceName=...]`.
    12781017In the above example, `window.toString()` will return `"[object Window]"` in JavaScript.
    12791018
    1280 == [EventTarget](i) FIXME == #EventTarget
     1019== `[EventTarget]`(i) FIXME == #EventTarget
    12811020
    12821021Summary: ADD SUMMARY
    12831022
    1284 Usage: [EventTarget] can be specified on interfaces:
    1285 {{{
    1286     interface [
     1023Usage: `[EventTarget]` can be specified on interfaces:
     1024{{{
     1025    [
    12871026        EventTarget
    1288     ] XXX {
     1027    ] interface XXX {
    12891028    };
    12901029}}}
     
    12921031ADD EXPLANATIONS
    12931032
    1294 == [DoNotCheckConstants](i) == #DoNotCheckConstants
    1295 
    1296 Summary: [DoNotCheckConstants] indicates that constant values in an IDL file can be different from constant values in WebCore implementation.
    1297 
    1298 Usage: [DoNotCheckConstants] can be specified on interfaces:
    1299 {{{
    1300     interface [
     1033== `[DoNotCheckConstants]`(i) == #DoNotCheckConstants
     1034
     1035Summary: `[DoNotCheckConstants]` indicates that constant values in an IDL file can be different from constant values in WebCore implementation.
     1036
     1037Usage: `[DoNotCheckConstants]` can be specified on interfaces:
     1038{{{
     1039    [
    13011040        DoNotCheckConstants
    1302     ] XXX {
     1041    ] interface XXX {
    13031042        const unsigned short NOT_FOUND_ERR = 12345;
    13041043        const unsigned short SYNTAX_ERR = 12346;
     
    13061045}}}
    13071046
    1308 By default (i.e. without [DoNotCheckConstants]), compile-time assertions are inserted to check if the constant values defined in IDL files
     1047By default (i.e. without `[DoNotCheckConstants]`), compile-time assertions are inserted to check if the constant values defined in IDL files
    13091048are equal to the constant values in WebCore implementation.
    13101049In the above example, if NOT_FOUND_ERR were implemented as 100 in WebCore, the build will fail.
     
    13131052and thus the values in WebCore implementation should be equal to the values defined in the spec.
    13141053If you really want to introduce non-speced constant values and allow different values between IDL files and WebCore implementation,
    1315 you can specify [DoNotCheckConstants] to skip the compile-time assertions.
    1316 
    1317 == [ActiveDOMObject](i) == #ActiveDOMObject
    1318 
    1319 Summary: [ActiveDOMObject] indicates that a given DOM object should be kept alive as long as the DOM object has pending activities.
    1320 
    1321 Usage: [ActiveDOMObject] can be specified on interfaces:
    1322 {{{
    1323     interface [
     1054you can specify `[DoNotCheckConstants]` to skip the compile-time assertions.
     1055
     1056== `[ActiveDOMObject]`(i) == #ActiveDOMObject
     1057
     1058Summary: `[ActiveDOMObject]` indicates that a given DOM object should be kept alive as long as the DOM object has pending activities.
     1059
     1060Usage: `[ActiveDOMObject]` can be specified on interfaces:
     1061{{{
     1062    [
    13241063        ActiveDOMObject
    1325     ] XMLHttpRequest {
    1326     };
    1327 }}}
    1328 
    1329 If a given DOM object needs to be kept alive as long as the DOM object has pending activities, you need to specify [ActiveDOMObject].
    1330 For example, [ActiveDOMObject] can be used when the DOM object is expecting events to be raised in the future.
    1331 
    1332 If you use [ActiveDOMObject], the corresponding WebCore class needs to inherit ActiveDOMObject.
     1064    ] interface XMLHttpRequest {
     1065    };
     1066}}}
     1067
     1068If a given DOM object needs to be kept alive as long as the DOM object has pending activities, you need to specify `[ActiveDOMObject]`.
     1069For example, `[ActiveDOMObject]` can be used when the DOM object is expecting events to be raised in the future.
     1070
     1071If you use `[ActiveDOMObject]`, the corresponding WebCore class needs to inherit ActiveDOMObject.
    13331072For example, in case of XMLHttpRequest, WebCore/xml/XMLHttpRequest.h would look like this:
    13341073{{{
     
    13391078Then you need to implement the virtual methods of the ActiveDOMObject class, e.g. contextDestroyed(), canSuspend(), suspend(), resume() and stop().
    13401079
    1341 If an interface X has [ActiveDOMObject] and an interface Y inherits the interface X,
    1342 then the interface Y should also have [ActiveDOMObject].
    1343 
    1344 == [V8DependentLifeTime](i) FIXME == #V8DependentLifeTime
    1345 
    1346 Summary: ADD SUMMARY
    1347 
    1348 Usage: [V8DependentLifeTime] can be specified on interfaces:
    1349 {{{
    1350     interface [
    1351         V8DependentLifeTime
    1352     ] XXX {
    1353     };
    1354 }}}
    1355 
    1356 ADD EXPLANATIONS
    1357 
    1358 == [CustomEnumerateProperty](i), [CustomDeleteProperty](i) == #CustomEnumerateProperty
    1359 
    1360 Summary: [CustomEnumerateProperty] allows you to write custom bindings for the case where properties of a given interface are enumerated.
    1361 [CustomDeleteProperty] allows you to write custom bindings for the case where a property of a given interface is deleted.
     1080If an interface X has `[ActiveDOMObject]` and an interface Y inherits the interface X,
     1081then the interface Y should also have `[ActiveDOMObject]`.
     1082
     1083== `[CustomEnumerateProperty]`(i), `[CustomDeleteProperty]`(i) == #CustomEnumerateProperty
     1084
     1085Summary: `[CustomEnumerateProperty]` allows you to write custom bindings for the case where properties of a given interface are enumerated.
     1086`[CustomDeleteProperty]` allows you to write custom bindings for the case where a property of a given interface is deleted.
    13621087
    13631088Usage: They can be specified on interfaces:
    13641089{{{
    1365     interface [
     1090    [
    13661091        CustomEnumerateProperty,
    13671092        CustomDeleteProperty
    1368     ] XXX {
    1369     };
    1370 }}}
    1371 
    1372  * [CustomEnumerateProperty] in JavaScriptCore: You can write custom bindings when properties of XXX are enumerated.
    1373 Specifically, you can write custom JSXXX::getOwnPropertyNames(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     1093    ] interface XXX {
     1094    };
     1095}}}
     1096
     1097 * `[CustomEnumerateProperty]` in JavaScriptCore: You can write custom bindings when properties of XXX are enumerated.
     1098Specifically, you can write custom `JSXXX::getOwnPropertyNames(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    13741099
    13751100{{{
     
    13801105}}}
    13811106
    1382  * [CustomEnumerateProperty] in V8: You can write custom bindings as V8XXX::namedPropertyQuery(...) and V8XXX::namedPropertyEnumerator(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1383 
    1384 {{{
    1385     v8::Handle<v8::Integer> V8XXX::namedPropertyQuery(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    1386     {
    1387         ...;
    1388     }
    1389 
    1390     v8::Handle<v8::Array> V8XXX::namedPropertyEnumerator(const v8::AccessorInfo& info)
    1391     {
    1392         ...;
    1393     }
    1394 }}}
    1395 
    1396  * [CustomDeleteProperty] in JavaScriptCore: You can write custom bindings for the case where a property of XXX is deleted.
    1397 Specifically, you can write custom JSXXX::deleteProperty(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     1107 * `[CustomDeleteProperty]` in JavaScriptCore: You can write custom bindings for the case where a property of XXX is deleted.
     1108Specifically, you can write custom `JSXXX::deleteProperty(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    13981109
    13991110{{{
     
    14041115}}}
    14051116
    1406  * [CustomDeleteProperty] in V8: You can write custom bindings as V8XXX::namedPropertyDeleter(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1407 
    1408 {{{
    1409     v8::Handle<v8::Boolean> V8XXX::namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    1410     {
    1411         ...;
    1412     }
    1413 }}}
    1414 
    1415 == [IsWorkerContext](i) == #IsWorkerContext
    1416 
    1417 Summary: [IsWorkerContext] indicates that a given interface is a WorkerContext-related interface.
    1418 
    1419 Usage: [IsWorkerContext] can be specified on WorkerContext-related interfaces only:
    1420 {{{
    1421     interface [
     1117== `[IsWorkerContext]`(i) == #IsWorkerContext
     1118
     1119Summary: `[IsWorkerContext]` indicates that a given interface is a WorkerContext-related interface.
     1120
     1121Usage: `[IsWorkerContext]` can be specified on WorkerContext-related interfaces only:
     1122{{{
     1123    [
    14221124        IsWorkerContext
    1423     ] SharedWorkerContext {
    1424     };
    1425 }}}
    1426 
    1427 == [TransferList](p) == #TransferList
    1428 
    1429 Summary: [TransferList] allows a SerializedScriptValue parameter used
    1430 with the structured clone algorithm to specify another parameter used
    1431 to pass the transfer list.
    1432 
    1433 Usage: The possible usage is [TransferList=XXX] where XXX is another
    1434 parameter in the same method signature as the SerializedScriptValue
    1435 parameter on which the modifier is placed. The referenced parameter
    1436 should be of type "Array" to be compatible with the Web Messaging
    1437 standard.
    1438 
    1439 When this modifier is used, the code generation automatically creates
    1440 a MessagePortArray and completes the structured clone algorithm using
    1441 the input data from the JavaScript caller. The resulting
    1442 MessagePortArray is then passed to the implementation's method
    1443 signature in place of the Array parameter referenced.
    1444 
    1445 Example:
    1446 {{{
    1447     interface Worker {
    1448         void postMessage(in [TransferList=transfer] SerializedScriptValue data, in [Optional=DefaultIsUndefined] Array transfer);
    1449     }
    1450 }}}
    1451 And in the implementation:
    1452 {{{
    1453     class Worker {
    1454         virtual void postMessage(PassRefPtr<SerializedScriptValue> data, const MessagePortArray& ports);
    1455     }
    1456 }}}
    1457 
    1458 == [TypedArray](i), [ConstructorTemplate=TypedArray](i) == #TypedArray
     1125    ] interface SharedWorkerContext {
     1126    };
     1127}}}
     1128
     1129== `[TypedArray]`(i), [ConstructorTemplate=TypedArray](i) == #TypedArray
    14591130
    14601131* [http://www.khronos.org/registry/typedarray/specs/latest/#7 The spec of TypedArray]
     
    14631134TypedArray implements ArrayBufferView. Each of the typed array types has the following constructors, properties, constants and methods.
    14641135
    1465 Usage: [TypedArray] must be specified on interfaces in conjunction with [ConstructorTemplate=TypedArray]:
     1136Usage: `[TypedArray]` must be specified on interfaces in conjunction with `[ConstructorTemplate=TypedArray]`:
    14661137Example:
    14671138
    14681139{{{
    1469 interface [
    1470     ConstructorTemplate=TypedArray,
    1471     TypedArray=int
    1472 ] XXX : ArrayBufferView {
    1473     void set(TypedArray array, optional unsigned long offset);
    1474 }
    1475 }}}
    1476 
    1477 TypedArray=* Allows us to specify any valid typed array view type.
    1478 TypedArray interfaces require special bindings code, you need to use [ConstructorTemplate=TypedArray] instead of normal [Constructor].
    1479 
    1480 == [CustomCall](i) == #CustomCall
    1481 
    1482 Summary: [CustomCall] allows you to write custom bindings for call(...) of a given interface.
    1483 
    1484 Usage: [CustomCall] can be specified on interfaces:
    1485 {{{
    1486     interface [
     1140    [
     1141        ConstructorTemplate=TypedArray,
     1142        TypedArray=int
     1143    ] interface XXX : ArrayBufferView {
     1144        void set(TypedArray array, optional unsigned long offset);
     1145    }
     1146}}}
     1147
     1148`TypedArray=*` Allows us to specify any valid typed array view type.
     1149TypedArray interfaces require special bindings code, you need to use `[ConstructorTemplate=TypedArray]` instead of normal `[Constructor]`.
     1150
     1151== `[CustomCall]`(i) == #CustomCall
     1152
     1153Summary: `[CustomCall]` allows you to write custom bindings for `call(...)` of a given interface.
     1154
     1155Usage: `[CustomCall]` can be specified on interfaces:
     1156{{{
     1157    [
    14871158        CustomCall
    1488     ] XXX {
    1489     };
    1490 }}}
    1491 
    1492 If you want to write custom bindings for XXX.call(...), you can use [CustomCall].
    1493 
    1494  * JavaScriptCore: You can write custom JSXXX::getCallData(...) in WebCore/bindings/js/JSXXXCustom.cpp:
     1159    ] interface XXX {
     1160    };
     1161}}}
     1162
     1163If you want to write custom bindings for XXX.call(...), you can use `[CustomCall]`.
     1164
     1165 * JavaScriptCore: You can write custom `JSXXX::getCallData(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    14951166
    14961167{{{
     
    15001171    }
    15011172}}}
    1502  * V8: You can write custom V8XXX::callAsFunctionCallback(...) in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1503 
    1504 {{{
    1505     v8::Handle<v8::Value> V8XXX::callAsFunctionCallback(const v8::Arguments& args)
    1506     {
    1507         ...;
    1508     }
    1509 }}}
    1510 
    1511 == [JSCustomToNativeObject](i), [JSCustomFinalize](i), [JSCustomIsReachable](i), [JSCustomMarkFunction](i), [JSCustomNamedGetterOnPrototype](i), [JSCustomPushEventHandlerScope](i), [JSCustomDefineOwnProperty](i), [JSCustomDefineOwnPropertyOnPrototype](i), [JSCustomGetOwnPropertySlotAndDescriptor](i) == #JSCustomToNativeObject
     1173
     1174== `[JSCustomToNativeObject]`(i), `[JSCustomFinalize]`(i), `[CustomIsReachable]`(i), `[JSCustomMarkFunction]`(i), `[JSCustomNamedGetterOnPrototype]`(i), `[JSCustomPushEventHandlerScope]`(i), `[JSCustomDefineOwnProperty]`(i), `[JSCustomDefineOwnPropertyOnPrototype]`(i), `[JSCustomGetOwnPropertySlotAndDescriptor]`(i) == #JSCustomToNativeObject
    15121175
    15131176Summary: They allow you to write custom bindings for the JavaScriptCore-specific code that would be generated automatically by default.
     
    15151178Usage: They can be specified on interfaces:
    15161179{{{
    1517     interface [
     1180    [
    15181181        JSCustomToNativeObject,
    15191182        JSCustomFinalize,
    1520         JSCustomIsReachable,
     1183        CustomIsReachable,
    15211184        JSCustomMarkFunction,
    15221185        JSCustomNamedGetterOnPrototype,
     
    15251188        JSCustomDefineOwnPropertyOnPrototype,
    15261189        JSCustomGetOwnPropertySlotAndDescriptor
    1527     ] XXX {
     1190    ] interface XXX {
    15281191    };
    15291192}}}
     
    15321195Refer to use cases in WebCore/bindings/js/JSXXXCustom.cpp for more details.
    15331196
    1534  * [JSCustomToNativeObject]: You can write custom toXXX(...):
     1197 * `[JSCustomToNativeObject]`: You can write custom `toXXX(...)`:
    15351198
    15361199{{{
     
    15401203    }
    15411204}}}
    1542  * [JSCustomFinalize]: You can write custom JSXXXOwner::finalize(...):
     1205 * `[JSCustomFinalize]`: You can write custom `JSXXXOwner::finalize(...)`:
    15431206
    15441207{{{
     
    15481211    }
    15491212}}}
    1550  * [JSCustomIsReachable]: You can write custom JSXXXOwner::isReachableFromOpaqueRoots(...):
     1213 * `[CustomIsReachable]`: You can write custom `JSXXXOwner::isReachableFromOpaqueRoots(...)`:
    15511214
    15521215{{{
     
    15561219    }
    15571220}}}
    1558  * [JSCustomMarkFunction]: You can write custom JSXXX::visitChildren(...):
     1221 * `[JSCustomMarkFunction]`: You can write custom `JSXXX::visitChildren(...)`:
    15591222
    15601223{{{
     
    15641227    }
    15651228}}}
    1566  * [JSCustomNamedGetterOnPrototype]: You can write custom JSXXXPrototype::putDelegate(...):
     1229 * `[JSCustomNamedGetterOnPrototype]`: You can write custom `JSXXXPrototype::putDelegate(...)`:
    15671230
    15681231{{{
     
    15721235    }
    15731236}}}
    1574  * [JSCustomPushEventHandlerScope]: You can write custom JSXXX::pushEventHandlerScope(...):
     1237 * `[JSCustomPushEventHandlerScope]`: You can write custom `JSXXX::pushEventHandlerScope(...)`:
    15751238
    15761239{{{
     
    15801243    }
    15811244}}}
    1582  * [JSCustomDefineOwnProperty]: You can write custom JSXXX::defineOwnProperty(...):
     1245 * `[JSCustomDefineOwnProperty]`: You can write custom `JSXXX::defineOwnProperty(...)`:
    15831246
    15841247{{{
     
    15881251    }
    15891252}}}
    1590  * [JSCustomDefineOwnPropertyOnPrototype]: You can write custom JSXXXPrototype::defineOwnProperty(...):
     1253 * `[JSCustomDefineOwnPropertyOnPrototype]`: You can write custom `JSXXXPrototype::defineOwnProperty(...)`:
    15911254
    15921255{{{
     
    15961259    }
    15971260}}}
    1598  * [JSCustomGetOwnPropertySlotAndDescriptor]: You can write custom JSXXX::getOwnPropertySlotDelegate(...) and JSXXX::getOwnPropertyDescriptorDelegate(...):
     1261 * `[JSCustomGetOwnPropertySlotAndDescriptor]`: You can write custom `JSXXX::getOwnPropertySlotDelegate(...)` and `JSXXX::getOwnPropertyDescriptorDelegate(...)`:
    15991262
    16001263{{{
     
    16101273}}}
    16111274
    1612 == [JSGenerateToJSObject](i), [JSGenerateToNativeObject](i) == #JSGenerateToJSObject
     1275== `[JSGenerateToJSObject]`(i), `[JSGenerateToNativeObject]`(i) == #JSGenerateToJSObject
    16131276
    16141277Summary: They force JavaScriptCore bindings to generate JavaScriptCore-specific methods, even if a given interface has a parent interface.
     
    16161279Usage: They can be specified on interfaces that do not have a parent interface:
    16171280{{{
    1618     interface [
     1281    [
    16191282        JSGenerateToJSObject,
    16201283        JSGenerateToNativeObject
    1621     ] XXX {
    1622     };
    1623 }}}
    1624 
    1625 toJS(...), isReachableFromOpaqueRoots(...) or toXXX() is not generated if XXX has a parent interface.
     1284    ] interface XXX {
     1285    };
     1286}}}
     1287
     1288`toJS(...)`, `isReachableFromOpaqueRoots(...)` or `toXXX()` is not generated if XXX has a parent interface.
    16261289If you want to generate it even if XXX does not have a parent interface, you can specify
    1627 [JSGenerateToJSObject] or [JSGenerateToNativeObject], respectively.
    1628 
    1629 == [JSGenerateIsReachable](i) == #JSGenerateIsReachable
     1290`[JSGenerateToJSObject]` or `[JSGenerateToNativeObject]`, respectively.
     1291
     1292== `[GenerateIsReachable]`(i) == #GenerateIsReachable
    16301293
    16311294Summary: This generates code that determines if a wrapper is reachable.
    16321295
    1633 Usage: The JSGenerateIsReachable can be specified on the interface. This attribute is ignored if CustomIsReachable is present.
    1634 
    1635 {{{
    1636     interface [
    1637         JSGenerateIsReachable=ImplBaseRoot
    1638     ] XXX {
    1639     };
    1640 }}}
    1641 
    1642 The code generates a function called XXX::isReachableFromOpaqueRoots which returns a boolean if the wrapper is reachable.
     1296Usage: The `GenerateIsReachable` can be specified on the interface. This attribute is ignored if `CustomIsReachable` is present.
     1297
     1298{{{
     1299    [
     1300        GenerateIsReachable=ImplBaseRoot
     1301    ] interface XXX {
     1302    };
     1303}}}
     1304
     1305The code generates a function called `XXX::isReachableFromOpaqueRoots` which returns a boolean if the wrapper is reachable.
    16431306
    16441307The currently valid values are:
     
    16541317The value of these represents the functions to call to get the object that determines whether the object is reachable or not. See CodeGeneratorJS.pm for more details. The values that end with Root calls WebCore::root to get the root. If the value is left out then WebCore::root is called on impl().
    16551318
    1656 == [V8GenerateIsReachable](i), V8CustomIsReachable(i) == #V8GenerateIsReachable
    1657 
    1658 Summary: This generates code that allows you to set up implicit references between wrappers which can be used to keep wrappers alive during GC.
    1659 
    1660 Usage: The V8GenerateIsReachable can be specified on the interface. This attribute is ignored if CustomIsReachable is present.
    1661 
    1662 {{{
    1663     interface [
    1664         V8GenerateIsReachable=ImplBaseRoot
    1665     ] XXX {
    1666     };
    1667 }}}
    1668 
    1669 The code generates a function called XXX::visitDOMWrapper which is called by V8GCController before GC. The function adds implicit references to the wrapper which keeps it alive.
    1670 
    1671 The currently valid values are:
    1672 
    1673 |ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot|ImplBaseRoot
    1674 
    1675  - ImplOwnerRoot
    1676  - ImplOwnerNodeRoot
    1677  - ImplElementRoot
    1678  - ImplBaseRoot
    1679 
    1680 The value of these represents the functions to call to get the object that determines whether the object is reachable or not. See CodeGeneratorV8.pm for more details.
    1681 
    1682 == [V8CustomIsReachable(i) == #V8CustomIsReachable
    1683 
    1684 Summary: Allows you to write custom code for visitDOMWrapper.
    1685 
    1686 Usage:
    1687 
    1688 {{{
    1689     interface [
    1690         V8CustomIsReachable
    1691     ] XXX {
    1692     };
    1693 }}}
    1694 
    1695 And then in V8XXXCustom.cpp:
    1696 
    1697 {{{
    1698 void V8XXX::visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
    1699 {
    1700   ...
    1701 }
    1702 }}}
    1703 == [GenerateIsReachable](i) == #GenerateIsReachable
    1704 
    1705 Summary: This is the shared version of [JSGenerateIsReachable] and V8GenerateIsReachable. The accepted values are the intersection of those two.
    1706 
    1707  - ImplElementRoot
    1708  - ImplBaseRoot
    1709 
    1710 == [JSCustomHeader](i) == #JSCustomHeader
    1711 
    1712 Summary: [JSCustomHeader] allows you to write a custom header for a given interface.
    1713 
    1714 Usage: [JSCustomHeader] can be specified on interfaces:
    1715 {{{
    1716     interface [
    1717         JSCustomHeader
    1718     ] XXX {
    1719     };
    1720 }}}
    1721 
    1722 By default, JSXXX.h and JSXXX.cpp are generated automatically.
    1723 By specifying [Custom*], you can write custom bindings in WebCore/bindings/js/JSXXXCustom.cpp.
    1724 In addition, by specifying [JSCustomHeader], you can write custom header in WebCore/bindings/js/JSXXXCustom.h, which will be included by JSXXX.h.
    1725 
    1726 == [JSLegacyParent](i) == #JSLegacyParent
    1727 
    1728 Summary: [JSLegacyParent] explicitly controls the parent interface of a given interface.
    1729 
    1730 Usage: [JSLegacyParent] can be specified on interfaces that do not have a parent interface:
    1731 {{{
    1732     interface [
     1319== `[JSLegacyParent]`(i) == #JSLegacyParent
     1320
     1321Summary: `[JSLegacyParent]` explicitly controls the parent interface of a given interface.
     1322
     1323Usage: `[JSLegacyParent]` can be specified on interfaces that do not have a parent interface:
     1324{{{
     1325    [
    17331326        JSLegacyParent=JSDOMWindowBase
    1734     ] DOMWindow {
    1735     };
    1736 }}}
    1737 
    1738 Even if a given interface does not have a parent interface, you can specify a parent interface using [JSLegacyParent].
    1739 
    1740 == [JSInlineGetOwnPropertySlot](i) == #JSInlineGetOwnPropertySlot
    1741 
    1742 Summary: For performance, [JSInlineGetOwnPropertySlot] makes getOwnPropertySlot(...) and getOwnPropertyDescriptor(...) an inline method.
    1743 
    1744 Usage: [JSInlineGetOwnPropertySlot] can be specified on interfaces:
    1745 {{{
    1746     interface [
     1327    ] interface DOMWindow {
     1328    };
     1329}}}
     1330
     1331Even if a given interface does not have a parent interface, you can specify a parent interface using `[JSLegacyParent]`.
     1332
     1333== `[JSInlineGetOwnPropertySlot]`(i) == #JSInlineGetOwnPropertySlot
     1334
     1335Summary: For performance, `[JSInlineGetOwnPropertySlot]` makes `getOwnPropertySlot(...)` and `getOwnPropertyDescriptor(...)` an inline method.
     1336
     1337Usage: `[JSInlineGetOwnPropertySlot]` can be specified on interfaces:
     1338{{{
     1339    [
    17471340        JSInlineGetOwnPropertySlot
    1748     ] XXX {
    1749     };
    1750 }}}
    1751 
    1752 == [JSNoStaticTables](i) == #JSNoStaticTables
     1341    ] interface XXX {
     1342    };
     1343}}}
     1344
     1345== `[JSNoStaticTables]`(i) == #JSNoStaticTables
    17531346
    17541347Summary: By default, there is only a single static prototype table for the interface.  This flag turns off creation of the static table, and each user gets its own table.
     
    17561349Sharing a single static prototype table only works when a class is guaranteed to be accessed from a single heap, because the lookup code expects the key (attribute name) to have the same address across all instances of the object. For interfaces that are exposed to Workers, a single static table won't work because a given string used to look up a property on the object will lie at a different address in each heap.
    17571350
    1758 Usage: [JSNoStaticTables] can be specified on interfaces:
    1759 {{{
    1760     interface [
     1351Usage: `[JSNoStaticTables]` can be specified on interfaces:
     1352{{{
     1353    [
    17611354        JSNoStaticTables
    1762     ] XXX {
     1355    ] interface XXX {
    17631356    };
    17641357}}}
     
    17661359ADD EXPLANATIONS
    17671360
    1768 == [ObjCProtocol](i), [ObjCPolymorphic](i), [ObjCLegacyUnnamedParameters](m), [ObjCUseDefaultView](m), [ObjCImplementedAsUnsignedLongLong](a) == #ObjCProtocol
     1361== `[ObjCProtocol]`(i), `[ObjCPolymorphic]`(i), `[ObjCLegacyUnnamedParameters]`(m), `[ObjCUseDefaultView]`(m), `[ObjCImplementedAsUnsignedLongLong]`(a) == #ObjCProtocol
    17691362
    17701363Used by ObjC bindings only.
    17711364
    1772 == [CPPPureInterface](i) == #CPPPureInterface
     1365== `[CPPPureInterface]`(i) == #CPPPureInterface
    17731366
    17741367Used by CPP bindings only.
    17751368
    1776 == [CustomReturn](p) == #CustomReturn
     1369== `[CustomReturn]`(p) == #CustomReturn
    17771370
    17781371Used by ObjC, GObject and CPP bindings only.
    17791372
    1780 == [ArrayClass](i) == #ArrayClass
     1373== `[ArrayClass]`(i) == #ArrayClass
    17811374
    17821375* [http://dev.w3.org/2006/webapi/WebIDL/#ArrayClass The spec of ArrayClass]
     
    17841377Summary: Allows an interface to extend JavaScript arrays.
    17851378
    1786 Usage: [ArrayClass] can be specified on interfaces. An interface may not both have [ArrayClass] and extend another interface.
     1379Usage: `[ArrayClass]` can be specified on interfaces. An interface may not both have `[ArrayClass]` and extend another interface.
    17871380
    17881381The bindings for the interface will have the `[[Prototype]]` of the constructor prototype set to `Array.prototype` which means that the methods defined on JavaScript arrays work on the instances of this interface.
    17891382
    17901383{{{
    1791 // IDL
    1792 interface [
    1793     ArrayClass,
    1794     IndexedGetter
    1795 ] NodeList {
    1796     Node item(in unsigned long index);
    1797     readonly attribute unsigned long length;
    1798 }
    1799 
    1800 // JS
    1801 myNodeList instanceof Array  // true
    1802 myNodeList.forEach(function(node) { console.log(node_; });
    1803 }}}
    1804 
    1805 == [OmitConstructor], [Immutable], [MasqueradesAsUndefined], [CustomGetOwnPropertySlot], [ReplaceableConstructor], [ExtendsDOMGlobalObject], [IsIndex], [V8DoNotCheckSignature], [NumericIndexedGetter] == #OmitConstructor
     1384    // IDL
     1385    [
     1386        ArrayClass,
     1387        IndexedGetter
     1388    ] interface NodeList {
     1389        Node item(unsigned long index);
     1390        readonly attribute unsigned long length;
     1391    };
     1392
     1393    // JS
     1394    myNodeList instanceof Array  // true
     1395    myNodeList.forEach(function(node) { console.log(node_; });
     1396}}}
     1397
     1398== `[OmitConstructor]`, `[Immutable]`, `[MasqueradesAsUndefined]`, `[CustomGetOwnPropertySlot]`, `[ReplaceableConstructor]`, `[ExtendsDOMGlobalObject]`, `[IsIndex]`, `[NumericIndexedGetter]` == #OmitConstructor
    18061399
    18071400Might be deprecated. Discussion is on-going.
    18081401
    1809 == [ImplementationNameSpace] == #ImplementationNamespace
     1402== `[ImplementationNameSpace]` == #ImplementationNamespace
    18101403
    18111404Summary: Specifies the namespace for the corresponding native type. 
     
    18131406By default, the namespace is WebCore.  This is presently used to mark WTF types.
    18141407
    1815 Usage: [ImplementationNamespace] can be specified on interfaces:
    1816 {{{
    1817     interface [
     1408Usage: `[ImplementationNamespace]` can be specified on interfaces:
     1409{{{
     1410    [
    18181411        ImplementationNamespace=WTF
    1819     ] ArrayBuffer {
    1820     };
    1821 }}}
    1822 
    1823 == [V8SkipVTableValidation], [ImplementationLacksVTable] == #V8SkipVTableValidation
    1824 
    1825 Summary: Specifies that a type can not be checked as part of the V8 Bindings Integrity option.
    1826 
    1827 V8 Bindings Integrity tries to ensure that free/corrupted objects are not wrapped by V8, thereby reducing their exploitability. In order for that to be the case, the implementation must have a distinct VTable pointer in its first word.
    1828 
    1829 Usage: [V8SkipVTableValidation] and [ImplementationLacksVTable] can be specified on interfaces.
    1830 
    1831 {{{
    1832     interface [
    1833         V8SkipVTableValidation
    1834     ] XXX {
    1835     };
    1836 }}}
    1837 
    1838 {{{
    1839     interface [
     1412    ] interface ArrayBuffer {
     1413    };
     1414}}}
     1415
     1416== `[SkipVTableValidation]`, `[ImplementationLacksVTable]` == #SkipVTableValidation
     1417
     1418Summary: Specifies that a type can not be checked as part of the Bindings Integrity option.
     1419
     1420Bindings Integrity tries to ensure that free/corrupted objects are not wrapped by JSC, thereby reducing their exploitability. In order for that to be the case, the implementation must have a distinct VTable pointer in its first word.
     1421
     1422Usage: `[SkipVTableValidation]` and `[ImplementationLacksVTable]` can be specified on interfaces.
     1423
     1424{{{
     1425    [
     1426        SkipVTableValidation
     1427    ] interface XXX {
     1428    };
     1429}}}
     1430
     1431{{{
     1432    [
    18401433        ImplementationLacksVTable
    1841     ] XXX {
    1842     };
    1843 }}}
     1434    ] interface XXX {
     1435    };
     1436}}}
     1437
     1438== `[NoInterfaceObject]`(i) == #NoInterfaceObject
     1439
     1440Standard: [http://dev.w3.org/2006/webapi/WebIDL/#NoInterfaceObject The spec of NoInterfaceObject]
     1441
     1442Summary: If the `[NoInterfaceObject]` extended attribute appears on an interface, it indicates that an interface object will not exist for the interface in the ECMAScript binding.
     1443
     1444Note that for every interface that:
     1445* is a callback interface that has constants declared on it, or
     1446* is a non-callback interface that is not declared with the `[NoInterfaceObject]` extended attribute,
     1447a corresponding property is added on the global Window object by the bindings generator.
     1448
     1449Usage: `[NoInterfaceObject]` can be specified on interfaces.
     1450
     1451{{{
     1452    [
     1453        NoInterfaceObject
     1454    ] interface XXX {
     1455        ...
     1456    };
     1457}}}