Bug 58304

Summary: REGRESSION: WK2: misspelled AX attributes no longer returned from text fields
Product: WebKit Reporter: chris fleizach <cfleizach>
Component: AccessibilityAssignee: chris fleizach <cfleizach>
Status: RESOLVED FIXED    
Severity: Normal Keywords: InRadar
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch mitz: review+

Description chris fleizach 2011-04-12 01:16:47 PDT
When typing in to an edit field,VoiceOver does not announce the presence of a mis-spelled word with the announcement "mis-spelled" followed by the mis-spelled word.
Comment 1 chris fleizach 2011-04-12 01:16:58 PDT
rdar://9258679
Comment 2 chris fleizach 2011-04-12 01:36:01 PDT
Created attachment 89169 [details]
patch
Comment 3 mitz 2011-04-12 01:44:25 PDT
Comment on attachment 89169 [details]
patch

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.
Comment 4 chris fleizach 2011-04-12 08:46:45 PDT
http://trac.webkit.org/changeset/83589
Comment 5 chris fleizach 2011-04-12 10:14:43 PDT
broke leopard mac because checkParagraph is not available there
Comment 6 chris fleizach 2011-04-12 10:14:50 PDT
will fix now
Comment 7 chris fleizach 2011-04-12 10:47:26 PDT
http://trac.webkit.org/changeset/83609 to fix the leopard build