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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp

Issue 2372823002: Fix a case where the accessible bounding box of an inline text box was wrong. (Closed)
Patch Set: Fix bug in bounds calc uncovered by windows test 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
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/inline-text-bounds-for-range-br.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp b/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp
index 925239303cc7af3fd96b5d803a2d546031efdd27..a2cf0fc70a4f9df19040df8c1e2aba88368a8195 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXInlineTextBox.cpp
@@ -66,11 +66,17 @@ void AXInlineTextBox::getRelativeBounds(AXObject** outContainer, FloatRect& outB
outBoundsInContainer = FloatRect();
outContainerTransform.setIdentity();
- if (!m_inlineTextBox)
+ if (!m_inlineTextBox || !parentObject() || !parentObject()->getLayoutObject())
return;
*outContainer = parentObject();
outBoundsInContainer = FloatRect(m_inlineTextBox->localBounds());
+
+ // Subtract the local bounding box of the parent because they're
+ // both in the same coordinate system.
+ LayoutObject* parentLayoutObject = parentObject()->getLayoutObject();
+ FloatRect parentBoundingBox = parentLayoutObject->localBoundingBoxRectForAccessibility();
+ outBoundsInContainer.moveBy(-parentBoundingBox.location());
}
bool AXInlineTextBox::computeAccessibilityIsIgnored(IgnoredReasons* ignoredReasons) const
« no previous file with comments | « third_party/WebKit/LayoutTests/accessibility/inline-text-bounds-for-range-br.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698