Bug 15437

Summary: XPath substring-after function is broken
Product: WebKit Reporter: nanto_vi (TOYAMA Nao) <nanto>
Component: XMLAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: All   
OS: All   
URL: http://amachang.art-code.org/xpath_functional_test/
Bug Depends on:    
Bug Blocks: 15448    
Attachments:
Description Flags
proposed fix mitz: review+

Description nanto_vi (TOYAMA Nao) 2007-10-09 07:50:10 PDT
The substring-after function returns a substring begining at <length of search string>, instead of <length of search string> + <found index>.

alert(document.evaluate("substring-after('abcde', 'd')",
document, null, XPathResult.STRING_TYPE, null).stringValue);

"e" in Gecko and Opera, "bcde" in WebKit.  This is revealed in amachang's XPath test (see the URL field).
Comment 1 Alexey Proskuryakov 2007-10-09 09:31:34 PDT
Created attachment 16595 [details]
proposed fix
Comment 2 mitz 2007-10-09 09:39:03 PDT
Comment on attachment 16595 [details]
proposed fix

r=me
Comment 3 Alexey Proskuryakov 2007-10-09 12:09:37 PDT
Committed revision 26173 (feature branch).