[webkit-reviews] review granted: [Bug 58304] REGRESSION: WK2: misspelled AX attributes no longer returned from text fields : [Attachment 89169] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 12 01:44:25 PDT 2011


mitz at webkit.org has granted chris fleizach <cfleizach at apple.com>'s request for
review:
Bug 58304: REGRESSION: WK2: misspelled AX attributes no longer returned from
text fields
https://bugs.webkit.org/show_bug.cgi?id=58304

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

------- Additional Comments from mitz at webkit.org
View in context: https://bugs.webkit.org/attachment.cgi?id=89169&action=review

> Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm:491
> +    unsigned size = results.size();
> +    for (unsigned i = 0; i < size; i++) {

Please use size_t for a Vector’s size and the loop variable.

> Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm:492
> +	   const TextCheckingResult* result = &results[i];

A more natural way to do this in C++ would be
    const TextCheckingResult& result = results[i];

> Source/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm:493
> +	   AXAttributeStringSetNumber(attrString,
NSAccessibilityMisspelledTextAttribute, [NSNumber numberWithBool:YES],
NSMakeRange(result->location + range.location, result->length));

Allocating and autoreleasing an NSNumber each time through the loop is not so
great, but no worse than what the old code did.


More information about the webkit-reviews mailing list