Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#16678 closed defect (fixed)

Dojo Selector Engine lite.js fails to find #id when root document is set

Reported by: chris2m Owned by: Kris Zyp
Priority: undecided Milestone: 1.9
Component: Query Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

The lite query engine in dojo fails to retrieve simple "#id" queries when the root node is in a different frame than dojo. This is because lite.js uses a "fast path" and ignores the root document in line 36:

var found = dojo.byId ? dojo.byId(match[2]) : doc.getElementById(match[2]);

should be

var found = dojo.byId ? dojo.byId(match[2], root) : root.getElementById(match[2]);

Best, Chris

Change History (3)

comment:1 Changed 6 years ago by chris2m

or rather: var found = dojo.byId ? dojo.byId(match[2], doc) : doc.getElementById(match[2]);

comment:2 Changed 6 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

In [30874]:

Properly lookup by id using the current document, fixes #16678 !strict

comment:3 Changed 6 years ago by Kris Zyp

Milestone: tbd1.9
Note: See TracTickets for help on using tickets.