Bug 58304 - REGRESSION: WK2: misspelled AX attributes no longer returned from text fields
Summary: REGRESSION: WK2: misspelled AX attributes no longer returned from text fields
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-04-12 01:16 PDT by chris fleizach
Modified: 2011-04-12 10:47 PDT (History)
0 users

See Also:


Attachments
patch (2.92 KB, patch)
2011-04-12 01:36 PDT, chris fleizach
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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