OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 postNotification(node, AXSelectedChildrenChanged, false); | 721 postNotification(node, AXSelectedChildrenChanged, false); |
722 } | 722 } |
723 | 723 |
724 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer) | 724 void AXObjectCache::selectedChildrenChanged(RenderObject* renderer) |
725 { | 725 { |
726 // postToElement is false so that you can pass in any child of an element an
d it will go up the parent tree | 726 // postToElement is false so that you can pass in any child of an element an
d it will go up the parent tree |
727 // to find the container which should send out the notification. | 727 // to find the container which should send out the notification. |
728 postNotification(renderer, AXSelectedChildrenChanged, false); | 728 postNotification(renderer, AXSelectedChildrenChanged, false); |
729 } | 729 } |
730 | 730 |
731 void AXObjectCache::nodeTextChangeNotification(Node* node, AXTextChange textChan
ge, unsigned offset, const String& text) | |
732 { | |
733 if (!node) | |
734 return; | |
735 | |
736 stopCachingComputedObjectAttributes(); | |
737 | |
738 // Delegate on the right platform | |
739 AccessibilityObject* obj = getOrCreate(node); | |
740 nodeTextChangePlatformNotification(obj, textChange, offset, text); | |
741 } | |
742 | |
743 void AXObjectCache::handleScrollbarUpdate(ScrollView* view) | 731 void AXObjectCache::handleScrollbarUpdate(ScrollView* view) |
744 { | 732 { |
745 if (!view) | 733 if (!view) |
746 return; | 734 return; |
747 | 735 |
748 // We don't want to create a scroll view from this method, only update an ex
isting one. | 736 // We don't want to create a scroll view from this method, only update an ex
isting one. |
749 if (AccessibilityObject* scrollViewObject = get(view)) { | 737 if (AccessibilityObject* scrollViewObject = get(view)) { |
750 stopCachingComputedObjectAttributes(); | 738 stopCachingComputedObjectAttributes(); |
751 scrollViewObject->updateChildrenIfNecessary(); | 739 scrollViewObject->updateChildrenIfNecessary(); |
752 } | 740 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 if (document != document->topDocument()) | 926 if (document != document->topDocument()) |
939 return; | 927 return; |
940 obj = get(document->renderer()); | 928 obj = get(document->renderer()); |
941 } | 929 } |
942 | 930 |
943 if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentF
rameView()->frame() || !obj->documentFrameView()->frame()->page()) | 931 if (!obj || !obj->document() || !obj->documentFrameView() || !obj->documentF
rameView()->frame() || !obj->documentFrameView()->frame()->page()) |
944 return; | 932 return; |
945 | 933 |
946 ChromeClient& client = obj->documentFrameView()->frame()->page()->chrome().c
lient(); | 934 ChromeClient& client = obj->documentFrameView()->frame()->page()->chrome().c
lient(); |
947 | 935 |
948 switch (notification) { | 936 if (notification == AXActiveDescendantChanged |
949 case AXActiveDescendantChanged: | 937 && obj->document()->focusedElement() |
950 if (!obj->document()->focusedElement() || (obj->node() != obj->document(
)->focusedElement())) | 938 && obj->node() == obj->document()->focusedElement()) { |
951 break; | |
952 | |
953 // Calling handleFocusedUIElementChanged will focus the new active | 939 // Calling handleFocusedUIElementChanged will focus the new active |
954 // descendant and send the AXFocusedUIElementChanged notification. | 940 // descendant and send the AXFocusedUIElementChanged notification. |
955 handleFocusedUIElementChanged(0, obj->document()->focusedElement()); | 941 handleFocusedUIElementChanged(0, obj->document()->focusedElement()); |
956 break; | |
957 case AXAriaAttributeChanged: | |
958 case AXAutocorrectionOccured: | |
959 case AXCheckedStateChanged: | |
960 case AXChildrenChanged: | |
961 case AXFocusedUIElementChanged: | |
962 case AXInvalidStatusChanged: | |
963 case AXLayoutComplete: | |
964 case AXLiveRegionChanged: | |
965 case AXLoadComplete: | |
966 case AXMenuListItemSelected: | |
967 case AXMenuListValueChanged: | |
968 case AXRowCollapsed: | |
969 case AXRowCountChanged: | |
970 case AXRowExpanded: | |
971 case AXScrolledToAnchor: | |
972 case AXSelectedChildrenChanged: | |
973 case AXSelectedTextChanged: | |
974 case AXTextChanged: | |
975 case AXValueChanged: | |
976 break; | |
977 } | 942 } |
978 | 943 |
979 client.postAccessibilityNotification(obj, notification); | 944 client.postAccessibilityNotification(obj, notification); |
980 } | 945 } |
981 | 946 |
982 void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXT
extChange, unsigned, const String&) | |
983 { | |
984 } | |
985 | |
986 void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode) | 947 void AXObjectCache::handleFocusedUIElementChanged(Node*, Node* newFocusedNode) |
987 { | 948 { |
988 if (!newFocusedNode) | 949 if (!newFocusedNode) |
989 return; | 950 return; |
990 | 951 |
991 Page* page = newFocusedNode->document()->page(); | 952 Page* page = newFocusedNode->document()->page(); |
992 if (!page) | 953 if (!page) |
993 return; | 954 return; |
994 | 955 |
995 AccessibilityObject* focusedObject = focusedUIElementForPage(page); | 956 AccessibilityObject* focusedObject = focusedUIElementForPage(page); |
996 if (!focusedObject) | 957 if (!focusedObject) |
997 return; | 958 return; |
998 | 959 |
999 postPlatformNotification(focusedObject, AXFocusedUIElementChanged); | 960 postPlatformNotification(focusedObject, AXFocusedUIElementChanged); |
1000 } | 961 } |
1001 | 962 |
1002 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) | 963 void AXObjectCache::handleScrolledToAnchor(const Node* anchorNode) |
1003 { | 964 { |
1004 // The anchor node may not be accessible. Post the notification for the | 965 // The anchor node may not be accessible. Post the notification for the |
1005 // first accessible object. | 966 // first accessible object. |
1006 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode(
anchorNode), AXScrolledToAnchor); | 967 postPlatformNotification(AccessibilityObject::firstAccessibleObjectFromNode(
anchorNode), AXScrolledToAnchor); |
1007 } | 968 } |
1008 | 969 |
1009 } // namespace WebCore | 970 } // namespace WebCore |
1010 | 971 |
1011 #endif // HAVE(ACCESSIBILITY) | 972 #endif // HAVE(ACCESSIBILITY) |
OLD | NEW |