Changes between Version 17 and Version 18 of WebKitIDL


Ignore:
Timestamp:
Feb 13, 2012 12:48:46 AM (10 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v17 v18  
    2929=== * [TreatNullAs](a,p), [TreatUndefinedAs](a,p) ===
    3030
    31  * [http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs The spec of [TreatNullAs]] (Note: The WebKit IDL explained below behaves differently from the spec)
    32  * [http://dev.w3.org/2006/webapi/WebIDL/#TreatUndefinedAs The spec of [TreatUndefinedAs]] (Note: The WebKit IDL explained below behaves differently from the spec)
     31 * [http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs The spec of [TreatNullAs\]] (Note: The WebKit IDL explained below behaves differently from the spec)
     32 * [http://dev.w3.org/2006/webapi/WebIDL/#TreatUndefinedAs The spec of [TreatUndefinedAs\]] (Note: The WebKit IDL explained below behaves differently from the spec)
    3333
    3434The possible usage is [TreatNullAs=NullString] or [TreatUndefinedAs=NullString].
    35 They can be specified on attributes or parameters of type DOMString only, like this:
     35They can be specified on DOMString attributes or DOMString parameters only, like this:
    3636
    3737{{{
    3838    attribute [TreatNullAs=NullString] DOMString str;
    39     void operation(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString str);
    40 }}}
    41 
    42 [TreatNullAs=NullString] indicates that if JavaScript null is passed to the attribute/parameter,
    43 then it is converted to the null string in WebKit, for which String::IsEmpty() and String::IsNull() will return true.
    44 Without [TreatNullAs=NullString], JavaScript null is converted to a string "null" in WebKit.
     39    void func(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString str);
     40}}}
     41
     42[TreatNullAs=NullString] indicates that if a JavaScript null is passed to the attribute/parameter,
     43then it is converted to a null string in WebKit, for which String::IsEmpty() and String::IsNull() will return true.
     44Without [TreatNullAs=NullString], a JavaScript null is converted to a string "null" in WebKit.
    4545
    4646[TreatNullAs=NullString] corresponds to [TreatNullAs=EmptyString] in the Web IDL spec.
    4747Unless the spec does not specify [TreatNullAs=EmptyString], you should not specify [TreatNullAs=NullString] in WebKit.
    4848
    49 [TreatUndefinedAs=NullString] indicates that if JavaScript undefined is passed to the attribute/parameter,
    50 then it is converted to the null string in WebKit, for which IsEmpty() and IsNull() will return true.
    51 Without [TreatUndefinedAs=NullString], JavaScript undefined is converted to a string "undefined" in WebKit.
     49[TreatUndefinedAs=NullString] indicates that if a JavaScript undefined is passed to the attribute/parameter,
     50then it is converted to a null string in WebKit, for which IsEmpty() and IsNull() will return true.
     51Without [TreatUndefinedAs=NullString], a JavaScript undefined is converted to a string "undefined" in WebKit.
    5252
    5353[TreatUndefinedAs=NullString] corresponds to [TreatUndefinedAs=EmptyString] in the Web IDL spec.
     
    5757[TreatUndefinedAs=NullString] must be used with [TreatNullAs=NullString], i.e. [TreatNullAs=NullString, TreatUndefinedAs=NullString].
    5858
    59 
    60 === * [TreatReturnedNullStringAs](o,a,p) ===
     59=== * [TreatReturnedNullStringAs](o,a) ===
     60
     61The possible usage is [TreatReturnedNullStringAs=Null], [TreatReturnedNullStringAs=Undefined] or [TreatReturnedNullStringAs=False].
     62They can be specified on DOMString attributes or operations which return a DOMString value, like this:
     63
     64{{{
     65    attribute [TreatReturnedNullStringAs=Null] DOMString str;
     66    [TreatReturnedNullStringAs=Undefined] DOMString func();
     67}}}
     68
     69[TreatReturnedNullStringAs=Null] indicates that if the returned string is a null string in WebKit, the returned value is converted to a JavaScript null.
     70
     71[TreatReturnedNullStringAs=Undefined] indicates that if the returned string is a null string in WebKit, the returned value is converted to a JavaScript undefined.
     72
     73[TreatReturnedNullStringAs=False] indicates that if the returned string is a null string in WebKit, the returned value is converted to a JavaScript false.
     74
     75Without [TreatReturnedNullStringAs=...], if the returned string is a null string in WebKit, the returned value becomes a JavaScript empty string ''. Note that what should be specified depends on the spec of each attribute or operation.
    6176
    6277=== * [Optional](p) ===
    6378
     79
     80
    6481=== * [Callback](i,p) ===
    6582
     
    94111=== * [Supplemental](i) ===
    95112
    96  * [http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface The spec of [Supplemental]]
    97 
    98  * [http://old.nabble.com/Things-missing-from-Web-IDL-for-HTML5-td24873773.html Easy explanation of [Supplemental]]
     113 * [http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface The spec of [Supplemental\]]
     114
     115 * [http://old.nabble.com/Things-missing-from-Web-IDL-for-HTML5-td24873773.html Easy explanation of [Supplemental\]]
    99116
    100117The [Supplemental] IDL helps WebKit modularization. The [Supplemental] IDL makes it possible to add XXX's APIs (e.g. XXX=WebAudio, WebSocket, Blob, GamePad, ...etc) without modifying code outside of WebCore/Modules/XXX/. This helps make XXX a "self-contained module".