Closed Bug 566550 Opened 14 years ago Closed 14 years ago

make nsAccUtils::TextLength unsigned

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: surkov)

References

(Blocks 1 open bug, )

Details

Attachments

(1 file)

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.
Blocks: cleana11y
Attached patch patchSplinter Review
1) make TextLength() return unsigned int
2) make TextLength() to take nsAccessible*
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #446951 - Flags: review?(marco.zehe)
Attachment #446951 - Flags: review?(bolterbugz)
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: 14 years ago
Resolution: --- → FIXED
Attachment #446951 - Flags: review?(bolterbugz)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: