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

Bug 512658

Summary: [html][lint] Mark self closed tags if they are not void elements
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: JS ToolsAssignee: Curtis Windatt <Curtis_Windatt>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: steve_northover
Version: 13.0   
Target Milestone: 15.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Curtis Windatt CLA 2017-02-23 12:43:08 EST
HTML4 does not consider self closing tags valid, and void tags (require no content) should omit them.  HTML parser 2 treats self closed tags as having no end range, resulting in the validator marking them as 'No matching close tag'.

For example: <span/>

We should recognize when a tag has been incorrectly self closed and provide a more helpful message.
Comment 1 Steve Northover CLA 2017-03-29 16:48:34 EDT
Is this saying that we don't support self closing tags?  IF so, this seems really bad.
Comment 2 Curtis Windatt CLA 2017-03-30 11:05:46 EDT
(In reply to Steve Northover from comment #1)
> Is this saying that we don't support self closing tags?  IF so, this seems
> really bad.

We mark self closed tags with an info annotation "No matching close tag for <x>".  This bug was to improve the message, but we could consider not marking the problem at all. It is wrong to self close tags in HTML4, but all the browsers handle it.
Comment 3 Steve Northover CLA 2017-03-30 11:11:18 EDT
Self closing tags are here to stay.  We should not complain.
Comment 4 Steve Northover CLA 2017-03-30 12:01:39 EDT
If easy, can you fix.  If not just leave as P3.  Thanks.