Closed Bug 420366 Opened 17 years ago Closed 17 years ago

document.getElementById returns null for <link> elements in an SVG document

Categories

(Core :: SVG, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b3) Gecko/2008020511 Firefox/3.0b3 Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b3) Gecko/2008020511 Firefox/3.0b3 In an SVG document with a <link> element with an id attribute, document.getElementById fails to return the element. Reproducible: Always Steps to Reproduce: 1. Load the test page. Actual Results: In the first alert message: document.getElementById("foo") = null Even though: alert('document.getElementsByTagName("link").item(0).getAttribute("id") = foo Expected Results: document.getElementById("foo") should return the <link id="foo">
I don't think this is valid. <link> is not a valid SVG element so per http://developer.mozilla.org/en/docs/DOM:document.getElementById#Notes its id attribute is not of type ID and is therefore not matched.
Ah, my mistake. I'm still learning SVG.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: