Changes between Version 147 and Version 148 of WebKitIDL


Ignore:
Timestamp:
Feb 29, 2016 11:31:36 AM (6 years ago)
Author:
Chris Dumez
Comment:

[TreatNullAs=EmptyString]

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v147 v148  
    227227== `[TreatNullAs]`(a,p) == #TreatNullAs
    228228
    229  * [http://dev.w3.org/2006/webapi/WebIDL/#TreatNullAs The spec of TreatNullAs] (Note: The WebKit behavior explained below is different from the spec)
    230 
    231 Summary: They control the behavior when a JavaScript null or undefined is passed to a DOMString attribute or parameter.
    232 
    233 Usage: The possible usage is `[TreatNullAs=NullString]`.
     229 * [http://heycam.github.io/webidl/#TreatNullAs The spec of TreatNullAs]
     230
     231Summary: When a JavaScript null is passed to a DOMString attribute or parameter, its gets converted to the empty string "" internally instead of being stringified as the string "null".
     232
     233Usage: The possible usage is `[TreatNullAs=EmptyString]`.
    234234They can be specified on DOMString attributes or DOMString parameters only:
    235235{{{
    236     [TreatNullAs=NullString] attribute DOMString str;
    237     void func([TreatNullAs=NullString] DOMString str);
    238 }}}
    239 
    240 `[TreatNullAs=NullString]` indicates that if a JavaScript null is passed to the attribute or parameter,
    241 then it is converted to a WebKit null string, for which both String::IsEmpty() and String::IsNull() will return true.
    242 Without `[TreatNullAs=NullString]`, a JavaScript null is converted to a WebKit string "null".
    243 
    244 `[TreatNullAs=NullString]` in WebKit corresponds to `[TreatNullAs=EmptyString]` in the Web IDL spec.
    245 Unless the spec specifies `[TreatNullAs=EmptyString]`, you should not specify `[TreatNullAs=NullString]` in WebKit.
     236    [TreatNullAs= EmptyString] attribute DOMString str;
     237    void func([TreatNullAs= EmptyString] DOMString str);
     238}}}
    246239
    247240== `[Default]`(p) == #Default