Ticket #4425 (closed defect: fixed)
[patch][ccla] Query doesn't handle queries by ID relative to a root node properly
| Reported by: | guest | Owned by: | alex |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3 |
| Component: | Core | Version: | 0.9 |
| Severity: | normal | Keywords: | |
| Cc: | ben.schell@… |
Description (last modified by dmachi) (diff)
Lets say I have an HTML DOM element that does not belong to the current rendered page (maybe it was fetched from a remote page, or created programmatically). I then want to do some querying/parsing over this node and its children. Most operations of dojo.query (querying based on class, etc.) work properly. However, attempting to query based on id fails, as dojo.query uses dojo.byId (and therefore document.getElementById) to retrieve those elements.
If the purpose of dojo.query is to always fetch items relative to the provided root element, this is not the desired behavior. I've attached a sample test case, as well as a patch to dojo/_base/query.js which does find the appropriate element.
The source attached falls under the same CLA as Jared Jurkiewicz and Bill Keese.