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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.cpp

Issue 2772913003: AXObject::performDefaultAction() should focus if it can't click (Closed)
Patch Set: Add test Created 3 years, 9 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
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return -1; 77 return -1;
78 78
79 Node* parentNode = m_parent->getNode(); 79 Node* parentNode = m_parent->getNode();
80 if (!isHTMLSelectElement(parentNode)) 80 if (!isHTMLSelectElement(parentNode))
81 return -1; 81 return -1;
82 82
83 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); 83 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode);
84 return htmlSelectElement->selectedIndex(); 84 return htmlSelectElement->selectedIndex();
85 } 85 }
86 86
87 bool AXMenuListPopup::press() const { 87 bool AXMenuListPopup::press() {
88 if (!m_parent) 88 if (!m_parent)
89 return false; 89 return false;
90 90
91 m_parent->press(); 91 m_parent->press();
92 return true; 92 return true;
93 } 93 }
94 94
95 void AXMenuListPopup::addChildren() { 95 void AXMenuListPopup::addChildren() {
96 ASSERT(!isDetached()); 96 ASSERT(!isDetached());
97 if (!m_parent) 97 if (!m_parent)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 AXObject* AXMenuListPopup::activeDescendant() { 169 AXObject* AXMenuListPopup::activeDescendant() {
170 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size())) 170 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size()))
171 return nullptr; 171 return nullptr;
172 172
173 return m_children[m_activeIndex].get(); 173 return m_children[m_activeIndex].get();
174 } 174 }
175 175
176 } // namespace blink 176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698