Changes between Version 110 and Version 111 of WebKitIDL


Ignore:
Timestamp:
May 8, 2013 1:48:25 AM (8 years ago)
Author:
Christophe Dumez
Comment:

Remove remaining mentions of V8

Legend:

Unmodified
Added
Removed
Modified
  • WebKitIDL

    v110 v111  
    6060= Overview = #Overview
    6161
    62 The [http://www.w3.org/TR/WebIDL/ Web IDL] is a language that defines how WebCore interfaces are bound to external languages such as JavaScriptCore, V8, ObjC, GObject and CPP. You need to write IDL files (e.g. XMLHttpRequest.idl, Element.idl, etc) to expose WebCore interfaces to those external languages. When WebKit is built, the IDL files are parsed, and the code to bind WebCore implementations and JavaScriptCore, V8, ObjC, GObject and CPP interfaces is automatically generated.
     62The [http://www.w3.org/TR/WebIDL/ Web IDL] is a language that defines how WebCore interfaces are bound to external languages such as JavaScriptCore, ObjC, GObject and CPP. You need to write IDL files (e.g. XMLHttpRequest.idl, Element.idl, etc) to expose WebCore interfaces to those external languages. When WebKit is built, the IDL files are parsed, and the code to bind WebCore implementations and JavaScriptCore, ObjC, GObject and CPP interfaces is automatically generated.
    6363
    6464This document describes practical information about how the IDL bindings work and how you can write IDL files in WebKit. The syntax of IDL files is fairly well documented in the [http://www.w3.org/TR/WebIDL/ Web IDL spec], but it is too formal to read:-) and there are several differences between the Web IDL spec and the WebKit IDL due to implementation issues.
     
    148148Tools/Scripts/run-bindings-tests tests IDL attributes.
    149149Specifically, run-bindings-tests reads WebCore/bindings/scripts/test/*.idl,
    150 and then generates bindings code to WebCore/bindings/scripts/test/{JS,V8,ObjC,GObject,CPP}/*.
     150and then generates bindings code to WebCore/bindings/scripts/test/{JS,ObjC,GObject,CPP}/*.
    151151For example, run-bindings-tests reads WebCore/bindings/scripts/test/TestObj.idl,
    152152and then generates bindings code to WebCore/bindings/scripts/test/JS/JSTestObj.h, WebCore/bindings/scripts/test/JS/JSTestObj.cpp, etc.
     
    191191    WebKitBuild/Release/DerivedSources/WebCore/JSXXX.cpp
    192192}}}
    193  * V8:
    194 
    195 {{{
    196     out/Release/obj/gen/webkit/bindings/V8XXX.h
    197     out/Release/obj/gen/webcore/bindings/V8XXX.cpp
    198 }}}
    199193 * ObjC:
    200194
     
    222216 * A name should be aligned with the Web IDL spec as much as possible.
    223217 * JavaScriptCore-specific IDL attributes are prefixed by "JS".
    224  * V8-specific IDL attributes are prefixed by "V8".
    225218 * ObjC-specific IDL attributes are prefixed by "ObjC".
    226219 * GObject-specific IDL attributes are prefixed by "GObject".
     
    361354 * `[Custom]` on a method indicates that you can write JavaScriptCore custom bindings for the method.
    362355 * `[CustomGetter]` or `[CustomSetter]` on an attribute indicates that you can write JavaScriptCore custom bindings for the attribute getter or setter.
    363 
    364 For example, if you want to write custom bindings only for an attribute getter of JavaScriptCore and V8 and an attribute setter of JavaScriptCore, you can specify `[CustomGetter, JSCustomSetter]`.
    365356
    366357You can write custom bindings with JavaScriptCore for a method or an attribute getter/setter, as follows:
     
    459450ADD EXPLANATIONS
    460451
    461 V8 and JSC: `[StrictTypeChecking]` can also be applied to a DOMString parameter in an overloaded method to make the
     452JSC: `[StrictTypeChecking]` can also be applied to a DOMString parameter in an overloaded method to make the
    462453overload resolution only match for ECMAScript types null, undefined, string or object - and not number or boolean.
    463454This is to permit overloads which are not "distinguishable" in WebIDL, for example:
     
    480471}}}
    481472
    482 Without `[ReturnNewObject]`, JavaScriptCore and V8 cache a wrapped object for performance.
     473Without `[ReturnNewObject]`, JavaScriptCore cache a wrapped object for performance.
    483474For example, consider the case where `node.firstChild` is accessed:
    484475
     
    952943    }
    953944}}}
    954  * In V8: You can write custom `V8XXX::indexedPropertySetter(...)` in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    955 
    956 {{{
    957     v8::Handle<v8::Value> V8XXX::indexedPropertySetter(uint32_t index, const v8::AccessorInfo& info)
    958     {
    959         ...;
    960     }
    961 }}}
    962945
    963946== `[NamedGetter]`(i) == #NamedGetter
     
    1010993    }
    1011994}}}
    1012  * `[CustomNamedGetter]` in V8: You can write custom `V8XXX::namedPropertyGetter(...)` in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1013 
    1014 {{{
    1015     v8::Handle<v8::Value> V8XXX::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    1016     {
    1017         ...;
    1018     }
    1019 }}}
    1020995 * `[CustomNamedSetter]` in JavaScriptCore: You can write custom `JSXXX::putDelegate(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
    1021996
    1022997{{{
    1023998    bool JSXXX::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
    1024     {
    1025         ...;
    1026     }
    1027 }}}
    1028  * `[CustomNamedSetter]` in V8: You can write custom `V8XXX::namedPropertySetter(...)` in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1029 
    1030 {{{
    1031     v8::Handle<v8::Value> V8XXX::namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
    1032999    {
    10331000        ...;
     
    11401107}}}
    11411108
    1142  * `[CustomEnumerateProperty]` in V8: You can write custom bindings as `V8XXX::namedPropertyQuery(...)` and `V8XXX::namedPropertyEnumerator(...)` in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1143 
    1144 {{{
    1145     v8::Handle<v8::Integer> V8XXX::namedPropertyQuery(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    1146     {
    1147         ...;
    1148     }
    1149 
    1150     v8::Handle<v8::Array> V8XXX::namedPropertyEnumerator(const v8::AccessorInfo& info)
    1151     {
    1152         ...;
    1153     }
    1154 }}}
    1155 
    11561109 * `[CustomDeleteProperty]` in JavaScriptCore: You can write custom bindings for the case where a property of XXX is deleted.
    11571110Specifically, you can write custom `JSXXX::deleteProperty(...)` in WebCore/bindings/js/JSXXXCustom.cpp:
     
    11591112{{{
    11601113    bool JSXXX::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
    1161     {
    1162         ...;
    1163     }
    1164 }}}
    1165 
    1166  * `[CustomDeleteProperty]` in V8: You can write custom bindings as `V8XXX::namedPropertyDeleter(...)` in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1167 
    1168 {{{
    1169     v8::Handle<v8::Boolean> V8XXX::namedPropertyDeleter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    11701114    {
    11711115        ...;
     
    12561200{{{
    12571201    JSC::CallType JSXXX::getCallData(JSC::JSCell* cell, JSC::CallData& callData)
    1258     {
    1259         ...;
    1260     }
    1261 }}}
    1262  * V8: You can write custom `V8XXX::callAsFunctionCallback(...)` in WebCore/bindings/v8/custom/V8XXXCustom.cpp:
    1263 
    1264 {{{
    1265     v8::Handle<v8::Value> V8XXX::callAsFunctionCallback(const v8::Arguments& args)
    12661202    {
    12671203        ...;