Closed Bug 451181 Opened 16 years ago Closed 14 years ago

an unknown close tag will close any open unknown element

Categories

(Core :: DOM: HTML Parser, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: twic, Unassigned)

Details

(Whiteboard: [fixed by the HTML5 parser])

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071616 CentOS/3.0.1-1.el5.centos Firefox/3.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071616 CentOS/3.0.1-1.el5.centos Firefox/3.0.1

This:

<p>This is <foo>a foo element with a spurious </bar> bar close tag</foo>.</p>

Gets parsed as if it was:

<p>This is <foo>a foo element with a spurious </foo> bar close tag.</p>

Where foo and bar are any unknown, ie not actually HTML, tags. That is, the </bar> closes the <foo>. This doesn't happen if one or both of the tags are known HTML tags.

I appreciate that correct handling of input which is (a) incorrect, (b) not HTML is not a high priority for an HTML parser, but this behaviour strikes me as wrong. Also, it's screwing up some stuff we're trying to do where we use magic (unknown) tags to organise tests in our pages. Somewhat - we don't intentionally generate spurious close tags like that, but when they do slip in, this behaviour makes them a bit of a headache to track down.


Reproducible: Always

Steps to Reproduce:
1. Open the attached HTML document
2. Activate Firebug (or similar)
3. Inspect the element whose text starts at "a foo element"
4. See where the element ends
Actual Results:  
It ends with the text "with a spurious ".

Expected Results:  
it should end with the text "bar close tag".
Component: General → HTML: Parser
Product: Firefox → Core
QA Contact: general → parser
Confirmed with
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20061201 Firefox/2.0.0.16 (Ubuntu-feisty)
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [fixed by the HTML5 parser]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: