# Data- & Aria- Attribute Support Added to XHP

DevFeed: [Data- & Aria- Attribute Support Added to XHP](<https://devfeed.tech/articles/data-aria-attribute-support-added-to-xhp-22034.md>)

Original publisher: [Read original article](<https://codebeforethehorse.tumblr.com/post/41920380130>)

Author: Codebeforethehorse

Published: 2013-01-31T03:47:00Z

Content type: release

Language: en

Sources: [Stefan Parker](<https://devfeed.tech/sources/stefan-parker.md>)

Topics: [aria](<https://devfeed.tech/topics/aria.md>), [html elements](<https://devfeed.tech/topics/html-elements.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [aria](<https://devfeed.tech/tags/aria.md>), [download](<https://devfeed.tech/tags/download.md>), [framework](<https://devfeed.tech/tags/framework.md>), [html-elements](<https://devfeed.tech/tags/html-elements.md>), [source](<https://devfeed.tech/tags/source.md>), [xhp](<https://devfeed.tech/tags/xhp.md>)

## AI overview

The article announces data- and aria-attribute support in XHP. The support is implemented in :x:composable-element, allowing these attributes on XHP elements; HTML elements render them, while custom extensions do not use them by default.

## Source excerpt

Last night I added data- and aria- attribute support into XHP. I baked it into :x:composable-element directly instead of relying on previous methods which only added it to :xhp:html-element. I did this for a few reasons. First, I didn't like the idea of getAttribute() and setAttribute() not being final within :x:primitive. Secondly, if you want to build a UI framework on top of :x:element that forwards attributes, you'd need to un-final getAttribute() and setAttribute() in :x:element too, and duplicate all the logic in :xhp:html-element into your UI framework. No, I feel it's much better to have the slightly nuanced behavior of always allowing data- and aria- attributes on XHP, even if they won't do anything on custom :x:element extensions by default (HTML elements render them just fine). You can download the latest source at: https://github.com/facebook/xhp.