When IAText::TextBeforeOffset is called with invalid offset parameters (for example the text "test" with an offset of 0), Firefox returns wrong values. According to Pete Brunet and the IA2 meeting attendees: The return code should be S_FALSE, both out offsets 0, and the out string NULL. Pete's result is: textBeforeOffset using "test" and offset 0: start offset = 0, end offset = 1,617,404,570 , string is "test". Note: I get various large numbers for the end offset. The other methods are fine.
Marco, our bug is we should return 0 and 0 for offsets?
Yes, 0 and 0 for offsets, and NULL for the string. Currently, if we get the string "test", an offset of 0 into textBefore, we return the string "test", a starting offset of 0, and an arbitrary number for endoffset. The other methods are fine.
Created attachment 321019 [details] mochitest based test Marco, please look at mochitest-based test. For every constant and aOffset = 0 I always get 0, 1 and 't'. Can you modify it to reproduce the bug?
Pete, what type of BoundaryType are you passing into the call to get_TextBefore?
I used 1 for WORD. Alexander might have been using 0 for CHAR.
9 years ago