From 9aa0acee7ce6862035abaca29666c0bc2839384a Mon Sep 17 00:00:00 2001 From: Salvador Zalapa Date: Thu, 25 Jul 2013 10:22:40 -0500 Subject: Bug 409827: Wrong warning for HTML 5 'required' attribute for 'select' tag Signed-off-by: Salvador Zalapa --- .../core/internal/contentmodel/HTML5AttributeCollection.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java index e42c300965..378c3dada2 100644 --- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java +++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java @@ -943,6 +943,7 @@ public class HTML5AttributeCollection extends AttributeCollection implements HTM * (disabled (disabled) #IMPLIED) * (autofocus Boolean; #IMPLIED) * (form CDATA; #IMPLIED) + * (required) */ else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){ // (size NUMBER #IMPLIED) ... should be defined locally. @@ -953,6 +954,14 @@ public class HTML5AttributeCollection extends AttributeCollection implements HTM String[] names = {ATTR_NAME_FORM, ATTR_NAME_AUTOFOCUS,ATTR_NAME_NAME, ATTR_NAME_MULTIPLE, ATTR_NAME_DISABLED, ATTR_NAME_TABINDEX, ATTR_NAME_ONFOCUS, ATTR_NAME_ONBLUR, ATTR_NAME_ONCHANGE}; getDeclarations(attributes, Arrays.asList(names).iterator()); + // (required #IMPLIED) + atype = new HTMLCMDataTypeImpl(CMDataType.ENUM); + // boolean attribute must have the same value as its name. + String[] requiredValues = {ATTR_NAME_REQUIRED}; + atype.setEnumValues(requiredValues); + attr = new HTMLAttrDeclImpl(ATTR_NAME_REQUIRED, atype, CMAttributeDeclaration.OPTIONAL); + attributes.putNamedItem(ATTR_NAME_REQUIRED, attr); + } /* * (value NUMBER #IMPLIED) ... should be defined locally. -- cgit v1.2.3