Changes between Version 16 and Version 17 of WebKitIDL


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

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v16 v17  
    2525== IDL attributes around operations, attributes and parameters ==
    2626
     27In the following explanations, (i), (o), (a) and (p) means that the IDL attribute can be specified on interfaces, operations, attributes and parameters, respectively. For example, (a,p) means that the IDL attribute can be specified on attributes and parameters.
     28
    2729=== * [TreatNullAs](a,p), [TreatUndefinedAs](a,p) ===
     30
     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)
     33
     34The possible usage is [TreatNullAs=NullString] or [TreatUndefinedAs=NullString].
     35They can be specified on attributes or parameters of type DOMString only, like this:
     36
     37{{{
     38    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,
     43then it is converted to the null string in WebKit, for which String::IsEmpty() and String::IsNull() will return true.
     44Without [TreatNullAs=NullString], JavaScript null is converted to a string "null" in WebKit.
     45
     46[TreatNullAs=NullString] corresponds to [TreatNullAs=EmptyString] in the Web IDL spec.
     47Unless the spec does not specify [TreatNullAs=EmptyString], you should not specify [TreatNullAs=NullString] in WebKit.
     48
     49[TreatUndefinedAs=NullString] indicates that if JavaScript undefined is passed to the attribute/parameter,
     50then it is converted to the null string in WebKit, for which IsEmpty() and IsNull() will return true.
     51Without [TreatUndefinedAs=NullString], JavaScript undefined is converted to a string "undefined" in WebKit.
     52
     53[TreatUndefinedAs=NullString] corresponds to [TreatUndefinedAs=EmptyString] in the Web IDL spec.
     54Unless the spec does not specify [TreatUndefinedAs=EmptyString], you should not specify [TreatUndefinedAs=NullString] in WebKit.
     55
     56Note: For now the sole usage of [TreatUndefinedAs=NullString] is not allowed in WebKit.
     57[TreatUndefinedAs=NullString] must be used with [TreatNullAs=NullString], i.e. [TreatNullAs=NullString, TreatUndefinedAs=NullString].
     58
    2859
    2960=== * [TreatReturnedNullStringAs](o,a,p) ===
     
    6394=== * [Supplemental](i) ===
    6495
    65  * [http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface The spec]
     96 * [http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface The spec of [Supplemental]]
    6697
    67  * [http://old.nabble.com/Things-missing-from-Web-IDL-for-HTML5-td24873773.html Easy explanation]
     98 * [http://old.nabble.com/Things-missing-from-Web-IDL-for-HTML5-td24873773.html Easy explanation of [Supplemental]]
    6899
    69100The [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".