Changes between Version 146 and Version 147 of WebKitIDL


Ignore:
Timestamp:
Feb 25, 2016, 8:39:17 PM (9 years ago)
Author:
Chris Dumez
Comment:

Drop [TreatUndefinedAs=X]

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v146 v147  
    88[#NamingRules Basic naming rules of IDL attributes][[br]]
    99[#IDLAttributes IDL attributes]
    10  - [#TreatNullAs TreatNullAs(a,p), TreatUndefinedAs(a,p)][[br]]
     10 - [#TreatNullAs TreatNullAs(a,p)][[br]]
    1111 - [#Default Default(p)][[br]]
    1212 - [#Clamp Clamp(a,p)][[br]]
     
    225225In 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.
    226226
    227 == `[TreatNullAs]`(a,p), `[TreatUndefinedAs]`(a,p) == #TreatNullAs
     227== `[TreatNullAs]`(a,p) == #TreatNullAs
    228228
    229229 * [http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs The spec of TreatNullAs] (Note: The WebKit behavior explained below is different from the spec)
    230  * [http://dev.w3.org/2006/webapi/WebIDL/#TreatUndefinedAs The spec of TreatUndefinedAs] (Note: The WebKit behavior explained below is different from the spec)
    231230
    232231Summary: They control the behavior when a JavaScript null or undefined is passed to a DOMString attribute or parameter.
    233232
    234 Usage: The possible usage is `[TreatNullAs=NullString]` or `[TreatUndefinedAs=NullString]`.
     233Usage: The possible usage is `[TreatNullAs=NullString]`.
    235234They can be specified on DOMString attributes or DOMString parameters only:
    236235{{{
    237236    [TreatNullAs=NullString] attribute DOMString str;
    238     void func([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString str);
     237    void func([TreatNullAs=NullString] DOMString str);
    239238}}}
    240239
     
    245244`[TreatNullAs=NullString]` in WebKit corresponds to `[TreatNullAs=EmptyString]` in the Web IDL spec.
    246245Unless 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,
    249 then it is converted to a WebKit null string, for which both String::IsEmpty() and String::IsNull() will return true.
    250 Without `[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.
    253 Unless the spec specifies `[TreatUndefinedAs=EmptyString]`, you should not specify `[TreatUndefinedAs=NullString]` in WebKit.
    254 
    255 Note: 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]`.
    257246
    258247== `[Default]`(p) == #Default