308
edits
No edit summary |
(Expand with a bunch of stuff we've discovered through experience. Remove some b2g-specific bits.) |
||
Line 1: | Line 1: | ||
A review checklist for DOM Peers while doing WebIDL reviews. | A review checklist for DOM Peers while doing WebIDL reviews. This is not exhaustive; things will be added as needed. | ||
== IDL follows spec == | |||
* The IDL has a link to the relevant specification. If there isn't one, the API must not be exposed to the web in general. | |||
* The IDL matches the IDL in the spec. | |||
** Double-check that our use of nullable sigils (<code>?</code>) matches the spec. | |||
** Double-check that our <code>Exposed</code> values match the spec. | |||
== Spec makes sense == | |||
* The API should be easy to understand and use, and consistent. | * The API should be easy to understand and use, and consistent. | ||
* Whether things are nullable or not needs to make sense. | |||
* Whether arguments and dictionary members are optional or not needs to make sense. | |||
* <code>Exposed</code> values should make sense. | |||
* The spec should almost certainly not be using the term "active document". If it is, think extra carefully about what happens when that document is not same-origin with any of the other things the spec is talking about. | |||
== Implementation is correct == | |||
* Check that the implementation follows the spec, as much as is possible without domain expertise. | |||
* All functions with non-nullable return values must never return null. | |||
* All functions that accept nullable or optional values (as arguments, dictionary members, etc) must properly handle the null or "not present" cases. | |||
* Exceptions thrown from functions should generally be specified. If there are non-specified exceptions being thrown, evaluate whether it's because Gecko has a state web specs assume can't arise (e.g. window without a document) or whether it's because the spec missed a case it should be handling. | |||
* If the API has <code>[Exposed=SomethingOtherThanWindow]</code>: | * If the API has <code>[Exposed=SomethingOtherThanWindow]</code>: | ||
** Audit the API implementation to make sure it doesn't assume the existence of a Window or a Document | ** Audit the API implementation to make sure it doesn't assume the existence of a Window or a Document | ||
** Require basic test coverage for each of the contexts in which the API is exposed. | ** Require basic test coverage for each of the contexts in which the API is exposed. | ||
* | * Implementation should use the argument types described in [https://developer.mozilla.org/en/Mozilla/WebIDL_bindings our binding layer documentation], not whatever internal types bindings are using (e.g. no types in the <code>binding::detail</code> namespace, no <code>NonNull<T></code> arguments where <code>T&</code> would work, etc). | ||
* Check that the <code>GetParentObject()</code> methods of various objects, combined with how those objects get constructed, associate them with the correct global. | |||
* | |||
== Further reading == | |||
Please refer to the [http://heycam.github.io/webidl/ WebIDL spec] or the [https://developer.mozilla.org/en/Mozilla/WebIDL_bindings documentation for our binding layer] in order to double check your understanding of the IDL as needed. | |||
[[Category:Web APIs]] | [[Category:Web APIs]] |
edits