Summary: | XPath substring function does not correctly handle non-positive values for the position argument | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Steve Block <steveblock> | ||||
Component: | XML | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ap, benm, steveblock | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Steve Block
2010-07-08 15:36:20 PDT
Yes, substring("12345", -1) should return "12345". This is not only about negative numbers -substring("12345", 0) is also wrong for the same reason. > Yes, substring("12345", -1) should return "12345". This is not only about
> negative numbers -substring("12345", 0) is also wrong for the same reason.
Yes, I meant non-positive numbers. Patch coming soon.
Created attachment 61054 [details]
Patch
Comment on attachment 61054 [details] Patch > + we reset the position to 1. This matches the current behaviour when a length > + argument is supplied. This fix is not really about consistency - there is a rigorous spec, and we now match it. Does the new test pass in Firefox? r=me > This fix is not really about consistency - there is a rigorous spec, and we > now match it. OK, have updated the bug title and will land with an updated description > Does the new test pass in Firefox? Yes Committed r63066: <http://trac.webkit.org/changeset/63066> |