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

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

Issue 2287433003: Get rid of remaining uses of AXObject::elementRect (Closed)
Patch Set: Rebase Created 4 years, 3 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
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "modules/accessibility/AXMenuListOption.h" 26 #include "modules/accessibility/AXMenuListOption.h"
27 27
28 #include "SkMatrix44.h"
28 #include "modules/accessibility/AXMenuListPopup.h" 29 #include "modules/accessibility/AXMenuListPopup.h"
29 #include "modules/accessibility/AXObjectCacheImpl.h" 30 #include "modules/accessibility/AXObjectCacheImpl.h"
30 31
31 namespace blink { 32 namespace blink {
32 33
33 using namespace HTMLNames; 34 using namespace HTMLNames;
34 35
35 AXMenuListOption::AXMenuListOption(HTMLOptionElement* element, AXObjectCacheImpl & axObjectCache) 36 AXMenuListOption::AXMenuListOption(HTMLOptionElement* element, AXObjectCacheImpl & axObjectCache)
36 : AXMockObject(axObjectCache) 37 : AXMockObject(axObjectCache)
37 , m_element(element) 38 , m_element(element)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 bool AXMenuListOption::canSetSelectedAttribute() const 109 bool AXMenuListOption::canSetSelectedAttribute() const
109 { 110 {
110 return isEnabled(); 111 return isEnabled();
111 } 112 }
112 113
113 bool AXMenuListOption::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReas ons) const 114 bool AXMenuListOption::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReas ons) const
114 { 115 {
115 return accessibilityIsIgnoredByDefault(ignoredReasons); 116 return accessibilityIsIgnoredByDefault(ignoredReasons);
116 } 117 }
117 118
118 LayoutRect AXMenuListOption::elementRect() const 119 void AXMenuListOption::getRelativeBounds(AXObject** outContainer, FloatRect& out BoundsInContainer, SkMatrix44& outContainerTransform) const
119 { 120 {
121 *outContainer = nullptr;
122 outBoundsInContainer = FloatRect();
123 outContainerTransform.setIdentity();
124
120 AXObject* parent = parentObject(); 125 AXObject* parent = parentObject();
121 if (!parent) 126 if (!parent)
122 return LayoutRect(); 127 return;
123 ASSERT(parent->isMenuListPopup()); 128 ASSERT(parent->isMenuListPopup());
124 129
125 AXObject* grandparent = parent->parentObject(); 130 AXObject* grandparent = parent->parentObject();
126 if (!grandparent) 131 if (!grandparent)
127 return LayoutRect(); 132 return;
128 ASSERT(grandparent->isMenuList()); 133 ASSERT(grandparent->isMenuList());
129 134 grandparent->getRelativeBounds(outContainer, outBoundsInContainer, outContai nerTransform);
130 return grandparent->elementRect();
131 } 135 }
132 136
133 String AXMenuListOption::textAlternative(bool recursive, bool inAriaLabelledByTr aversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* rela tedObjects, NameSources* nameSources) const 137 String AXMenuListOption::textAlternative(bool recursive, bool inAriaLabelledByTr aversal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* rela tedObjects, NameSources* nameSources) const
134 { 138 {
135 // If nameSources is non-null, relatedObjects is used in filling it in, so i t must be non-null as well. 139 // If nameSources is non-null, relatedObjects is used in filling it in, so i t must be non-null as well.
136 if (nameSources) 140 if (nameSources)
137 ASSERT(relatedObjects); 141 ASSERT(relatedObjects);
138 142
139 if (!getNode()) 143 if (!getNode())
140 return String(); 144 return String();
(...skipping 16 matching lines...) Expand all
157 161
158 } 162 }
159 163
160 DEFINE_TRACE(AXMenuListOption) 164 DEFINE_TRACE(AXMenuListOption)
161 { 165 {
162 visitor->trace(m_element); 166 visitor->trace(m_element);
163 AXMockObject::trace(visitor); 167 AXMockObject::trace(visitor);
164 } 168 }
165 169
166 } // namespace blink 170 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698