Closing XHTML Tags Rendered Differently

RESOLVED DUPLICATE of bug 154887

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 154887
13 years ago
13 years ago

People

(Reporter: Tony, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

748 bytes, application/xhtml+xml
Details
(Reporter)

Description

13 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

I am not 100% sure this is a bug but it seems so very weird. I categorized it 
under "General" because there was no available entry for "Rendering Engine".

The basic problem is that an empty XHTML <div> tag is rendered in different 
ways depending on whether or not the "shorthand" method for closing an XHTML 
element is used. Specifically, look at these three empty elements:

<div class='separatorBar'></div>
<div class='separatorBar'/>
<div class='separatorBar' />

All three should, by my understanding, render exactly the same way, but they 
don't. XML allows <div></div> to be written as <div/>, right? There shouldbe 
no differnce.

Here is the full XHTML document. Please render this. I think you will see many 
differences. All three <div> elements *should*, I think, produce exactly the 
same output.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-
strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head><title>Absolute Java</title>
    <meta http-equiv="Content-type" content='text/html; charset="utf-8"' />
    <style type='text/css'>
      div.separatorBar {
        margin-left:-10px;
        margin-right: -10px;
        border:solid;
        width:5px;
        color: green;
      }
    </style>

  </head>

  <body>
    <h2>Testing...</h2>
    <p>hello #1</p>
    <div class='separatorBar'></div><p>111111</p>
    <p>hello #2</p>
    <div class='separatorBar/'><p>222222</p>
    <p>hello #3</p>
    <div class='separatorBar' /><p>333333</p>
  </body>
</html>


Reproducible: Always



Expected Results:  
All three <div> elements should have rendered the same.

Comment 1

13 years ago
Created attachment 183546 [details]
Testcase from comment 0

> I am not 100% sure this is a bug but it seems so very weird. I categorized it

> under "General" because there was no available entry for "Rendering Engine".

When you file a bug about webpage display, file it under the "Core" product.

Comment 2

13 years ago
You need to serve the pages as application/xhtml+xml for that to work, i assume
you have text/html now

*** This bug has been marked as a duplicate of 154887 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE

Comment 3

13 years ago
http://www.mozilla.org/docs/web-developer/faq.html#xhtmldiff
You need to log in before you can comment on or make changes to this bug.