summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalvador Zalapa2013-07-25 11:22:40 (EDT)
committerNick Sandonato2013-07-31 11:30:50 (EDT)
commit9aa0acee7ce6862035abaca29666c0bc2839384a (patch)
tree8f57f34e066119eafd3c9f8d7ed9d6f20d5d1ada
parent8cce945dae45574c06b5dbaf90d6c87796db413c (diff)
downloadwebtools.sourceediting-9aa0acee7ce6862035abaca29666c0bc2839384a.zip
webtools.sourceediting-9aa0acee7ce6862035abaca29666c0bc2839384a.tar.gz
webtools.sourceediting-9aa0acee7ce6862035abaca29666c0bc2839384a.tar.bz2
Bug 409827: Wrong warning for HTML 5 'required' attribute for 'select' tagv201307311532
Signed-off-by: Salvador Zalapa <zalapa@mx1.ibm.com>
-rw-r--r--bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/HTML5AttributeCollection.java9
1 files changed, 9 insertions, 0 deletions
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 e42c300..378c3da 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.