Short tags for <b/> (in XHTML as text/html) cause <b>...</b> around all #text elements

RESOLVED DUPLICATE of bug 162653

Status

()

RESOLVED DUPLICATE of bug 162653
13 years ago
12 years ago

People

(Reporter: stephan.hauser, Assigned: mrbkap)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

When I have a short <b/>-tag (by short I mean a tag without end tag), the resulting DOM will have a <b> tag around every #text-Node. There also seems to be a memory leak related to that, as my firefox consumed 1GB of ram witch it didn't free after opening such a document.
The document passes XHTML validation.

Reproducible: Always

Steps to Reproduce:
1. Open the attached XHTML-file
2. Open DOM Inspector and have a look at a #text-node
(Reporter)

Comment 1

13 years ago
Created attachment 223903 [details]
HTML test case for this bug

Comment 2

13 years ago
Created attachment 223906 [details]
same thing with xmlns and as application/xhtml+xml

Comment 3

13 years ago
Invalid.  If you send the page as text/html, it goes through the HTML parser.  HTML does not have XML-style short tags, so <b/> is the same as <b>.

The "extra" <b> elements you see in DOM Inspector are the result of a feature that makes block-in-inline tag soup content work (I think the feature is called "residual style").

If you actually make the page XHTML (which requires giving the root an xmlns and sending it as application/xhtml+xml), it works correctly.

I think some browsers do support XML-style shorttags in text/html (Safari?), but I don't think we plan to.  See bug 169592 or bug 268477.

The excess memory consumption you saw was probably a result of residual style blowup: when the parser is halfway through a document with a bunch of unclosed inline style tags, each block tag results in a lot of nodes being created.  I think this is N^2 but it might be exponential.  If it actually leaks, or if it's exponential and you think it should be N^2, that's a bug you should file separately.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
Summary: Short tags for <b/> cause <b>...</b> around all #text elements → Short tags for <b/> (in XHTML as text/html) cause <b>...</b> around all #text elements

Comment 4

13 years ago
There was some related discussion in bug 94284, but I don't know where the decision was made to not support XML-style short tags in text/html.
Duplicate of this bug: 371022

Updated

12 years ago
Resolution: INVALID → DUPLICATE
Duplicate of bug: 162653
You need to log in before you can comment on or make changes to this bug.