Bug 434381 - HTML5 validation should allow the 'role' and 'aria-*' attributes.
The 'role' and 'aria-*' attributes are made to be valid HTML5 attributes.
Signed-off-by: vrubezhny <vrubezhny@exadel.com>
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
index eb618b3..233c47e 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/validate/HTMLAttributeValidator.java
@@ -74,8 +74,16 @@
//WHATWG x-vendor-feature attributes
private static final String ATTR_NAME_USER_AGENT_FEATURE = "x-"; //$NON-NLS-1$
private static final int ATTR_NAME_USER_AGENT_FEATURE_LENGTH = ATTR_NAME_USER_AGENT_FEATURE.length();
-
+
// D210422
+
+ // Accessible Rich Internet Applications (WAI-ARIA)
+ private static final String ATTR_NAME_WAI_ARIA_ROLE = "role"; //$NON-NLS-1$
+
+ private static final String ATTR_NAME_WAI_ARIA = "aria-"; //$NON-NLS-1$
+ private static final int ATTR_NAME_WAI_ARIA_LENGTH = ATTR_NAME_WAI_ARIA.length();
+
+
/**
* HTMLAttributeValidator constructor comment.
*/
@@ -173,7 +181,9 @@
if (adec == null) {
if ((attrName.startsWith(ATTR_NAME_DATA) && attrName.length() > ATTR_NAME_DATA_LENGTH) ||
- (attrName.startsWith(ATTR_NAME_USER_AGENT_FEATURE) && attrName.length() > ATTR_NAME_USER_AGENT_FEATURE_LENGTH)) {
+ (attrName.startsWith(ATTR_NAME_USER_AGENT_FEATURE) && attrName.length() > ATTR_NAME_USER_AGENT_FEATURE_LENGTH) ||
+ attrName.equals(ATTR_NAME_WAI_ARIA_ROLE) ||
+ (attrName.startsWith(ATTR_NAME_WAI_ARIA) && attrName.length() > ATTR_NAME_WAI_ARIA_LENGTH)) {
if (isHTML5(target))
continue;
}