innerHTML does not close certain elements when using minimized tag syntax

RESOLVED DUPLICATE of bug 162653

Status

()

Core
DOM: Core & HTML
RESOLVED DUPLICATE of bug 162653
8 years ago
7 years ago

People

(Reporter: Danny Moules, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)

When setting innerHTML with a DIV element closed using minimized tag syntax, the element is not closed but it treated as an opening tag. This behaviour is apparent in XHTML 1.1 delivered as text/html.

Reproducible: Always

Steps to Reproduce:
1. Visit attached page
2. View modified code using an extension such as Firebug
Actual Results:  
DIV element is not closed resulting in:

<div><p>Stuff outside div</p>

Expected Results:  
DIV element is closed:

<div></div><p>Stuff outside div</p>

text/html delivery is required due to dependence on the code in question working with Google Maps. Other scenarios have not yet been tested.

Does not affect certain elements (eg. BR).

Workaround is simply to close tag the alternative (non-XML) way. Filed as 'Normal' severity in light of the relative ease with which this bug could be triggered and the fact that the XHTML 1.0 specification recommends the use of minimized tag syntax over the alternative syntax.
(Reporter)

Comment 1

8 years ago
Created attachment 415368 [details]
Test case,

Comment 2

7 years ago
innerHTML in a text/html document behaves like any other parsing that happens in a text/html document.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
OS: Windows XP → All
Resolution: --- → DUPLICATE
Duplicate of bug: 162653
You need to log in before you can comment on or make changes to this bug.