Closed Bug 155233 Opened 23 years ago Closed 23 years ago

Can't attach a src-attribute to dynamic created image-element when XHTML is served as xml or xhtml+xml -- the image is not displayed

Categories

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

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: sparfeld, Assigned: jst)

Details

(Keywords: testcase)

Attachments

(3 files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/0 BuildID: 20020701 When you create an image with j = document.createElement("img"); and try to attach an src-atribute to that Element with j.setAttribute("src","[url]") the image is not displayed when the page is served as xhtml or xml. If ist is served as html the imga is displayed. Reproducible: Always Steps to Reproduce: 1. simply compare the XHTML document served as html with the one which is saved as xhtml or xml Actual Results: An dynamic generated image-element is not displayed. Expected Results: An dynamic generated image-element should be displayed.
Summary: Can't attach a src-attribute to dynamic created image-element when XHTML is served as xml → Can't attach a src-attribute to dynamic created image-element when XHTML is served as xml -- the image is not displayed
Attachment #89815 - Attachment description: dynamic generated image → testcase -- dynamic generated image
Attachment #89816 - Attachment description: same as the html-file but served as xml → testcase -- same as the html-file but served as xml
confirm with rv:1.0.0 Gecko/20020628 on win2k OS -> All
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Probably a duplicate of bug 22820.
Keywords: testcase
Since you're serving the data as text/xml mozilla will, and should, create an XML document for you, and calling createElement('img') on an XML document will just create a vanilla XML element for you, and the 'src' attribute doesn't mean anything to a vanilla XML element. To make your code work when served as XML you must call createElementNS('http://www.w3.org/1999/xhtml/', 'img') to create an HTML (or XHTML, really) img tag that will actually load the image off the network. INVALID.
Status: NEW → RESOLVED
Closed: 23 years ago
OS: All → Linux
Resolution: --- → INVALID
How about serving it as application/xhtml+xml? Then mozilla should create an HTML element, is that right? I just refer to http://bugzilla.mozilla.org/show_bug.cgi?id=111514#c32
Summary: Can't attach a src-attribute to dynamic created image-element when XHTML is served as xml -- the image is not displayed → Can't attach a src-attribute to dynamic created image-element when XHTML is served as xml or xhtml+xml -- the image is not displayed
Yep, when served as application/xhtml+xml your testcase should work, but it doesn't currently work due to bug 111514.
QA Contact: desale → stummala
marking verified
Status: RESOLVED → VERIFIED
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: