Closed Bug 566550 Opened 10 years ago Closed 10 years ago
Acc Utils::Text Length unsigned
Defined as a function prototype in: * content/base/public/nsIContent.h o line 499 -- virtual PRUint32 TextLength() = 0; * content/base/src/nsGenericDOMDataNode.h o line 214 -- virtual PRUint32 TextLength(); * content/base/src/nsGenericElement.h o line 410 -- virtual PRUint32 TextLength(); * accessible/src/base/nsAccUtils.h o line 343 -- static PRInt32 TextLength(nsIAccessible *aAccessible);
the code pretends to use -1 as an error case, however it doesn't look like callers like nsHyperTextAccessible::GetPosAndText are particularly careful about handling that.
(In reply to comment #1) > the code pretends to use -1 as an error case, however it doesn't look like > callers like nsHyperTextAccessible::GetPosAndText are particularly careful > about handling that. Looks so. I think it's ok if TextLength() should return 0 and assert when failure is happen.
1) make TextLength() return unsigned int 2) make TextLength() to take nsAccessible*
Comment on attachment 446951 [details] [diff] [review] patch r=me. This looks nice, esp since it gets rid of some extra code.
Attachment #446951 - Flags: review?(marco.zehe) → review+
landed on 1.9.3 - http://hg.mozilla.org/mozilla-central/rev/1817cd496b3b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.