OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014, Google Inc. All rights reserved. | 2 * Copyright (C) 2014, Google 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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include "core/HTMLNames.h" | 33 #include "core/HTMLNames.h" |
34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
35 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
37 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
38 #include "core/html/HTMLAreaElement.h" | 38 #include "core/html/HTMLAreaElement.h" |
39 #include "core/html/HTMLImageElement.h" | 39 #include "core/html/HTMLImageElement.h" |
40 #include "core/html/HTMLInputElement.h" | 40 #include "core/html/HTMLInputElement.h" |
41 #include "core/html/HTMLLabelElement.h" | 41 #include "core/html/HTMLLabelElement.h" |
| 42 #include "core/html/HTMLOptionElement.h" |
| 43 #include "core/html/HTMLSelectElement.h" |
42 #include "core/layout/LayoutListBox.h" | 44 #include "core/layout/LayoutListBox.h" |
43 #include "core/layout/LayoutMenuList.h" | 45 #include "core/layout/LayoutMenuList.h" |
44 #include "core/layout/LayoutProgress.h" | 46 #include "core/layout/LayoutProgress.h" |
45 #include "core/layout/LayoutSlider.h" | 47 #include "core/layout/LayoutSlider.h" |
46 #include "core/layout/LayoutTable.h" | 48 #include "core/layout/LayoutTable.h" |
47 #include "core/layout/LayoutTableCell.h" | 49 #include "core/layout/LayoutTableCell.h" |
48 #include "core/layout/LayoutTableRow.h" | 50 #include "core/layout/LayoutTableRow.h" |
49 #include "core/layout/LayoutView.h" | 51 #include "core/layout/LayoutView.h" |
50 #include "core/layout/line/AbstractInlineTextBox.h" | 52 #include "core/layout/line/AbstractInlineTextBox.h" |
51 #include "core/page/Chrome.h" | 53 #include "core/page/Chrome.h" |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 m_notificationsToPost.append(std::make_pair(object, notification)); | 742 m_notificationsToPost.append(std::make_pair(object, notification)); |
741 if (!m_notificationPostTimer.isActive()) | 743 if (!m_notificationPostTimer.isActive()) |
742 m_notificationPostTimer.startOneShot(0, FROM_HERE); | 744 m_notificationPostTimer.startOneShot(0, FROM_HERE); |
743 } | 745 } |
744 | 746 |
745 void AXObjectCacheImpl::checkedStateChanged(Node* node) | 747 void AXObjectCacheImpl::checkedStateChanged(Node* node) |
746 { | 748 { |
747 postNotification(node, AXObjectCacheImpl::AXCheckedStateChanged); | 749 postNotification(node, AXObjectCacheImpl::AXCheckedStateChanged); |
748 } | 750 } |
749 | 751 |
750 void AXObjectCacheImpl::selectedChildrenChanged(Node* node) | 752 void AXObjectCacheImpl::listboxOptionStateChanged(HTMLOptionElement* option) |
751 { | 753 { |
752 selectedChildrenChanged(get(node)); | 754 postNotification(option, AXCheckedStateChanged); |
753 } | 755 } |
754 | 756 |
755 void AXObjectCacheImpl::selectedChildrenChanged(LayoutObject* layoutObject) | 757 void AXObjectCacheImpl::listboxSelectedChildrenChanged(HTMLSelectElement* select
) |
756 { | 758 { |
757 selectedChildrenChanged(get(layoutObject)); | 759 postNotification(select, AXSelectedChildrenChanged); |
758 } | 760 } |
759 | 761 |
760 void AXObjectCacheImpl::selectedChildrenChanged(AXObject* obj) | 762 void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select) |
761 { | 763 { |
762 while (obj && obj->roleValue() != ListBoxRole) | 764 AXObject* obj = get(select); |
763 obj = obj->parentObject(); | 765 if (!obj || !obj->isAXListBox()) |
764 postNotification(obj, AXSelectedChildrenChanged); | 766 return; |
| 767 |
| 768 static_cast<AXListBox*>(obj)->activeIndexChanged(); |
765 } | 769 } |
766 | 770 |
767 void AXObjectCacheImpl::handleScrollbarUpdate(FrameView* view) | 771 void AXObjectCacheImpl::handleScrollbarUpdate(FrameView* view) |
768 { | 772 { |
769 if (!view) | 773 if (!view) |
770 return; | 774 return; |
771 | 775 |
772 // We don't want to create a scroll view from this method, only update an ex
isting one. | 776 // We don't want to create a scroll view from this method, only update an ex
isting one. |
773 if (AXObject* scrollViewObject = get(view)) { | 777 if (AXObject* scrollViewObject = get(view)) { |
774 m_modificationCount++; | 778 m_modificationCount++; |
(...skipping 14 matching lines...) Expand all Loading... |
789 if (AXObject* obj = getOrCreate(layoutObject)) | 793 if (AXObject* obj = getOrCreate(layoutObject)) |
790 postNotification(obj, AXLayoutComplete); | 794 postNotification(obj, AXLayoutComplete); |
791 } | 795 } |
792 | 796 |
793 void AXObjectCacheImpl::handleAriaExpandedChange(Node* node) | 797 void AXObjectCacheImpl::handleAriaExpandedChange(Node* node) |
794 { | 798 { |
795 if (AXObject* obj = getOrCreate(node)) | 799 if (AXObject* obj = getOrCreate(node)) |
796 obj->handleAriaExpandedChanged(); | 800 obj->handleAriaExpandedChanged(); |
797 } | 801 } |
798 | 802 |
| 803 void AXObjectCacheImpl::handleAriaSelectedChanged(Node* node) |
| 804 { |
| 805 AXObject* obj = get(node); |
| 806 if (!obj) |
| 807 return; |
| 808 |
| 809 postNotification(obj, AXCheckedStateChanged); |
| 810 |
| 811 AXObject* listbox = obj->parentObjectUnignored(); |
| 812 if (listbox->roleValue() == ListBoxRole) |
| 813 postNotification(listbox, AXSelectedChildrenChanged); |
| 814 } |
| 815 |
799 void AXObjectCacheImpl::handleActiveDescendantChanged(Node* node) | 816 void AXObjectCacheImpl::handleActiveDescendantChanged(Node* node) |
800 { | 817 { |
801 if (AXObject* obj = getOrCreate(node)) | 818 if (AXObject* obj = getOrCreate(node)) |
802 obj->handleActiveDescendantChanged(); | 819 obj->handleActiveDescendantChanged(); |
803 } | 820 } |
804 | 821 |
805 void AXObjectCacheImpl::handleAriaRoleChanged(Node* node) | 822 void AXObjectCacheImpl::handleAriaRoleChanged(Node* node) |
806 { | 823 { |
807 if (AXObject* obj = getOrCreate(node)) { | 824 if (AXObject* obj = getOrCreate(node)) { |
808 obj->updateAccessibilityRole(); | 825 obj->updateAccessibilityRole(); |
(...skipping 16 matching lines...) Expand all Loading... |
825 | 842 |
826 if (attrName == aria_activedescendantAttr) | 843 if (attrName == aria_activedescendantAttr) |
827 handleActiveDescendantChanged(element); | 844 handleActiveDescendantChanged(element); |
828 else if (attrName == aria_valuenowAttr || attrName == aria_valuetextAttr) | 845 else if (attrName == aria_valuenowAttr || attrName == aria_valuetextAttr) |
829 postNotification(element, AXObjectCacheImpl::AXValueChanged); | 846 postNotification(element, AXObjectCacheImpl::AXValueChanged); |
830 else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || att
rName == aria_labelledbyAttr) | 847 else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || att
rName == aria_labelledbyAttr) |
831 textChanged(element); | 848 textChanged(element); |
832 else if (attrName == aria_checkedAttr) | 849 else if (attrName == aria_checkedAttr) |
833 checkedStateChanged(element); | 850 checkedStateChanged(element); |
834 else if (attrName == aria_selectedAttr) | 851 else if (attrName == aria_selectedAttr) |
835 selectedChildrenChanged(element); | 852 handleAriaSelectedChanged(element); |
836 else if (attrName == aria_expandedAttr) | 853 else if (attrName == aria_expandedAttr) |
837 handleAriaExpandedChange(element); | 854 handleAriaExpandedChange(element); |
838 else if (attrName == aria_hiddenAttr) | 855 else if (attrName == aria_hiddenAttr) |
839 childrenChanged(element->parentNode()); | 856 childrenChanged(element->parentNode()); |
840 else if (attrName == aria_invalidAttr) | 857 else if (attrName == aria_invalidAttr) |
841 postNotification(element, AXObjectCacheImpl::AXInvalidStatusChanged); | 858 postNotification(element, AXObjectCacheImpl::AXInvalidStatusChanged); |
842 else | 859 else |
843 postNotification(element, AXObjectCacheImpl::AXAriaAttributeChanged); | 860 postNotification(element, AXObjectCacheImpl::AXAriaAttributeChanged); |
844 } | 861 } |
845 | 862 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect
& rect) | 1125 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect
& rect) |
1109 { | 1126 { |
1110 AXObject* obj = getOrCreate(element); | 1127 AXObject* obj = getOrCreate(element); |
1111 if (!obj) | 1128 if (!obj) |
1112 return; | 1129 return; |
1113 | 1130 |
1114 obj->setElementRect(rect); | 1131 obj->setElementRect(rect); |
1115 } | 1132 } |
1116 | 1133 |
1117 } // namespace blink | 1134 } // namespace blink |
OLD | NEW |