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

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: Add COMPILE ASSERT for new enum type 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
« no previous file with comments | « Source/core/accessibility/AXMenuList.h ('k') | Source/core/accessibility/AXNodeObject.h » ('j') | 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) 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::isExpanded() const
91 {
92 if (isCollapsed())
93 return ExpandedCollapsed;
94
95 return ExpandedExpanded;
96 }
97
90 bool AXMenuList::canSetFocusAttribute() const 98 bool AXMenuList::canSetFocusAttribute() const
91 { 99 {
92 if (!node()) 100 if (!node())
93 return false; 101 return false;
94 102
95 return !toElement(node())->isDisabledFormControl(); 103 return !toElement(node())->isDisabledFormControl();
96 } 104 }
97 105
98 void AXMenuList::didUpdateActiveOption(int optionIndex) 106 void AXMenuList::didUpdateActiveOption(int optionIndex)
99 { 107 {
100 RefPtrWillBeRawPtr<Document> document(m_renderer->document()); 108 RefPtrWillBeRawPtr<Document> document(m_renderer->document());
101 AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); 109 AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache());
102 110
103 const AccessibilityChildrenVector& childObjects = children(); 111 const AccessibilityChildrenVector& childObjects = children();
104 if (!childObjects.isEmpty()) { 112 if (!childObjects.isEmpty()) {
105 ASSERT(childObjects.size() == 1); 113 ASSERT(childObjects.size() == 1);
106 ASSERT(childObjects[0]->isMenuListPopup()); 114 ASSERT(childObjects[0]->isMenuListPopup());
107 115
108 if (childObjects[0]->isMenuListPopup()) { 116 if (childObjects[0]->isMenuListPopup()) {
109 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get() )) 117 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get() ))
110 popup->didUpdateActiveOption(optionIndex); 118 popup->didUpdateActiveOption(optionIndex);
111 } 119 }
112 } 120 }
113 121
114 cache->postNotification(this, document.get(), AXObjectCacheImpl::AXMenuListV alueChanged, true); 122 cache->postNotification(this, document.get(), AXObjectCacheImpl::AXMenuListV alueChanged, true);
115 } 123 }
116 124
117 } // namespace blink 125 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXMenuList.h ('k') | Source/core/accessibility/AXNodeObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698