Opened 13 years ago

Closed 12 years ago

#2422 closed defect (fixed)

Child selector fails on queries in the form 'tag#id > child' or '#id > child'

Reported by: dojotoolkit@… Owned by: alex
Priority: high Milestone: 0.9
Component: General Version:
Keywords: query DOM xpath selector Cc: dojotoolkit@…, alex
Blocked By: Blocking:

Description

Given:

<ul id="myID" class="myClass">
  <li></li>
</ul>

These work:

dojo.query('ul.myClass > li');
dojo.query('.myClass > li');

But these don't:

dojo.query('ul#myID > li');
dojo.query('#myID > li');

Attachments (1)

child_selector_patch.diff (410 bytes) - added by dojotoolkit@… 13 years ago.
Patch to query.js to make queries like this work: dojo.query('tag#id > child');

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by dojotoolkit@…

Attachment: child_selector_patch.diff added

Patch to query.js to make queries like this work: dojo.query('tag#id > child');

comment:1 Changed 13 years ago by dylan

Milestone: 0.9
Owner: changed from anonymous to alex

comment:2 Changed 12 years ago by bill

Component: DOMGeneral

comment:3 Changed 12 years ago by tk

Cc: dojotoolkit@… alex added

Alex,

Is this a valid syntax that dojo.query is intended to support? (I'm not familiar with what its supposed to support completely). If it is, and there is a CLA on file for this person, then this would be a quick close out.

If both these cases are tru (valid CLA and valid query syntax I can merge this patch when I get home)

-Karl

comment:4 Changed 12 years ago by alex

Status: newassigned

CLA not required. The patch is trivial by anyone's legal definition (although much appreciated). Merging it now.

comment:5 Changed 12 years ago by alex

Resolution: fixed
Status: assignedclosed

seems this is already fixed in trunk. The bug was deeper than the fix indicated and we just removed one (optional) layer of optimizations to make the parser more correct.

Note: See TracTickets for help on using tickets.