[webkit-reviews] review granted: [Bug 85081] accessibility/misspelled-attributed-string.html test sometimes throws exceptions : [Attachment 139230] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 27 18:07:26 PDT 2012


Darin Adler <darin at apple.com> has granted chris fleizach
<cfleizach at apple.com>'s request for review:
Bug 85081: accessibility/misspelled-attributed-string.html test sometimes
throws exceptions
https://bugs.webkit.org/show_bug.cgi?id=85081

Attachment 139230: patch
https://bugs.webkit.org/attachment.cgi?id=139230&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
If the ranges can be “wrong” then we might want to do a more complete test than
just testing is the end of the range is past the end of the string. For
example, if a location is large, then adding the length to it might overflow,
so NSMaxRange could be less than the string length. To handle that case too,
we'd also want to check if the location is > [attString length]. A good way to
do that would be a helper function named isValidRange or something like that.

But if the type of wrong ranges we are getting are guaranteed to not have any
overflow, then this patch might be OK.

However, I think a “why” comment explaining the reason for these checks would
be good.


More information about the webkit-reviews mailing list