[webkit-dev] Enable the [Supplemental] IDL on all build systems

Kentaro Hara haraken at chromium.org
Sat Dec 31 00:21:57 PST 2011


==== TL;DR ====
I have been enabling the [Supplemental] IDL on all build systems. I
have so far enabled it in AppleWebKit, Chromium, GTK, Qt, Efl and
WinCE, but I need help with enabling it in AppleWin, GTK/GObject and
BlackBerry.


==== What is the [Supplemental] IDL? ====

Easy explanation:
http://old.nabble.com/Things-missing-from-Web-IDL-for-HTML5-td24873773.html
Meta bug: https://bugs.webkit.org/show_bug.cgi?id=72138
The spec: http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface

The [Supplemental] IDL helps WebKit modularization, yay! The
[Supplemental] IDL makes it possible to add XXX APIs (e.g.
XXX=WebAudio, WebSocket, GeoLocation, GamePad, ...etc) without
modifying any code outside of WebCore/Modules/XXX/, which helps make
XXX a self-contained module.

Here is an example. In the current world without the [Supplemental]
IDL, if we want to add attributes or methods of XXX to DOMWindow,

- we need to modify WebCore/page/DOMWindow.idl to add the IDLs of the
attributes or methods
- we might need to modify WebCore/page/DOMWindow.{h,cpp} to add the
C++ implementation of attribute getters and setters or method
callbacks.

On the other hand, in the future modularized world with the
[Supplemental] IDL, we just need to modify the code under
WebCore/Modules/XXX/, like this:

    //
    // WebCore/Modules/XXX/DOMWindowXXX.idl
    //
    interface [
        Conditional=XXX,
        Supplemental=DOMWindow      // Awesome!
    ] DOMWindowXXX {
        attribute foo;
        void bar();
    };

    //
    // WebCore/Modules/XXX/DOMWindowXXX.h
    //
    DOMWindowXXX::foo(...) { ... }   // the C++ implementation of the
foo attribute getter
    DOMWindowXXX::setFoo(...) { ... }   // the C++ implementation of
the foo attribute setter
    DOMWindowXXX::bar(...) { ... }   // the C++ implementation of the
bar method callback

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 any code of
DOMWindow.{h,cpp,idl}. I hope this will help WebKit modularization and
make WebKit closer to the Web IDL [Supplemental] spec.


==== Specifically, what change is required to enable the
[Supplemental] IDL? ====

I have already implemented scripts to resolve [Supplemental]
dependency among all IDL files, and then generate binding code for JS,
V8, ObjC, CPP and GObject. What is left is to change the build flows
of _all_ build systems as follows:

- The current build flow:
    foreach $idl (all IDL files) {
        generate-bindings.pl depends on $idl;
        generate-bindings.pl reads $idl;
        generate-bindings.pl generates .h and .cpp files for $idl;
    }

- New build flow (See the discussions in bug 72138 for more details):
    resolve-supplemental.pl depends on all IDL files;
    resolve-supplemental.pl reads all IDL files;
    resolve-supplemental.pl resolves the dependency of [Supplemental=YYY];
    resolve-supplemental.pl outputs supplemental_dependency.tmp;
    foreach $idl (all IDL files) {
        generate-bindings.pl depends on $idl and supplemental_dependency.tmp;
        generate-bindings.pl reads $idl;
        generate-bindings.pl reads supplemental_dependency.tmp;
        generate-bindings.pl generates .h and .cpp files for $idl,
            including all attributes in the IDL files that are
implementing $idl;
    }

I have so far changed the build flows of AppleWebKit, Chromium, GTK,
Qt, Efl and WinCE, as described above.

- AppleWebKit: https://bugs.webkit.org/show_bug.cgi?id=74900
- Chromium: https://bugs.webkit.org/show_bug.cgi?id=73394
- GTK: https://bugs.webkit.org/show_bug.cgi?id=74972
- Qt: https://bugs.webkit.org/show_bug.cgi?id=75274
- Efl and WinCE: https://bugs.webkit.org/show_bug.cgi?id=75345


==== What is the problem? ====

Please note that we need to make a change on _all_ build systems (no
matter if the build system wishes to support the [Supplemental] IDL),
because if any of the build systems does not support the
[Supplemental] IDL, we still need to modify DOMWindow.{h,cpp,idl} for
that build system. Thus, we need to enable it also on AppleWin,
GTK/GObject and BlackBerry. Specifically, we need to make changes on
the following build scripts:

- WebCore/WebCore.vcproj/MigrateScripts (for AppleWin)
- WebCore/WebCore.vcproj/WebCore.vcproj (for AppleWin)
- WebCore/bindings/gobject/GNUmakefile.am (for GTK/GObject)
- WebCore/PlatformBlackBerry.cmake (for BlackBerry)

It is, however, difficult for me to change those bulid flows, since it
appears that neither do they have build bots nor I have the build
environment locally. Would anyone help this?


Best Regards


-- 
Kentaro Hara, Tokyo, Japan (http://haraken.info)


More information about the webkit-dev mailing list