Question

From what I understand so far,

WebIDL plays as the same rule as DOM does.

The original DOMs (before WebIDL) were created by OMG IDL. However, this IDL is not specified for Javascript.

Hence, W3C creates webidl which is kinda subset of OMG IDL and it provides more flexibility to JS to create API than before.

Please let me know if I am incorrect here.

The followings are my questions:

  1. DOM is provided for JS developer to access markup language. Does WebIDL act as DOM do? Does it provide the interface for JS developer to access markup language? Does WebIDL do something else?

  2. Does WebIDL play different rules in Firefox browser and b2g (Firefox OS)?

  3. Why the system has better performance after using webidl?

  4. For DOM, the code flow should be Javascript--->DOM--->HTML For WebIDL, will this flow change? or WebIDL can access C++ code directly?

  5. Can I use WebIDL to create an interface to access to CSS?

  6. JS language binding appendices <----what do appendices mean?

Thanks for the reply

Was it helpful?

Solution

WebIDL is not a replacement for the DOM. Instead, it is a language used for specifying APIs, including the most recent version of the DOM API as well as other recent web standards.

The DOM4 standard contains WebIDL code for all of the interfaces and types it defines. For example, take a look at the WebIDL definition of the DOM ParentNode interface. It's just a format for listing the properties and methods of this interface. The IDL lists the name of each method, its return type and parameters, and a few other pieces of information about it. When you write document.body.childElementCount you are accessing a DOM API, and you can read the WebIDL code in the DOM standard to find out what type of data that API will return.

If you are a web developer, WebIDL doesn't change how you write your code at all, and it doesn't necessarily change anything about how browsers run your code. It's just a way for browser developers to specify interfaces in a standard, language-independent way.

"Appendices" (plural of "appendix") are sections or chapters of a document that are appended after the main content. A "JS language binding appendix" is an addition to an IDL spec that defines how the IDL interfaces should look when accessed by JavaScript programs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top