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

Side by Side Diff: Source/core/accessibility/AXMenuList.cpp

Issue 679623002: Check whether aria-expanded attribute is defined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Introduce new enum for aria-expanded Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 ASSERT(m_children.size() == 1); 81 ASSERT(m_children.size() == 1);
82 m_children[0]->childrenChanged(); 82 m_children[0]->childrenChanged();
83 } 83 }
84 84
85 bool AXMenuList::isCollapsed() const 85 bool AXMenuList::isCollapsed() const
86 { 86 {
87 return !toRenderMenuList(m_renderer)->popupIsVisible(); 87 return !toRenderMenuList(m_renderer)->popupIsVisible();
88 } 88 }
89 89
90 AccessibilityExpanded AXMenuList::ariaExpanded() const
91 {
92 AccessibilityExpanded expanded = getExpandedAttr();
dmazzoni 2014/10/29 07:46:59 The ARIA spec says that ARIA shouldn't be allowed
je_julie(Not used) 2014/10/29 13:07:27 Thanks for your comment. I updated it. On 2014/10/
93
94 if (expanded)
95 return expanded;
96
97 if (isCollapsed())
98 return ExpandedCollapsed;
99
100 return ExpandedExpanded;
101 }
102
90 bool AXMenuList::canSetFocusAttribute() const 103 bool AXMenuList::canSetFocusAttribute() const
91 { 104 {
92 if (!node()) 105 if (!node())
93 return false; 106 return false;
94 107
95 return !toElement(node())->isDisabledFormControl(); 108 return !toElement(node())->isDisabledFormControl();
96 } 109 }
97 110
98 void AXMenuList::didUpdateActiveOption(int optionIndex) 111 void AXMenuList::didUpdateActiveOption(int optionIndex)
99 { 112 {
100 RefPtrWillBeRawPtr<Document> document(m_renderer->document()); 113 RefPtrWillBeRawPtr<Document> document(m_renderer->document());
101 AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); 114 AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache());
102 115
103 const AccessibilityChildrenVector& childObjects = children(); 116 const AccessibilityChildrenVector& childObjects = children();
104 if (!childObjects.isEmpty()) { 117 if (!childObjects.isEmpty()) {
105 ASSERT(childObjects.size() == 1); 118 ASSERT(childObjects.size() == 1);
106 ASSERT(childObjects[0]->isMenuListPopup()); 119 ASSERT(childObjects[0]->isMenuListPopup());
107 120
108 if (childObjects[0]->isMenuListPopup()) { 121 if (childObjects[0]->isMenuListPopup()) {
109 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get() )) 122 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get() ))
110 popup->didUpdateActiveOption(optionIndex); 123 popup->didUpdateActiveOption(optionIndex);
111 } 124 }
112 } 125 }
113 126
114 cache->postNotification(this, document.get(), AXObjectCacheImpl::AXMenuListV alueChanged, true); 127 cache->postNotification(this, document.get(), AXObjectCacheImpl::AXMenuListV alueChanged, true);
115 } 128 }
116 129
117 } // namespace blink 130 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698