Closed Bug 292405 Opened 19 years ago Closed 19 years ago

shorthand closed anchor element slurps in later content

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: zrockenbaugh, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3

Using a shorthand closed anchor element (e.g., "<a href="foo" />) erroneously
slurps in later content, making the a part of the link. I found this while
trying to use generated content (using CSS) to create the links and later
content would show up as part of the link. It looks like's it's generating a new
element box because if you create a :before pseudo-element in the CSS, it gets
applied to the later text as well (see http://www.zanecorp.com/bug/index4.html).

Interposing another anchor element makes things act correctly. This is
demonstrated in http://www.zanecorp.com/bug/index3.html.

Reproducible: Always

Steps to Reproduce:
Go to provided URL
Actual Results:  
Page mis-rendered.

Expected Results:  
See http://www.zanecorp.com/bug/index2.html (which uses a non-shorthand anchor
element).
The example page is being sent as text/html, so this is correct behaviour (in so
much as you aren't closing the tag). Please send the pages as an XML MIME format
if you want XML parsing to occur.
Changing the contexnt type to "application/xhtml+xml" does not fix problem; see
http://www.zanecorp.com/bug/index4.html. I have checked with both the latest
released versions of Firefox and Mozilla; both mis-render the page and report
the content type as application/xhtml+xml.
That file is still being sent as text/html and Gecko (Moz/FF) are still treating
it as HTML only.

Do not forget that <meta> tags are trumped by HTTP headers, and since we have an
HTTP Content-Type header of text/html (to be precice, it is sending
"Content-Type: text/html; charset=ISO-8859-1")...
"View Selection Source" can be used to see what the parser is creating.  In this
case the input of:

<a href="http://www.mozilla.org" />
<div>Foo</div>

becomes:
<a href="http://www.mozilla.org">
</a><div><a href="http://www.mozilla.org">Foo</a></div>

(residual-style here is reopening the anchor tag because the <div> cannot be nested)

This is correct behavior.  Marking invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.