| 84 | | * The above IDL file describes the Node ''''interface''''. |
| 85 | | * ELEMENT_NODE is a ''''constant'''' of the Node interface. |
| 86 | | * parentNode and nodeName are ''''attribute''''s of the Node interface. |
| 87 | | * appendChild(...) and addEventListener(...) are ''''method''''s of the Node interface. |
| 88 | | * type, listener and useCapture are ''''parameter''''s of the Node interface. |
| 89 | | * [JSCustomHeader], [CustomToJSObject], [TreatReturnedNullStringAs=Null], [Custom], [CustomReturn] and [Optional] are ''''IDL attribute''''s. |
| | 86 | * The above IDL file describes the Node '''interface'''. |
| | 87 | * ELEMENT_NODE is a '''constant''' of the Node interface. |
| | 88 | * parentNode and nodeName are '''attribute'''s of the Node interface. |
| | 89 | * appendChild(...) and addEventListener(...) are '''method'''s of the Node interface. |
| | 90 | * type, listener and useCapture are '''parameter'''s of the Node interface. |
| | 91 | * [JSCustomHeader], [CustomToJSObject], [TreatReturnedNullStringAs=Null], [Custom], [CustomReturn] and [Optional] are '''IDL attribute'''s. |
| | 131 | |
| | 132 | = IDL attribute checker = #IDLAttributeChecker |
| | 133 | |
| | 134 | Previously there had been many bugs caused by typos of IDL attributes in IDL files. |
| | 135 | To avoid such bugs, the IDL attribute checker is introduced to the WebKit build flow |
| | 136 | to check if all the IDL attributes used in IDL files are implemented in code generators. |
| | 137 | If you use an IDL attribute not implemented in code generators, the IDL attribute checker fails, and the WebKit build fails. |
| | 138 | |
| | 139 | A list of IDL attributes implemented in code generators is described in WebCore/bindings/scripts/IDLAttributes.txt. |
| | 140 | If you want to add a new IDL attribute, you need to |
| | 141 | |
| | 142 | 1. add the IDL attribute to WebCore/bindings/scripts/IDLAttributes.txt. |
| | 143 | 1. add the explanation to this document. |
| | 144 | 1. add test cases to run-bindings-tests (explained below). |
| | 145 | |
| | 146 | = run-bindings-tests = #RunBindingsTests |
| | 147 | |
| | 148 | Tools/Scripts/run-bindings-tests tests IDL attributes. |
| | 149 | Specifically, 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}/*. |
| | 151 | For example, run-bindings-tests reads WebCore/bindings/scripts/test/TestObj.idl, |
| | 152 | and then generates bindings code to WebCore/bindings/scripts/test/JS/JSTestObj.h, WebCore/bindings/scripts/test/JS/JSTestObj.cpp, etc. |
| | 153 | |
| | 154 | If you change the behavior of code generators or add a new IDL attribute, |
| | 155 | please add test cases to WebCore/bindings/scripts/test/*.idl. |
| | 156 | You can reset the results of run-bindings-tests using the --reset-results option: |
| | 157 | {{{ |
| | 158 | $ ./Tools/Scripts/run-bindings-tests --reset-results |
| | 159 | }}} |
| | 160 | |
| | 161 | '''The objective of run-bindings-tests is to show you and reviewers how the code generation is changed by your patch. |
| | 162 | If you change the behavior of code generators, please update the results of run-bindings-tests'''. |
| | 163 | |
| | 164 | That being said, people |
| | 165 | |