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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXSpinButton.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXSpinButton.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXSpinButton.cpp b/third_party/WebKit/Source/modules/accessibility/AXSpinButton.cpp
index 5cf60590411787c1c94f29353541e426257a74a1..c387f7fae34f7825cf0567d6f40f74084caa1279 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXSpinButton.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXSpinButton.cpp
@@ -52,12 +52,12 @@ DEFINE_TRACE(AXSpinButton)
AXMockObject::trace(visitor);
}
-LayoutRect AXSpinButton::elementRect() const
+LayoutObject* AXSpinButton::layoutObjectForRelativeBounds() const
{
if (!m_spinButtonElement || !m_spinButtonElement->layoutObject())
- return LayoutRect();
+ return nullptr;
- return LayoutRect(m_spinButtonElement->layoutObject()->absoluteElementBoundingBoxRect());
+ return m_spinButtonElement->layoutObject();
}
void AXSpinButton::detach()
@@ -115,20 +115,26 @@ AXSpinButtonPart* AXSpinButtonPart::create(AXObjectCacheImpl& axObjectCache)
return new AXSpinButtonPart(axObjectCache);
}
-LayoutRect AXSpinButtonPart::elementRect() const
+void AXSpinButtonPart::getRelativeBounds(AXObject** outContainer, FloatRect& outBoundsInContainer, SkMatrix44& outContainerTransform) const
{
+ *outContainer = nullptr;
+ outBoundsInContainer = FloatRect();
+ outContainerTransform.setIdentity();
+
+ if (!parentObject())
+ return;
+
// FIXME: This logic should exist in the layout tree or elsewhere, but there is no
// relationship that exists that can be queried.
-
- LayoutRect parentRect = parentObject()->elementRect();
+ parentObject()->getRelativeBounds(outContainer, outBoundsInContainer, outContainerTransform);
+ outBoundsInContainer = FloatRect(0, 0, outBoundsInContainer.width(), outBoundsInContainer.height());
if (m_isIncrementor) {
- parentRect.setHeight(parentRect.height() / 2);
+ outBoundsInContainer.setHeight(outBoundsInContainer.height() / 2);
} else {
- parentRect.setY(parentRect.y() + parentRect.height() / 2);
- parentRect.setHeight(parentRect.height() / 2);
+ outBoundsInContainer.setY(outBoundsInContainer.y() + outBoundsInContainer.height() / 2);
+ outBoundsInContainer.setHeight(outBoundsInContainer.height() / 2);
}
-
- return parentRect;
+ *outContainer = parentObject();
}
bool AXSpinButtonPart::press() const

Powered by Google App Engine
This is Rietveld 408576698