Closed Bug 472793 Opened 16 years ago Closed 16 years ago

Javascript new Image() and createElement("img") generate invalid XHTML with appendChild().

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 251695

People

(Reporter: jaycarlson, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 Both these functions generate image tags that are improperly closed (<img src="whatever.jpg"> vs the correct way: <img src="whatever.jpg" /> At first I thought it was a problem with the javascript framework I was using, but even when I interact with the DOM tree using standard methods, I can't seem to get valid XHTML markup. I don't know of any workarounds (that are legitimate). Reproducible: Always Steps to Reproduce: 1. Load web page 2. Click the link. 3. Examine the DOM afterward. (I've used FireBug and HTML Validator extensions and they show identical source) Actual Results: <img src="images/header_main.png"> Expected Results: <img src="images/header_main.png"/>
that page is text/html, and thus, not XHTML.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Component: General → DOM
OS: Windows Vista → All
Product: Firefox → Core
QA Contact: general → general
Hardware: x86 → All
Resolution: --- → INVALID
It has a valid XHTML DOCTYPE... shouldn't javascript render all elements as valid XHTML?
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
See bug 199165 for why Firefox detects XHTMLness based on mime type rather than sniffing.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.