Changes between Version 28 and Version 29 of WebKitIDL


Ignore:
Timestamp:
Feb 14, 2012 2:29:20 AM (12 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v28 v29  
    3535
    3636Usage: The possible usage is [TreatNullAs=NullString] or [TreatUndefinedAs=NullString].
    37 They can be specified on DOMString attributes or DOMString parameters only, like this:
     37They can be specified on DOMString attributes or DOMString parameters only:
    3838{{{
    3939    attribute [TreatNullAs=NullString] DOMString str;
     
    6363
    6464Usage: The possible usage is [TreatReturnedNullStringAs=Null], [TreatReturnedNullStringAs=Undefined] or [TreatReturnedNullStringAs=False].
    65 They can be specified on DOMString attributes or methods which return a DOMString value, like this:
     65They can be specified on DOMString attributes or methods which return a DOMString value:
    6666{{{
    6767    attribute [TreatReturnedNullStringAs=Null] DOMString str;
     
    8383Usage: The possible usage is [Optional], [Optional=DefaultIsUndefined] or [Optional=DefaultIsNullString].
    8484[Optional] and [Optional=DefaultIsUndefined] can be specified on parameters.
    85 [Optional=DefaultIsNullString] can be specified on DOMString parameters, like this:
     85[Optional=DefaultIsNullString] can be specified on DOMString parameters:
    8686{{{
    8787    interface HTMLFoo {
     
    111111Summary: ADD SUMMARY
    112112
    113 Usage: [Callback] can be specified on interfaces and parameters, like this:
     113Usage: [Callback] can be specified on interfaces and parameters:
    114114{{{
    115115    interface [
     
    126126Summary: If your bindings require special (i.e. "custom") handling, you can write the bindings code as you like.
    127127
    128 Usage: [Custom], [JSCustom] and [V8Custom] can be specified on methods or attributes. [CustomGetter], [JSCustomGetter], [V8CustomGetter], [CustomSetter], [JSCustomSetter], [V8CustomSetter] can be specified on attributes, like this:
     128Usage: [Custom], [JSCustom] and [V8Custom] can be specified on methods or attributes. [CustomGetter], [JSCustomGetter], [V8CustomGetter], [CustomSetter], [JSCustomSetter], [V8CustomSetter] can be specified on attributes:
    129129{{{
    130130    [Custom] void func();
     
    154154    }
    155155}}}
    156 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings, like this:
     156You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
    157157{{{
    158158    JSValue JSXXX::func(ExecState* exec)
     
    170170    }
    171171}}}
    172 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings, like this:
     172You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
    173173{{{
    174174    JSValue JSXXX::str(ExecState* exec) const
     
    186186    }
    187187}}}
    188 You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings, like this:
     188You need to prepare WebCore/bindings/js/JSXXXCustom.cpp and write custom bindings:
    189189{{{
    190190    void JSXXX::setStr(ExecState*, JSValue value)
     
    278278=== * [CheckAccessToNode](m,a) ===
    279279
     280Summary: It checks if a given Node access is allowed in terms of security.
     281
     282Usage: It can be specified on methods and attributes:
     283{{{
     284    attribute [CheckAccessToNode] Node contentDocument;
     285    [CheckAccessToNode] SVGDocument getSVGDocument();
     286}}}
     287
     288In terms of security, node.contentDocument should return undefined if the parent frame and the child frame are from different origins.
     289If the security check is needed, you should specify [CheckAccessToNode].
     290
    280291=== * [StrictTypeChecking](m,a) FIXME ===
    281292
    282293Summary: ADD SUMMARY
    283294
    284 Usage: [StrictTypeChecking] can be specified on methods and attributes, like this:
     295Usage: [StrictTypeChecking] can be specified on methods and attributes:
    285296{{{
    286297    attribute [StringTypeChecking] float x;
     
    292303=== * [ReturnNewObject](m,a) ===
    293304
     305Summary: It controls whether WebCore can return a cached wrapper object or not.
     306
     307Usage: It can be specified on methods or attributes:
     308{{{
     309    attribute [ReturnNewObject] Node node;
     310    [ReturnNewObject] Node createTextNode();
     311}}}
     312
     313Without [ReturnNewObject], JavaScriptCore and V8 cache a wrapper object for performance.
     314For example, consider the case where node.firstChild is accessed:
     315
     316 * Node::firstChild() is called
     317 * The result is passed to toJS() or toV8()
     318 * toJS() or toV8() checks if a wrapper object of the result is already cached on the node
     319 * If cached, the cached wrapper object is returned
     320 * Otherwise, toJS() or toV8() creates the wrapper object of the result
     321 * The created wrapper object is cached on the node
     322 * The wrapper object is returned
     323
     324On the other hand, if you do not want to cache the wrapper object and want to create the wrapper object every time,
     325you can specify [ReturnNewObject].
     326
     327
    294328=== * [ImplementedAs](m) ===
    295329
    296330Summary: It specifies a method name in WebCore implementation, if the IDL method name and the WebCore method name are different.
    297331
    298 Usage: The possible usage is [ImplementedAs=XXX], where XXX is a method name of the WebCore implementation. It can be specified on methods, like this:
    299 {{{
    300     void [ImplementedAs=deleteFunction] delete();
     332Usage: The possible usage is [ImplementedAs=XXX], where XXX is a method name of the WebCore implementation. It can be specified on methods:
     333{{{
     334    [ImplementedAs=deleteFunction] void delete();
    301335}}}
    302336
     
    319353=== * [Replaceable](a) ===
    320354
     355 * [http://dev.w3.org/2006/webapi/WebIDL/#Replaceable The spec of replaceable]
     356
     357Summary: It controls if a given attribute is "replaceable" or not.
     358
     359Usage: It can be specified on attributes:
     360{{{
     361    interface DOMWindow {
     362        attribute [Replaceable] screenX;
     363    }
     364}}}
     365
     366Intuitively, "replaceable" means that you can set a new value to the attribute without overwriting the current value.
     367If you delete the new value, then the old value still remains.
     368
     369Specifically, without [Replaceable], the attribute behaves as follows:
     370{{{
     371    window.screenX; // Evaluates to 0
     372    window.screenX = "foo";
     373    window.screenX; // Evaluates to "foo"
     374    delete window.screenX;
     375    window.screenX; // Evaluates to undefined
     376}}}
     377
     378With [Replaceable], the attribute behaves as follows:
     379{{{
     380    window.screenX; // Evaluates to 0
     381    window.screenX = "foo";
     382    window.screenX; // Evaluates to "foo"
     383    delete window.screenX;
     384    window.screenX; // Evaluates to 0
     385}}}
     386
     387Whether you should specify [Replaceable] or not depends on the spec of each attribute.
     388
     389
    321390=== * [Deletable](a), [NotEnumerable](a), [V8ReadOnly](a) ===
    322391
     
    325394Summary: They control Writability, Enumerability and Configurability of attributes.
    326395
    327 Usage: They can be specified on attributes, like this:
     396Usage: They can be specified on attributes:
    328397{{{
    329398    attribute [NotEnumerable, Deletable] DOMString str;
     
    340409Summary: For performance optimization, it indicates to cache a wrapped object in a DOM object.
    341410
    342 Usage: It can be specified on attributes, like this:
     411Usage: It can be specified on attributes:
    343412{{{
    344413    interface HTMLFoo {
     
    393462Summary: They control where a given attribute getter/setter is defined.
    394463
    395 Usage: They can be specified on attributes, like this:
     464Usage: They can be specified on attributes:
    396465{{{
    397466    attribute [V8Unforgeable] DOMString str1;
     
    415484Summary: It indicates that a given DOMString is a URL.
    416485
    417 Usage: It can be specified on DOMString attributes, like this:
     486Usage: It can be specified on DOMString attributes:
    418487{{{
    419488    attribute [Reflect, V8URL] DOMString url;
     
    448517 * we need to modify WebCore/page/DOMWindow.{h,cpp} to add the C++ implementation of the attribute getters and setters or the method callbacks.
    449518
    450 On the other hand, in the modularized world with [Supplemental], we just need to modify the code under WebCore/Modules/XXX/, like this:
     519On the other hand, in the modularized world with [Supplemental], we just need to modify the code under WebCore/Modules/XXX/:
    451520
    452521 * WebCore/Modules/XXX/DOMWindowXXX.idl