Changes between Version 11 and Version 12 of WebKitIDL


Ignore:
Timestamp:
Jan 27, 2012 6:23:04 PM (12 years ago)
Author:
haraken@chromium.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v11 v12  
    2929The [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".
    3030
    31 Here is an example. Without the [Supplemental] IDL, if we want to add attributes or methods of XXX to DOMWindow,
     31Here is an example. Without the [Supplemental] IDL, if we want to add XXX's attributes or methods to DOMWindow,
    3232
    33  * we need to modify WebCore/page/DOMWindow.idl to add the IDLs of the attributes or methods
     33 * we need to modify WebCore/page/DOMWindow.idl to add the IDLs of the XXX's attributes or methods
    3434
    35  * we might need to modify WebCore/page/DOMWindow.{h,cpp} to add the C++ implementation of attribute getters and setters or method callbacks.
     35 * we need to modify WebCore/page/DOMWindow.{h,cpp} to add the C++ implementation of the attribute getters and setters or the method callbacks.
    3636
    3737On the other hand, in the modularized world with the [Supplemental] IDL, we just need to modify the code under WebCore/Modules/XXX/, like this:
     
    4141   interface [
    4242       Conditional=XXX,
    43        Supplemental=DOMWindow
     43       Supplemental=DOMWindow    // The attributes and methods of this interface are exposed as those of DOMWindow.
    4444   ] DOMWindowXXX {
    4545       attribute foo;
     
    5050 * WebCore/Modules/XXX/DOMWindowXXX.h
    5151{{{
    52    DOMWindowXXX::foo(...) { ... }   // the C++ implementation of the foo attribute getter
    53    DOMWindowXXX::setFoo(...) { ... }   // the C++ implementation of the foo attribute setter
    54    DOMWindowXXX::bar(...) { ... }   // the C++ implementation of the bar method callback
     52   DOMWindowXXX::foo(...) { ... }   // The C++ implementation of the foo attribute getter.
     53   DOMWindowXXX::setFoo(...) { ... }   // The C++ implementation of the foo attribute setter.
     54   DOMWindowXXX::bar(...) { ... }   // The C++ implementation of the bar method callback.
    5555}}}
    5656
    57 As shown above, [Supplemental=DOMWindow] indicates that all the attributes and methods in DOMWindowXXX should be exposed on DOMWindow but should be implemented in DOMWindowXXX. In this way, we can implement the attributes and methods without modifying code of DOMWindow.{h,cpp,idl}. If you want to add APIs whose implementations are likely to be independent from WebCore, it is strongly recommended to put the APIs and .h/.cpp files into WebCore/Modules/XXX/ using the [Supplemental] IDL.
     57As shown above, [Supplemental=DOMWindow] indicates that all the attributes and methods of DOMWindowXXX should be exposed on DOMWindow, but should be implemented in DOMWindowXXX. In this way, we can implement the attributes and methods without modifying code of DOMWindow.{h,cpp,idl}.
     58
     59If you want to add APIs whose implementations are likely to be independent from WebCore, it is strongly recommended to put the APIs and .h/.cpp files into WebCore/Modules/XXX/ using the [Supplemental] IDL.
    5860
    5961== ''[...]'' ==