pátek 18. května 2007

Irelevantní atribut

Zatímco stále probíhají debaty, zda je dobře, že byly předdefinované třídy zrušeny, ukážeme si část HTML5, která je 100% irelevantní.

Jedná se o atribut irrelevant, o kterém specifikace říká:
All elements may have the irrelevant content attribute set. The irrelevant attribute is a boolean attribute. When specified on an element, it indicates that the element is not yet, or is no longer, relevant. User agents should not render elements that have the irrelevant attribute specified.
Možnost skrýt část obsahu přímo pomocí značkovacího jazyka (bez nutnosti CSS) mě nepřekvapuje (mají to i další jazyky, např. XUL) . V tomto případě se nejedná o libovolné skrytí, je v něm zanesen i malý sémantický význam.
The irrelevant attribute must not be used to hide content that could legitimately be shown in another presentation. For example, it is incorrect to use irrelevant to hide panels in a tabbed dialog, because the tabbed interface is merely a kind of overflow presentation — showing all the form controls in one big page with a scrollbar would be equivalent, and no less correct.
Elements in a section hidden by the irrelevant attribute are still active, e.g. scripts and form controls in such sections still render execute and submit respectively. Only their presentation to the user changes.
Text specifikace by mohl být jasnější. Přiznám se, že z jeho přečtení si nejsem 100% jistý, kde atribut použít a kde nikoliv. Navíc použití irrelevant="" pro nastavení atributu se mi líbí o něco méně než například irrelevant="true".

Až tento atribut přijde v HTML WG na řadu, bude zapotřebí dodat argumenty pro opodstatnění jeho existence, aby nedopadl podobně jako předdefinované třídy.

Zatím je atribut i obsah tohoto spotu prakticky irrelevant="".

Žádné komentáře:

Okomentovat

Poznámka: Komentáře mohou přidávat pouze členové tohoto blogu.