I recently received the following comment:
Are these custom attributes (dw-filter et al) going to be valid across all browsers? Goes against the
data-*
convention.
Arguably, now that angular is becoming more prevalent on the web it's fairly common to find something such as:
<a _ngcontent-c2 class="col-1-4" ng-reflect-router-link="/detail/13" href="/preview/cj9t4xj0v00113c5sw2c8s6w8/detail/13">
<div _ngcontent-c2 class="module">
<h4 _ngcontent-c2>Bombasto</h4>
</div>
</a>
The W3 HTML5 spec explicitly states that:
https://www.w3.org/TR/html5/dom.html#custom-data-attribute: A custom data attribute is an attribute in no namespace whose name starts with the string "data-"
Angular applications always fail w3 validation due to this, even though very simple arbitrary custom attributes (some-attr="1"
) still work in all HTML5 browsers without complaint / error.
Do websites (angular or not) which use such custom attributes really need to honor this part of the specification anymore?