Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316551 - [parser] Is HTML DOM correctly treating implicitly-closed tags?
Summary: [parser] Is HTML DOM correctly treating implicitly-closed tags?
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.html (show other bugs)
Version: 3.0.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.5 P   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 18:49 EDT by Nick Sandonato CLA
Modified: 2010-07-09 17:09 EDT (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
patch (4.35 KB, patch)
2010-06-10 19:01 EDT, Nick Sandonato CLA
no flags Details | Diff
patch (6.33 KB, patch)
2010-06-14 11:42 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Sandonato CLA 2010-06-10 18:49:03 EDT
+++ This bug was initially created as a clone of Bug #308412 for the purposes of backporting to 3.0.5p +++

Take the following HTML source:

<ul>
    <li>Item 1
    <li>Item 2
    <li>Item 3
</ul>

and this:

<ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>

In WTP, the DOM is constructed with the subsequent elements of the unterminated li elements as descendents.

Both IE and Firefox construct the same DOM for both chunks of source, that is, the li elements are siblings.

W3C documents (e.g. http://www.w3.org/MarkUp/html3/HTMLandSGML.html) state that some tags are implicitly terminated based on their position. The li tag is one such tag.

Should the WTP DOM take implicitly-closed tags into consideration? Is the current WTP DOM correct?
Comment 1 Nick Sandonato CLA 2010-06-10 19:01:07 EDT
Created attachment 171678 [details]
patch

Patch that will allow for elements with omissible end tags.
Comment 2 Nitin Dahyabhai CLA 2010-06-13 21:14:43 EDT
Nick, the addition of a method to an existing interface needs a great amount of care.  Could you also ensure that the o.e.w.html.core requires at least this version of o.e.w.xml.core?
Comment 3 Nick Sandonato CLA 2010-06-14 11:42:44 EDT
Created attachment 171843 [details]
patch

Updated the patch. Instead of adding a new method to the interface, I wrote an extension. I also updated the min version for o.e.w.html.core's dependency on o.e.w.xml.core to 1.1.312.
Comment 4 Carl Anderson CLA 2010-07-09 17:09:13 EDT
Committed to R3_0_5_patches
Comment 5 Carl Anderson CLA 2010-07-09 17:09:27 EDT
Committed to R3_0_5_patches