Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1127283002: Revert of Fire AX notifications on list box options. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@menu_list_more
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
44 #include "core/layout/LayoutListBox.h" 42 #include "core/layout/LayoutListBox.h"
45 #include "core/layout/LayoutMenuList.h" 43 #include "core/layout/LayoutMenuList.h"
46 #include "core/layout/LayoutProgress.h" 44 #include "core/layout/LayoutProgress.h"
47 #include "core/layout/LayoutSlider.h" 45 #include "core/layout/LayoutSlider.h"
48 #include "core/layout/LayoutTable.h" 46 #include "core/layout/LayoutTable.h"
49 #include "core/layout/LayoutTableCell.h" 47 #include "core/layout/LayoutTableCell.h"
50 #include "core/layout/LayoutTableRow.h" 48 #include "core/layout/LayoutTableRow.h"
51 #include "core/layout/LayoutView.h" 49 #include "core/layout/LayoutView.h"
52 #include "core/layout/line/AbstractInlineTextBox.h" 50 #include "core/layout/line/AbstractInlineTextBox.h"
53 #include "core/page/Chrome.h" 51 #include "core/page/Chrome.h"
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 m_notificationsToPost.append(std::make_pair(object, notification)); 740 m_notificationsToPost.append(std::make_pair(object, notification));
743 if (!m_notificationPostTimer.isActive()) 741 if (!m_notificationPostTimer.isActive())
744 m_notificationPostTimer.startOneShot(0, FROM_HERE); 742 m_notificationPostTimer.startOneShot(0, FROM_HERE);
745 } 743 }
746 744
747 void AXObjectCacheImpl::checkedStateChanged(Node* node) 745 void AXObjectCacheImpl::checkedStateChanged(Node* node)
748 { 746 {
749 postNotification(node, AXObjectCacheImpl::AXCheckedStateChanged); 747 postNotification(node, AXObjectCacheImpl::AXCheckedStateChanged);
750 } 748 }
751 749
752 void AXObjectCacheImpl::listboxOptionStateChanged(HTMLOptionElement* option) 750 void AXObjectCacheImpl::selectedChildrenChanged(Node* node)
753 { 751 {
754 postNotification(option, AXCheckedStateChanged); 752 selectedChildrenChanged(get(node));
755 } 753 }
756 754
757 void AXObjectCacheImpl::listboxSelectedChildrenChanged(HTMLSelectElement* select ) 755 void AXObjectCacheImpl::selectedChildrenChanged(LayoutObject* layoutObject)
758 { 756 {
759 postNotification(select, AXSelectedChildrenChanged); 757 selectedChildrenChanged(get(layoutObject));
760 } 758 }
761 759
762 void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select) 760 void AXObjectCacheImpl::selectedChildrenChanged(AXObject* obj)
763 { 761 {
764 AXObject* obj = get(select); 762 while (obj && obj->roleValue() != ListBoxRole)
765 if (!obj || !obj->isAXListBox()) 763 obj = obj->parentObject();
766 return; 764 postNotification(obj, AXSelectedChildrenChanged);
767
768 static_cast<AXListBox*>(obj)->activeIndexChanged();
769 } 765 }
770 766
771 void AXObjectCacheImpl::handleScrollbarUpdate(FrameView* view) 767 void AXObjectCacheImpl::handleScrollbarUpdate(FrameView* view)
772 { 768 {
773 if (!view) 769 if (!view)
774 return; 770 return;
775 771
776 // We don't want to create a scroll view from this method, only update an ex isting one. 772 // We don't want to create a scroll view from this method, only update an ex isting one.
777 if (AXObject* scrollViewObject = get(view)) { 773 if (AXObject* scrollViewObject = get(view)) {
778 m_modificationCount++; 774 m_modificationCount++;
(...skipping 14 matching lines...) Expand all
793 if (AXObject* obj = getOrCreate(layoutObject)) 789 if (AXObject* obj = getOrCreate(layoutObject))
794 postNotification(obj, AXLayoutComplete); 790 postNotification(obj, AXLayoutComplete);
795 } 791 }
796 792
797 void AXObjectCacheImpl::handleAriaExpandedChange(Node* node) 793 void AXObjectCacheImpl::handleAriaExpandedChange(Node* node)
798 { 794 {
799 if (AXObject* obj = getOrCreate(node)) 795 if (AXObject* obj = getOrCreate(node))
800 obj->handleAriaExpandedChanged(); 796 obj->handleAriaExpandedChanged();
801 } 797 }
802 798
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
816 void AXObjectCacheImpl::handleActiveDescendantChanged(Node* node) 799 void AXObjectCacheImpl::handleActiveDescendantChanged(Node* node)
817 { 800 {
818 if (AXObject* obj = getOrCreate(node)) 801 if (AXObject* obj = getOrCreate(node))
819 obj->handleActiveDescendantChanged(); 802 obj->handleActiveDescendantChanged();
820 } 803 }
821 804
822 void AXObjectCacheImpl::handleAriaRoleChanged(Node* node) 805 void AXObjectCacheImpl::handleAriaRoleChanged(Node* node)
823 { 806 {
824 if (AXObject* obj = getOrCreate(node)) { 807 if (AXObject* obj = getOrCreate(node)) {
825 obj->updateAccessibilityRole(); 808 obj->updateAccessibilityRole();
(...skipping 16 matching lines...) Expand all
842 825
843 if (attrName == aria_activedescendantAttr) 826 if (attrName == aria_activedescendantAttr)
844 handleActiveDescendantChanged(element); 827 handleActiveDescendantChanged(element);
845 else if (attrName == aria_valuenowAttr || attrName == aria_valuetextAttr) 828 else if (attrName == aria_valuenowAttr || attrName == aria_valuetextAttr)
846 postNotification(element, AXObjectCacheImpl::AXValueChanged); 829 postNotification(element, AXObjectCacheImpl::AXValueChanged);
847 else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || att rName == aria_labelledbyAttr) 830 else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || att rName == aria_labelledbyAttr)
848 textChanged(element); 831 textChanged(element);
849 else if (attrName == aria_checkedAttr) 832 else if (attrName == aria_checkedAttr)
850 checkedStateChanged(element); 833 checkedStateChanged(element);
851 else if (attrName == aria_selectedAttr) 834 else if (attrName == aria_selectedAttr)
852 handleAriaSelectedChanged(element); 835 selectedChildrenChanged(element);
853 else if (attrName == aria_expandedAttr) 836 else if (attrName == aria_expandedAttr)
854 handleAriaExpandedChange(element); 837 handleAriaExpandedChange(element);
855 else if (attrName == aria_hiddenAttr) 838 else if (attrName == aria_hiddenAttr)
856 childrenChanged(element->parentNode()); 839 childrenChanged(element->parentNode());
857 else if (attrName == aria_invalidAttr) 840 else if (attrName == aria_invalidAttr)
858 postNotification(element, AXObjectCacheImpl::AXInvalidStatusChanged); 841 postNotification(element, AXObjectCacheImpl::AXInvalidStatusChanged);
859 else 842 else
860 postNotification(element, AXObjectCacheImpl::AXAriaAttributeChanged); 843 postNotification(element, AXObjectCacheImpl::AXAriaAttributeChanged);
861 } 844 }
862 845
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect) 1108 void AXObjectCacheImpl::setCanvasObjectBounds(Element* element, const LayoutRect & rect)
1126 { 1109 {
1127 AXObject* obj = getOrCreate(element); 1110 AXObject* obj = getOrCreate(element);
1128 if (!obj) 1111 if (!obj)
1129 return; 1112 return;
1130 1113
1131 obj->setElementRect(rect); 1114 obj->setElementRect(rect);
1132 } 1115 }
1133 1116
1134 } // namespace blink 1117 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698