Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#996 closed defect (fixed)

GetElementsByClassName() isOnly matchType does not work in xpath version

Reported by: tteulings@… Owned by: anonymous
Priority: high Milestone:
Component: Core Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

When using the xpath version of getElementsByClassName() isOnly matches -all- occurences of a search needle instead of -only- the needle. A simple fix is to also check for the length of the match and dismiss matches with different lengths than the needle.

see the nightly tests for an example (last two tests): http://archive.dojotoolkit.org/nightly/tests/test_html.html

this is patch:

397a400
> 	var srtLength = classes.join(" ").length;
404c407,412
< 			" ')]";
---
> 			" ')";
> 			if (classMatchType == 2) { 
> 				xpath += " and string-length(@class)="+srtLength+"]"; 
> 			}else{
> 				xpath += "]";
> 			} 	

Carrie has my cla.

Change History (3)

comment:1 Changed 13 years ago by dylan

Resolution: fixed
Status: newclosed

Thanks for the patch, fixed in [4443]

comment:2 Changed 13 years ago by dylan

Component: GeneralCore
Milestone: 0.4

comment:3 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.