|
|
|
|
Re: BUG: HTML5 select does have required attribute [message #1061938 is a reply to message #1061854] |
Wed, 05 June 2013 02:09 |
Toshihiro Izumi Messages: 360 Registered: July 2009 Location: Japan |
Senior Member |
|
|
If you had looked Bug 408164 Wrong warning for HTML5 input type: Undefined attribute value (url/color/week), you could understand it is a bug of WTP(wst.html). Not of PDT, Not of PTI.
The bug is...
org.eclipse.wst.html.core.internal.contentmodel.HTML5AttributeCollection.createAttributeDeclarations(String, CMNamedNodeMapImpl)
The code section for SELECT tag(line 947- @org.eclipse.wst.html.core_1.1.602.v201301032305) has no code for the "required" attribute.
So, my ad hoc solution is...
>else if (elementName.equals(HTML40Namespace.ElementName.SELECT)){
> // (size NUMBER #IMPLIED) ... should be defined locally.
> HTMLCMDataTypeImpl atype = new HTMLCMDataTypeImpl(CMDataType.NUMBER);
> HTMLAttrDeclImpl attr = new HTMLAttrDeclImpl(ATTR_NAME_SIZE, atype, CMAttributeDeclaration.OPTIONAL);
> attributes.putNamedItem(ATTR_NAME_SIZE, attr);
>
// (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);
>
> 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());
>}
|
|
|
|
Powered by
FUDForum. Page generated in 0.01922 seconds