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

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

Issue 1899823002: Uses the activedescendant_changed event received from Blink to fire the right focus event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed menu-list-open Layout test. Created 4 years, 6 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 bool AXMenuListOption::isOffScreen() const 86 bool AXMenuListOption::isOffScreen() const
87 { 87 {
88 // Invisible list options are considered to be offscreen. 88 // Invisible list options are considered to be offscreen.
89 return !isVisible(); 89 return !isVisible();
90 } 90 }
91 91
92 bool AXMenuListOption::isSelected() const 92 bool AXMenuListOption::isSelected() const
93 { 93 {
94 AXMenuListPopup* parent = static_cast<AXMenuListPopup*>(parentObject()); 94 AXMenuListPopup* parent = static_cast<AXMenuListPopup*>(parentObject());
95 if (parent && !parent->isOffScreen()) 95 if (parent && !parent->isOffScreen())
96 return parent->activeChild() == this; 96 return parent->activeDescendant() == this;
97 return m_element && m_element->selected(); 97 return m_element && m_element->selected();
98 } 98 }
99 99
100 void AXMenuListOption::setSelected(bool b) 100 void AXMenuListOption::setSelected(bool b)
101 { 101 {
102 if (!m_element || !canSetSelectedAttribute()) 102 if (!m_element || !canSetSelectedAttribute())
103 return; 103 return;
104 104
105 m_element->setSelected(b); 105 m_element->setSelected(b);
106 } 106 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 } 158 }
159 159
160 DEFINE_TRACE(AXMenuListOption) 160 DEFINE_TRACE(AXMenuListOption)
161 { 161 {
162 visitor->trace(m_element); 162 visitor->trace(m_element);
163 AXMockObject::trace(visitor); 163 AXMockObject::trace(visitor);
164 } 164 }
165 165
166 } // namespace blink 166 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698