This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
It is odd if getElementById can't be used reliably in a disconnected subtree to find element by id. Based on testing querySelector seems to have similar oddity, but we don't need to copy its behavior here, IMO.
SVGSVGElement.getElementById does _not_ consider the element itself. Do we really want to break compat there?
A possibility is to add an optional boolean argument, defaulting false, for whether to include the root, I guess...
None of the getElement* methods behave this way. Ask web developers, they'll expect it to search among the descendants, not inclusive descendants.
http://www.w3.org/TR/SVG/struct.html#__svg__SVGSVGElement__getElementById is vague, but implementations indeed don't include the root element of a subtree. So, I guess we need to live with that oddity, and perhaps add the boolean param later if needed.
We only "expect" it to because we've been bit by it and learned its weird behavior. That doesn't mean it's how we *want* it to behave. This can't be changed now, of course, but I definitely recall being annoyed at querySelector not matching the top element, and having to manually matchSelector it separately. I don't know if it's worth adding a parameter, though (if so, it should be a dictionary parameter and not a bare boolean). (If we add a function to search up the tree, eg. "find the nearest container that matches a selector", it absolutely needs to check the initial node, though.)