Changes between Version 155 and Version 156 of WebKitIDL
- Timestamp:
- Aug 28, 2017 11:21:16 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WebKitIDL
v155 v156 40 40 - [#JSNoStaticTables JSNoStaticTables(i)][[br]] 41 41 - [#ObjCProtocol ObjCProtocol(i), ObjCPolymorphic(i), ObjCLegacyUnnamedParameters(m), ObjCUseDefaultView(m), ObjCImplementedAsUnsignedLongLong(a)][[br]] 42 - [#CPPPureInterface CPPPureInterface(i)][[br]]43 42 - [#CustomReturn CustomReturn(p)][[br]] 44 43 - [#ArrayClass ArrayClass(i)][[br]] … … 56 55 = Overview = #Overview 57 56 58 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, 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 CPPinterfaces is automatically generated.57 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, ObjC, and GObject. 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, and GObject interfaces is automatically generated. 59 58 60 59 This 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. … … 92 91 The key points are as follows: 93 92 94 * An IDL file controls how the bindings code between JavaScript engine (or ObjC, GObject , CPP) and the WebKit implementation is generated.93 * An IDL file controls how the bindings code between JavaScript engine (or ObjC, GObject) and the WebKit implementation is generated. 95 94 * IDL attributes enable you to control the bindings code more in detail. 96 95 * There are 90~ IDL attributes and their roles are explained in the subsequent sections. … … 143 142 Tools/Scripts/run-bindings-tests tests IDL attributes. 144 143 Specifically, run-bindings-tests reads WebCore/bindings/scripts/test/*.idl, 145 and then generates bindings code to WebCore/bindings/scripts/test/{JS,ObjC,GObject ,CPP}/*.144 and then generates bindings code to WebCore/bindings/scripts/test/{JS,ObjC,GObject}/*. 146 145 For example, run-bindings-tests reads WebCore/bindings/scripts/test/TestObj.idl, 147 146 and then generates bindings code to WebCore/bindings/scripts/test/JS/JSTestObj.h, WebCore/bindings/scripts/test/JS/JSTestObj.cpp, etc. … … 198 197 WebKitBuild/Release/DerivedSources/webkit/WebKitDOMXXX.cpp 199 198 }}} 200 * CPP:201 202 {{{203 WebKitBuild/Release/DerivedSources/WebCore/WebDOMXXX.h204 WebKitBuild/Release/DerivedSources/WebCore/WebDOMXXX.cpp205 }}}206 199 207 200 = Basic naming rules of IDL attributes = #NamingRules … … 213 206 * ObjC-specific IDL attributes are prefixed by "ObjC". 214 207 * GObject-specific IDL attributes are prefixed by "GObject". 215 * CPP-specific IDL attributes are prefixed by "CPP".216 208 * IDL attributes for custom bindings are prefixed by "Custom". 217 209 … … 336 328 }}} 337 329 338 Note: ObjC , GObject and CPPbindings do not support custom bindings.330 Note: ObjC and GObject bindings do not support custom bindings. 339 331 340 332 == `[CustomBinding]` == #CustomBinding … … 377 369 The main difference between `[Custom]` and `[CustomBinding]` is that `[Custom]` generates a `jsXXXPrototypeFunctionMyMethod` where it performs the parameters management, casting to the object and calls the `JSXXX::myMethod` with the parameters and the instance. With `[CustomBinding]`, the implementation of `jsXXXPrototypeFunctionMyMethod` is not done automatically and it is up to the developer to do all the parameter, casting and call operations. 378 370 379 Note: ObjC , GObject and CPPbindings do not support `[CustomBinding]` bindings.371 Note: ObjC and GObject bindings do not support `[CustomBinding]` bindings. 380 372 381 373 == `[CallWith]`(m,a), `[SetterCallWith]`(a) == #CallWith … … 1192 1184 Used by ObjC bindings only. 1193 1185 1194 == `[CPPPureInterface]`(i) == #CPPPureInterface1195 1196 Used by CPP bindings only.1197 1198 1186 == `[CustomReturn]`(p) == #CustomReturn 1199 1187 1200 Used by ObjC , GObject and CPPbindings only.1188 Used by ObjC and GObject bindings only. 1201 1189 1202 1190 == `[ArrayClass]`(i) == #ArrayClass