Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10010 (new defect)

Opened 7 months ago

[PATCH] Selector.pseudos.nth() will miss family nodes

Reported by: kuriyama Assigned to: sam
Priority: low Milestone: 2.x
Component: Prototype Version: edge
Severity: minor Keywords:
Cc:

Description

On IE (non-XPath version of Selector class), pseudo class like :nth-child() cannot be matched against family (parent and child) elements.

This problem is around h.index() in nth() function. Doing h.index() will be skipped when parentNode._counted is true. But with family (parent and child) elements are target of the selector (like as <div><div></div></div>), both are marked by h.mark(nodes), so when checking parentNode._counted of inner <div>, it will be skipped for indexing.

I'm not sure why this "if (!node.parentNode._counted)" check is exist. But removing this check will solve this problem.

Attachments

selector-nth.diff.txt (1.4 kB) - added by kuriyama on 10/28/07 12:50:21.
Patch for selector.js and test
selector-nth.diff (1.6 kB) - added by jdalton on 04/01/08 17:41:00.
in diff form

Change History

10/28/07 12:50:21 changed by kuriyama

  • attachment selector-nth.diff.txt added.

Patch for selector.js and test

04/01/08 17:41:00 changed by jdalton

  • attachment selector-nth.diff added.

in diff form