The html5 specification often contains the notion idl-attribute. For example, from the description of the attribute title

"The title IDL attribute must reflect the title content attribute"

Approximate translation: "idl-title attribute should display the contents of the title attribute"

Do not understand what this phrase means? And here idl and what does idl have to do with html? I thought idl is a completely different language.

Or, for example, the style attribute.

"The style IDL attribute is defined in the CSS Object Model (CSSOM) specification"

Approximate translation: "The idl-style attribute is defined in the CSS Object Model (CSSOM) specification specification"

It is clear that this attribute is defined in such a specification, but what is this attribute? What is it for, what does it give? and what does the html specification have to do with it?

  • 2
    IDL attribute is an attribute in the form of a javascript property. Reflects or corresponds to an attribute of an element. given by <input maxlength="123"> . There is an attribute maxlength . Get it this way: element.getAttribute("maxlength") . And it is possible through the IDL-attribute - element.maxlength . developer.mozilla.org/ru/docs/Web/HTML/… - Sergey
  • still not catching up with something. What does idl have to do with the html specification? How is it really used in html? - Pavel Igorev

1 answer 1

First , the world of the web is constantly changing, new features are constantly appearing that need to be specified. The number of specs has grown, and in order to somehow unify the concepts used in different specifications, a certain “meta-spec” appeared: Web-IDL , Interface Defenition Language for Web. A document describing how to describe the interfaces for new browser features. Actually the concept of IDL-attribute is taken from there.

Secondly , in the web quite often the situation first features appear, and only when the features are all used for a long time, is the speck written for them. Which simply takes what it is and describes formally. That is, in fact, the cake does not affect the development of a feature for a longer time.

As a result , we have a certain interface. Those same IDL attributes.
And there is a real world.
And it would be necessary to somehow introduce these two things to each other, but it turns out not to be good. The lines you quoted are what this does.

Examples:
Suppose you have in html
<p id = "someid" title = "trololo" style="background:red">sometext</p>

On the first selected line:
What do you get when you write document.getElementById('someid').title ?
Here is the line of specs and says that "don't worry, guy, what you wrote in the tag for the title and what you are trying to get is the same"

"The title IDL attribute must reflect the title content attribute"

By the second highlighted line

"The style IDL attribute is defined in the CSS Object Model (CSSOM) specification"

What do you really get by contacting making document.getElementById('someid').style - look in the spec for the CSA.