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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXSlider.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (thumb->accessibilityIsIgnored()) 101 if (thumb->accessibilityIsIgnored())
102 cache.remove(thumb->axObjectID()); 102 cache.remove(thumb->axObjectID());
103 else 103 else
104 m_children.append(thumb); 104 m_children.append(thumb);
105 } 105 }
106 106
107 AXObject* AXSlider::elementAccessibilityHitTest(const IntPoint& point) const 107 AXObject* AXSlider::elementAccessibilityHitTest(const IntPoint& point) const
108 { 108 {
109 if (m_children.size()) { 109 if (m_children.size()) {
110 ASSERT(m_children.size() == 1); 110 ASSERT(m_children.size() == 1);
111 if (m_children[0]->elementRect().contains(point)) 111 if (m_children[0]->getBoundsInFrameCoordinates().contains(point))
112 return m_children[0].get(); 112 return m_children[0].get();
113 } 113 }
114 114
115 return axObjectCache().getOrCreate(m_layoutObject); 115 return axObjectCache().getOrCreate(m_layoutObject);
116 } 116 }
117 117
118 void AXSlider::setValue(const String& value) 118 void AXSlider::setValue(const String& value)
119 { 119 {
120 HTMLInputElement* input = element(); 120 HTMLInputElement* input = element();
121 121
(...skipping 14 matching lines...) Expand all
136 AXSliderThumb::AXSliderThumb(AXObjectCacheImpl& axObjectCache) 136 AXSliderThumb::AXSliderThumb(AXObjectCacheImpl& axObjectCache)
137 : AXMockObject(axObjectCache) 137 : AXMockObject(axObjectCache)
138 { 138 {
139 } 139 }
140 140
141 AXSliderThumb* AXSliderThumb::create(AXObjectCacheImpl& axObjectCache) 141 AXSliderThumb* AXSliderThumb::create(AXObjectCacheImpl& axObjectCache)
142 { 142 {
143 return new AXSliderThumb(axObjectCache); 143 return new AXSliderThumb(axObjectCache);
144 } 144 }
145 145
146 LayoutRect AXSliderThumb::elementRect() const 146 LayoutObject* AXSliderThumb::layoutObjectForRelativeBounds() const
147 { 147 {
148 if (!m_parent) 148 if (!m_parent)
149 return LayoutRect(); 149 return nullptr;
150 150
151 LayoutObject* sliderLayoutObject = m_parent->getLayoutObject(); 151 LayoutObject* sliderLayoutObject = m_parent->getLayoutObject();
152 if (!sliderLayoutObject || !sliderLayoutObject->isSlider()) 152 if (!sliderLayoutObject || !sliderLayoutObject->isSlider())
153 return LayoutRect(); 153 return nullptr;
154 return toElement(sliderLayoutObject->node())->userAgentShadowRoot()->getElem entById(ShadowElementNames::sliderThumb())->boundingBox(); 154 Element* thumbElement = toElement(sliderLayoutObject->node())->userAgentShad owRoot()->getElementById(ShadowElementNames::sliderThumb());
155 DCHECK(thumbElement);
156 return thumbElement->layoutObject();
155 } 157 }
156 158
157 bool AXSliderThumb::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons ) const 159 bool AXSliderThumb::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons ) const
158 { 160 {
159 return accessibilityIsIgnoredByDefault(ignoredReasons); 161 return accessibilityIsIgnoredByDefault(ignoredReasons);
160 } 162 }
161 163
162 } // namespace blink 164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698