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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (role) | 55 if (role) |
56 return role; | 56 return role; |
57 return MenuListOptionRole; | 57 return MenuListOptionRole; |
58 } | 58 } |
59 | 59 |
60 Element* AXMenuListOption::actionElement() const { | 60 Element* AXMenuListOption::actionElement() const { |
61 return m_element; | 61 return m_element; |
62 } | 62 } |
63 | 63 |
64 bool AXMenuListOption::isEnabled() const { | 64 bool AXMenuListOption::isEnabled() const { |
65 // isDisabledFormControl() returns true if the parent <select> element is disa
bled, | 65 // isDisabledFormControl() returns true if the parent <select> element is |
66 // which we don't want. | 66 // disabled, which we don't want. |
67 return m_element && !m_element->ownElementDisabled(); | 67 return m_element && !m_element->ownElementDisabled(); |
68 } | 68 } |
69 | 69 |
70 bool AXMenuListOption::isVisible() const { | 70 bool AXMenuListOption::isVisible() const { |
71 if (!m_parent) | 71 if (!m_parent) |
72 return false; | 72 return false; |
73 | 73 |
74 // In a single-option select with the popup collapsed, only the selected | 74 // In a single-option select with the popup collapsed, only the selected |
75 // item is considered visible. | 75 // item is considered visible. |
76 return !m_parent->isOffScreen() || isSelected(); | 76 return !m_parent->isOffScreen() || isSelected(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 grandparent->getRelativeBounds(outContainer, outBoundsInContainer, | 124 grandparent->getRelativeBounds(outContainer, outBoundsInContainer, |
125 outContainerTransform); | 125 outContainerTransform); |
126 } | 126 } |
127 | 127 |
128 String AXMenuListOption::textAlternative(bool recursive, | 128 String AXMenuListOption::textAlternative(bool recursive, |
129 bool inAriaLabelledByTraversal, | 129 bool inAriaLabelledByTraversal, |
130 AXObjectSet& visited, | 130 AXObjectSet& visited, |
131 AXNameFrom& nameFrom, | 131 AXNameFrom& nameFrom, |
132 AXRelatedObjectVector* relatedObjects, | 132 AXRelatedObjectVector* relatedObjects, |
133 NameSources* nameSources) const { | 133 NameSources* nameSources) const { |
134 // If nameSources is non-null, relatedObjects is used in filling it in, so it
must be non-null as well. | 134 // If nameSources is non-null, relatedObjects is used in filling it in, so it |
| 135 // must be non-null as well. |
135 if (nameSources) | 136 if (nameSources) |
136 ASSERT(relatedObjects); | 137 ASSERT(relatedObjects); |
137 | 138 |
138 if (!getNode()) | 139 if (!getNode()) |
139 return String(); | 140 return String(); |
140 | 141 |
141 bool foundTextAlternative = false; | 142 bool foundTextAlternative = false; |
142 String textAlternative = ariaTextAlternative( | 143 String textAlternative = ariaTextAlternative( |
143 recursive, inAriaLabelledByTraversal, visited, nameFrom, relatedObjects, | 144 recursive, inAriaLabelledByTraversal, visited, nameFrom, relatedObjects, |
144 nameSources, &foundTextAlternative); | 145 nameSources, &foundTextAlternative); |
(...skipping 11 matching lines...) Expand all Loading... |
156 | 157 |
157 return textAlternative; | 158 return textAlternative; |
158 } | 159 } |
159 | 160 |
160 DEFINE_TRACE(AXMenuListOption) { | 161 DEFINE_TRACE(AXMenuListOption) { |
161 visitor->trace(m_element); | 162 visitor->trace(m_element); |
162 AXMockObject::trace(visitor); | 163 AXMockObject::trace(visitor); |
163 } | 164 } |
164 | 165 |
165 } // namespace blink | 166 } // namespace blink |
OLD | NEW |