OLD | NEW |
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 Loading... |
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->activeDescendant() == this; | 96 return parent->activeChild() == 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 Loading... |
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 |
OLD | NEW |