Closed Bug 291925 Opened 20 years ago Closed 20 years ago

javascript implementation ignores nill closed elements like <div/>

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED INVALID

People

(Reporter: christian, Unassigned)

References

()

Details

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

When you write html like this: <div id='element1'/><div id='element2'/> and fill
both, element1 and element2 using innerHTML property the element2 div tag is not
found because rewriting the content i assign to element1 fills the whole
remaining page from its beginning to the and. I guess either the DOM parser or
JavaScript engine is not aware of nillable elements and searches for a closing
tag (which isn´t there). See the code on the example page for an example.

Reproducible: Always

Steps to Reproduce:
1. Copy code from example link to file
2. Open file in mozilla
3. See it
4. Replace <div.../> by <div...></div>
5. See how it should be

Actual Results:  
It works by making closing tag instead of <div/> notation.

Expected Results:  
It should only place content where the <div/> element is and not replace the
whole remaining page.
Your example is not compliant with Appendix C of XHTML 1. INVALID.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Hi,

do you mean the rule statet on http://www.w3.org/TR/xhtml1/#C_3 saying to use
<p> </p> instaead <p /> for legacy support?

Or do you mean http://www.w3.org/TR/xhtml1/#C_3, which tells me to put
whitespace in tag like <br /> instead of <br/>?

Anyway. The first rule makes clear that what i did was invalid so i agree to
what you wrote.

Best regards.
Christian
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.