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

Unified Diff: Source/modules/accessibility/AXObject.cpp

Issue 1118753004: Fix another case where scrollToMakeVisible was off. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: null-check scrollParent Created 5 years, 8 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 | « LayoutTests/accessibility/scroll-to-make-visible-div-overflow-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXObject.cpp
diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp
index 6c614bc316af40c592fb7ac80277f6d05df46665..7bc64cd5f3ad8fb0723a1ffb6c059feae5a24926 100644
--- a/Source/modules/accessibility/AXObject.cpp
+++ b/Source/modules/accessibility/AXObject.cpp
@@ -1127,13 +1127,19 @@ void AXObject::scrollToMakeVisibleWithSubFocus(const IntRect& subfocus) const
break;
scrollParent = scrollParent->parentObject();
}
- if (!scrollableArea)
+ if (!scrollParent || !scrollableArea)
return;
IntRect objectRect = pixelSnappedIntRect(elementRect());
IntPoint scrollPosition = scrollableArea->scrollPosition();
IntRect scrollVisibleRect = scrollableArea->visibleContentRect();
+ // Convert the object rect into local coordinates.
+ if (!scrollParent->isAXScrollView()) {
+ objectRect.moveBy(scrollPosition);
+ objectRect.moveBy(-pixelSnappedIntRect(scrollParent->elementRect()).location());
+ }
+
int desiredX = computeBestScrollOffset(
scrollPosition.x(),
objectRect.x() + subfocus.x(), objectRect.x() + subfocus.maxX(),
« no previous file with comments | « LayoutTests/accessibility/scroll-to-make-visible-div-overflow-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698