Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 176747

Summary: Undefined (Custom) HTML attributes now show as warnings
Product: [WebTools] WTP Source Editing Reporter: Cherry Development <eclipse>
Component: wst.htmlAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: for.work.things, g.georgovassilis, itewksbu
Version: 1.5.3Keywords: helpwanted
Target Milestone: Future   
Hardware: All   
OS: All   
URL: http://dev.eclipse.org/newslists/news.eclipse.webtools/msg13271.html
Whiteboard:

Description Cherry Development CLA 2007-03-08 15:01:47 EST
Between 1.5.2 and 1.5.3 the behavior of the HTML editor/validator changed.  Previously, it was possible to use undefined (custom) attributes in HTML tags without triggering warnings, but as of 1.5.3, the default behavior seems to have changed and there appears to be no way to disable this behavior.
This change in behavior has particular impact on Tapestry developers that rely on the excellent WTP HTML editor, but until now have been able to write Tapestry page and component templates that validated as structurally consistent, despite the use of custom HTML attributes in the tags (jwcid, for a common example).  While I understand that the current behavior is more 'correct' in terms of being able to warn about invalid HTML, I'd like to request the ability to disable this behavior if required.
Comment 1 David Williams CLA 2007-03-08 18:25:59 EST
Please clarify and/or perhaps attach some samples. Not that I am doubting you, but at some point one thing that changed was now we also validate JSP fragments (better) and other have reported increases in warnings due to that fix. And, I believe, it does have a preference to disable fragment checking (hence restoring previous behavior). 

Let us know ... thanks. 

Comment 2 Cherry Development CLA 2007-03-08 18:36:51 EST
Sure thing.
In 1.5.2, the following HTML fragment used to verify:

<span jwcid="@Insert" value="ognl:myProperty"></span>

Now it does not.

Would the JSP fragments feature affect non-JSP files?
I'll revert back to 1.5.3, see if turning off the fragment checking fixes it, and then report back here.
Comment 3 Cherry Development CLA 2007-03-08 18:45:28 EST
Ya, so I've reverted back to 1.5.3, disabled JSP fragment checking and I am still seeing "undefined attribute name" warnings so it appears that there is some new behavior in 1.5.3 that's not directly related to the fragment checking that is causing these warnings to appear.
Comment 4 Amy Wu CLA 2007-03-08 19:04:14 EST
Actually, I believe this is due to us fixing bug 159926 / bug 143209.  We were
incorrectly saying any attribute was allowed in html tags except for jsp tags.

This bug could be used as an enhancement request for more validation
preferences.

You may also want to check out bug 157407 which is about the ability to add
more tags (or in your case, attributes) to the html content model.  That seems
more ideal because then validation/content assist/anything else that uses the
content model would then recognize and know how to handle your special
tags/attributes.

I would say till this bug or bug 157407 is fixed, your best bet is to just disable html validation via the validation preference page because you're doing something different than the html spec.
Comment 5 Amy Wu CLA 2007-03-08 19:08:57 EST
Actually, there may be another option if you use xhtml vs html.  For html files that using the html 4.01 spec, we are using our own internal content model.  But for xhtml files, we read whatever is in the xhtml dtd (just like for any other xml file).  What you could do is take the xhtml dtd and modify it/add to it to add in your special tags.  Then you can add your modified xhtml dtd entry to the XML Catalog so that your special dtd is always used instead of the official one.
Comment 6 David Williams CLA 2007-03-08 20:13:57 EST
Thanks Amy ... I should know better than rely on my memory, but glad 
you knew of the connection. 

I'm assigning to you for now, just to acknowledge the triage. 

I'm also marking as helpwanted, to acknowledge right at the moment we have 
no one or no plans to improve the preferences (correct me if I'm wrong there too :) 
and would seem an "isolated"  bit of function someone could think about contributing. 

Comment 7 Amy Wu CLA 2008-10-27 04:28:31 EDT
reassigning to inbox
Comment 8 Ian Tewksbury CLA 2010-02-01 10:35:10 EST
There is a preference in "Window -> Preferences -> Web -> HTML Files -> Validation -> Attributes" as to weather to validate undefined attribute names or not.  This I believe is exactly what this bug was looking for.  Time to close it out.
Comment 9 Nick Sandonato CLA 2010-02-16 10:51:35 EST
The preference does exist. Marking as fixed.
Comment 10 george georgovassilis CLA 2013-11-20 02:07:21 EST
The preference Nick Sandonato mentions exists, but it disables validation altogether for 'unknown' attribute names. I.e. when developing with angular.js there is a completely new set of ng-* attributes. I'd like to be able to add a schema that validates those attributes for proper use.
Comment 11 Nick Sandonato CLA 2013-11-20 09:17:43 EST
(In reply to george georgovassilis from comment #10)
> The preference Nick Sandonato mentions exists, but it disables validation
> altogether for 'unknown' attribute names. I.e. when developing with
> angular.js there is a completely new set of ng-* attributes. I'd like to be
> able to add a schema that validates those attributes for proper use.

Hi George,

Please see Bug 415980. Sounds pretty close to what you want, minus the schema.