Chromium Code Reviews| Index: Source/modules/accessibility/AXObject.cpp |
| diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp |
| index 6c614bc316af40c592fb7ac80277f6d05df46665..11b3285c06ee5235122eecfe6d0eae4623becff4 100644 |
| --- a/Source/modules/accessibility/AXObject.cpp |
| +++ b/Source/modules/accessibility/AXObject.cpp |
| @@ -1008,6 +1008,59 @@ const AtomicString& AXObject::getAttribute(const QualifiedName& attribute) const |
| return element->fastGetAttribute(attribute); |
| } |
| +// |
| +// Scrollable containers. |
| +// |
| + |
| +// |
| +// Scrollable containers. |
|
aboxhall
2015/05/01 23:05:42
Double comment?
|
| +// |
| + |
| +bool AXObject::isScrollableContainer() const |
| +{ |
| + return !!getScrollableAreaIfScrollable(); |
|
aboxhall
2015/05/01 23:05:42
Ugh, I don't like !! but it seems to be the de fac
|
| +} |
| + |
| +IntPoint AXObject::scrollOffset() const |
| +{ |
| + ScrollableArea* area = getScrollableAreaIfScrollable(); |
| + if (!area) |
| + return IntPoint(); |
| + |
| + return IntPoint(area->scrollPosition().x(), area->scrollPosition().y()); |
| +} |
| + |
| +IntPoint AXObject::minimumScrollOffset() const |
| +{ |
| + ScrollableArea* area = getScrollableAreaIfScrollable(); |
| + if (!area) |
| + return IntPoint(); |
| + |
| + return IntPoint(area->minimumScrollPosition().x(), area->minimumScrollPosition().y()); |
| +} |
| + |
| +IntPoint AXObject::maximumScrollOffset() const |
| +{ |
| + ScrollableArea* area = getScrollableAreaIfScrollable(); |
| + if (!area) |
| + return IntPoint(); |
| + |
| + return IntPoint(area->maximumScrollPosition().x(), area->maximumScrollPosition().y()); |
| +} |
| + |
| +void AXObject::setScrollOffset(const IntPoint& offset) const |
| +{ |
| + ScrollableArea* area = getScrollableAreaIfScrollable(); |
| + if (!area) |
| + return; |
| + |
| + area->setScrollPosition(DoublePoint(offset.x(), offset.y())); |
| +} |
| + |
| +// |
| +// Modify or take an action on an object. |
| +// |
| + |
| bool AXObject::press() const |
| { |
| Element* actionElem = actionElement(); |
| @@ -1145,7 +1198,7 @@ void AXObject::scrollToMakeVisibleWithSubFocus(const IntRect& subfocus) const |
| objectRect.y(), objectRect.maxY(), |
| 0, scrollVisibleRect.height()); |
| - scrollParent->scrollTo(IntPoint(desiredX, desiredY)); |
| + scrollParent->setScrollOffset(IntPoint(desiredX, desiredY)); |
| // Convert the subfocus into the coordinates of the scroll parent. |
| IntRect newSubfocus = subfocus; |
| @@ -1201,7 +1254,7 @@ void AXObject::scrollToGlobalPoint(const IntPoint& globalPoint) const |
| objectRect.y(), objectRect.maxY(), |
| objectRect.y(), objectRect.maxY(), |
| point.y(), point.y()); |
| - outer->scrollTo(IntPoint(desiredX, desiredY)); |
| + outer->setScrollOffset(IntPoint(desiredX, desiredY)); |
| if (outer->isAXScrollView() && !inner->isAXScrollView()) { |
| // If outer object we just scrolled is a scroll view (main window or iframe) but the |