Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#996 closed defect (fixed)

GetElementsByClassName() isOnly matchType does not work in xpath version

Reported by: [email protected] Owned by: anonymous
Priority: high Milestone:
Component: Core Version: 0.3
Keywords: Cc:
Blocked By: Blocking:


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):

this is patch:

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

Carrie has my cla.

Change History (3)

comment:1 Changed 16 years ago by dylan

Resolution: fixed
Status: newclosed

Thanks for the patch, fixed in [4443]

comment:2 Changed 16 years ago by dylan

Component: GeneralCore
Milestone: 0.4

comment:3 Changed 15 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.