Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » BUG: HTML5 select does have required attribute
BUG: HTML5 select does have required attribute [message #1061545] Sun, 02 June 2013 16:58 Go to next message
Lucas Malor
Messages: 12
Registered: May 2013
Junior Member
As title:

www.w3.org/wiki/HTML/Elements/select#HTML_Attributes

On the contrary Eclipse shows me a warning (undefined attribute "required").

I have Eclipse Juno + PDT 3.1.2 + PTI 1.6.0

[Updated on: Wed, 05 June 2013 08:02]

Report message to a moderator

Re: BUG: HTML5 select does have required attribute [message #1061809 is a reply to message #1061545] Tue, 04 June 2013 08:04 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 347
Registered: July 2009
Location: Japan
Senior Member
It is better to submit a new bug report like Bug 408164 Wrong warning for HTML5 input type: Undefined attribute value (url/color/week).
Re: BUG: HTML5 select does have required attribute [message #1061826 is a reply to message #1061809] Tue, 04 June 2013 09:42 Go to previous messageGo to next message
Lucas Malor
Messages: 12
Registered: May 2013
Junior Member
Thank you, I'll do that.
Re: BUG: HTML5 select does have required attribute [message #1061854 is a reply to message #1061826] Tue, 04 June 2013 11:39 Go to previous messageGo to next message
Lucas Malor
Messages: 12
Registered: May 2013
Junior Member
Excuse me, since my Eclipse messed up I reinstalled it and I notice that there's no warning now. I think it was not a PDT bug but a PTI bug (that I'll not reinstall...)
Re: BUG: HTML5 select does have required attribute [message #1061938 is a reply to message #1061854] Wed, 05 June 2013 02:09 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 347
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());
>}

Re: BUG: HTML5 select does have required attribute [message #1061962 is a reply to message #1061938] Wed, 05 June 2013 07:30 Go to previous message
Lucas Malor
Messages: 12
Registered: May 2013
Junior Member
Well, I didn't know that PTI uses another package to do validations. I thought it uses CodeSniffer. If you're sure this bug belongs to WTP change the bug product. Anyway in your code I read `HTML40Namespace`, this bug happens with HTML 5.
Previous Topic:get binding from ASTParser
Next Topic:'Animation Start' has encountered a problem (on launch)
Goto Forum:
  


Current Time: Fri Sep 19 07:54:06 GMT 2014

Powered by FUDForum. Page generated in 0.01662 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software