OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 } | 1520 } |
1521 | 1521 |
1522 void AXObject::scrollToGlobalPoint(const IntPoint& globalPoint) const { | 1522 void AXObject::scrollToGlobalPoint(const IntPoint& globalPoint) const { |
1523 // Search up the parent chain and create a vector of all scrollable parent | 1523 // Search up the parent chain and create a vector of all scrollable parent |
1524 // objects and ending with this object itself. | 1524 // objects and ending with this object itself. |
1525 HeapVector<Member<const AXObject>> objects; | 1525 HeapVector<Member<const AXObject>> objects; |
1526 AXObject* parentObject; | 1526 AXObject* parentObject; |
1527 for (parentObject = this->parentObject(); parentObject; | 1527 for (parentObject = this->parentObject(); parentObject; |
1528 parentObject = parentObject->parentObject()) { | 1528 parentObject = parentObject->parentObject()) { |
1529 if (parentObject->getScrollableAreaIfScrollable()) | 1529 if (parentObject->getScrollableAreaIfScrollable()) |
1530 objects.prepend(parentObject); | 1530 objects.push_front(parentObject); |
1531 } | 1531 } |
1532 objects.push_back(this); | 1532 objects.push_back(this); |
1533 | 1533 |
1534 // Start with the outermost scrollable (the main window) and try to scroll the | 1534 // Start with the outermost scrollable (the main window) and try to scroll the |
1535 // next innermost object to the given point. | 1535 // next innermost object to the given point. |
1536 int offsetX = 0, offsetY = 0; | 1536 int offsetX = 0, offsetY = 0; |
1537 IntPoint point = globalPoint; | 1537 IntPoint point = globalPoint; |
1538 size_t levels = objects.size() - 1; | 1538 size_t levels = objects.size() - 1; |
1539 for (size_t i = 0; i < levels; i++) { | 1539 for (size_t i = 0; i < levels; i++) { |
1540 const AXObject* outer = objects[i]; | 1540 const AXObject* outer = objects[i]; |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 } | 1762 } |
1763 | 1763 |
1764 DEFINE_TRACE(AXObject) { | 1764 DEFINE_TRACE(AXObject) { |
1765 visitor->trace(m_children); | 1765 visitor->trace(m_children); |
1766 visitor->trace(m_parent); | 1766 visitor->trace(m_parent); |
1767 visitor->trace(m_cachedLiveRegionRoot); | 1767 visitor->trace(m_cachedLiveRegionRoot); |
1768 visitor->trace(m_axObjectCache); | 1768 visitor->trace(m_axObjectCache); |
1769 } | 1769 } |
1770 | 1770 |
1771 } // namespace blink | 1771 } // namespace blink |
OLD | NEW |