Closed Bug 294626 Opened 20 years ago Closed 20 years ago

Collapsed <div>s not accepted

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: sebastian, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>Demonstration</title>
    <style type="text/css">
    <!--
    #one { background: green; }
    #two { background: red;
	   float:      right;
	   height:     20em; }
    #three { clear:    both; }
    -->
    </style>
  </head>
  <body>

    <div id="one"><div id="two">Demo</div>Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo Demo
    Demo Demo Demo Demo
    <div id="three">&nbsp;</div>
    </div>
  </body>
</html>

Works as expected while 

<div id="three" />

and even 

<div id="three" /></div>

Don't

Reproducible: Always

Actual Results:  
<div id="three" />
<div id="three" /></div>

Don't Work

Expected Results:  
<div id="three" />
<div id="three" /></div>

Work
was that in a .html or .xhtml/.xml file?
Attached file Demonstation
HTML, like attached.
then this is invalid. see http://www.w3.org/TR/html/#C_3 together with
http://www.w3.org/TR/html/#5_1

(only XHTML supports the <div/> notation)
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Did you look at the source I pasted or the file I attached? It is XHTML!
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
the type is text/html, please see the links I pasted:
"5.1. Internet Media Type

XHTML Documents which follow the guidelines set forth in Appendix C, "HTML
Compatibility Guidelines" may be labeled with the Internet Media Type
"text/html" [RFC2854], as they are compatible with most HTML browsers. Those
documents, and any other document conforming to this specification, may also be
labeled with the Internet Media Type "application/xhtml+xml" as defined in
[RFC3236]. "

With:
"C.3. Element Minimization and Empty Element Content

Given an empty instance of an element whose content model is not EMPTY (for
example, an empty title or paragraph) do not use the minimized form (e.g. use
<p> </p> and not <p />)."

Also note http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/#text-html
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → INVALID
hm, your "Demonstration" attachment does not contain any <div/> elements?
Verified invalid.  The attached file is in violation of the XHTML specification.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: