Changeset 83049 in webkit


Ignore:
Timestamp:
Apr 6, 2011 7:57:21 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-06 Jia Pu <jpu@apple.com>

Reviewed by Darin Adler.

[Mac] When autocorrection occurs without showing correction panel, WebCore need to post accessibility notification.
https://bugs.webkit.org/show_bug.cgi?id=57800
<rdar://problem/9218223>

Defined a new accessibility notification type, AXAutocorrectionOccured. Editor::markAllMisspellingsAndBadGrammarInRanges()
now posts said notification when any autocorrection or text replacement (e.g. replacing "(c)" with copyright mark) takes place.

  • accessibility/AXObjectCache.h:
  • accessibility/chromium/AXObjectCacheChromium.cpp: (WebCore::AXObjectCache::postPlatformNotification):
  • accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification):
  • editing/Editor.cpp: (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83048 r83049  
     12011-04-06  Jia Pu  <jpu@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        [Mac] When autocorrection occurs without showing correction panel, WebCore need to post accessibility notification.
     6        https://bugs.webkit.org/show_bug.cgi?id=57800
     7        <rdar://problem/9218223>
     8
     9        Defined a new accessibility notification type, AXAutocorrectionOccured. Editor::markAllMisspellingsAndBadGrammarInRanges()
     10        now posts said notification when any autocorrection or text replacement (e.g. replacing "(c)" with copyright mark) takes place.
     11
     12        * accessibility/AXObjectCache.h:
     13        * accessibility/chromium/AXObjectCacheChromium.cpp:
     14        (WebCore::AXObjectCache::postPlatformNotification):
     15        * accessibility/mac/AXObjectCacheMac.mm:
     16        (WebCore::AXObjectCache::postPlatformNotification):
     17        * editing/Editor.cpp:
     18        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
     19
    1202011-04-06  Martin Robinson  <mrobinson@igalia.com>
    221
  • trunk/Source/WebCore/accessibility/AXObjectCache.h

    r81274 r83049  
    119119    enum AXNotification {
    120120        AXActiveDescendantChanged,
     121        AXAutocorrectionOccured,
    121122        AXCheckedStateChanged,
    122123        AXChildrenChanged,
  • trunk/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp

    r73983 r83049  
    7777        handleFocusedUIElementChanged(0, obj->document()->focusedNode()->renderer());
    7878        break;
     79    case AXAutocorrectionOccured:
    7980    case AXCheckedStateChanged:
    8081    case AXChildrenChanged:
  • trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

    r78241 r83049  
    7171                macNotification = NSAccessibilityFocusedUIElementChangedNotification;               
    7272            break;
     73        case AXAutocorrectionOccured:
     74#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     75            macNotification = @"AXAutocorrectionOccurred";
     76            break;
     77#else
     78            return;
     79#endif
    7380        case AXFocusedUIElementChanged:
    7481            macNotification = NSAccessibilityFocusedUIElementChangedNotification;
  • trunk/Source/WebCore/editing/Editor.cpp

    r82952 r83049  
    23862386
    23872387                bool useSpellingCorrectionCommand = false;
    2388 #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     2388#if SUPPORT_AUTOCORRECTION_PANEL
    23892389                if (result->type == TextCheckingTypeCorrection)
    23902390                    useSpellingCorrectionCommand = true;
     
    23952395                    m_frame->selection()->setSelection(selectionToReplace);
    23962396                    replaceSelectionWithText(result->replacement, false, false);
     2397                }
     2398
     2399                if (AXObjectCache::accessibilityEnabled()) {
     2400                    if (Element* root = m_frame->selection()->selection().rootEditableElement())
     2401                        m_frame->document()->axObjectCache()->postNotification(root->renderer(), AXObjectCache::AXAutocorrectionOccured, true);
    23972402                }
    23982403
Note: See TracChangeset for help on using the changeset viewer.