Affecting Microdata API has added new properties to elements

Published: | Categories: DOM

Description

The HTML5 Microdata DOM API has been implemented, adding the getItems property to the Document interface as well as the itemId, itemProp, itemRef, itemScope, itemType, itemValue and properties properties to the Element interface.

Six Apart’s Movable Type is known to be affected by this change. They have fixed the issue and issued a patch after some features were broken due to its custom itemId property.

If you’d like to add custom data to each element, it should be safer to use the HTMLElement.dataset property rather than arbitrary properties. Firefox has also implemented the setUserData and getUserData methods that allow storing non-string data. However, those methods have been deprecated in favour of the WeakMap object.

Update: The Microdata API support has been removed with Firefox 49.

References