| 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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 { | 723 { |
| 724 // Search up the parent chain until we find the first one that's scrollable. | 724 // Search up the parent chain until we find the first one that's scrollable. |
| 725 AXObject* scrollParent = parentObject(); | 725 AXObject* scrollParent = parentObject(); |
| 726 ScrollableArea* scrollableArea; | 726 ScrollableArea* scrollableArea; |
| 727 for (scrollableArea = 0; | 727 for (scrollableArea = 0; |
| 728 scrollParent && !(scrollableArea = scrollParent->getScrollableAreaIfScro
llable()); | 728 scrollParent && !(scrollableArea = scrollParent->getScrollableAreaIfScro
llable()); |
| 729 scrollParent = scrollParent->parentObject()) { } | 729 scrollParent = scrollParent->parentObject()) { } |
| 730 if (!scrollableArea) | 730 if (!scrollableArea) |
| 731 return; | 731 return; |
| 732 | 732 |
| 733 LayoutRect objectRect = elementRect(); | 733 IntRect objectRect = pixelSnappedIntRect(elementRect()); |
| 734 IntPoint scrollPosition = scrollableArea->scrollPosition(); | 734 IntPoint scrollPosition = scrollableArea->scrollPosition(); |
| 735 IntRect scrollVisibleRect = scrollableArea->visibleContentRect(); | 735 IntRect scrollVisibleRect = scrollableArea->visibleContentRect(); |
| 736 | 736 |
| 737 int desiredX = computeBestScrollOffset( | 737 int desiredX = computeBestScrollOffset( |
| 738 scrollPosition.x(), | 738 scrollPosition.x(), |
| 739 objectRect.x() + subfocus.x(), objectRect.x() + subfocus.maxX(), | 739 objectRect.x() + subfocus.x(), objectRect.x() + subfocus.maxX(), |
| 740 objectRect.x(), objectRect.maxX(), | 740 objectRect.x(), objectRect.maxX(), |
| 741 0, scrollVisibleRect.width()); | 741 0, scrollVisibleRect.width()); |
| 742 int desiredY = computeBestScrollOffset( | 742 int desiredY = computeBestScrollOffset( |
| 743 scrollPosition.y(), | 743 scrollPosition.y(), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 768 // next innermost object to the given point. | 768 // next innermost object to the given point. |
| 769 int offsetX = 0, offsetY = 0; | 769 int offsetX = 0, offsetY = 0; |
| 770 IntPoint point = globalPoint; | 770 IntPoint point = globalPoint; |
| 771 size_t levels = objects.size() - 1; | 771 size_t levels = objects.size() - 1; |
| 772 for (size_t i = 0; i < levels; i++) { | 772 for (size_t i = 0; i < levels; i++) { |
| 773 const AXObject* outer = objects[i]; | 773 const AXObject* outer = objects[i]; |
| 774 const AXObject* inner = objects[i + 1]; | 774 const AXObject* inner = objects[i + 1]; |
| 775 | 775 |
| 776 ScrollableArea* scrollableArea = outer->getScrollableAreaIfScrollable(); | 776 ScrollableArea* scrollableArea = outer->getScrollableAreaIfScrollable(); |
| 777 | 777 |
| 778 LayoutRect innerRect = inner->isAXScrollView() ? inner->parentObject()->
elementRect() : inner->elementRect(); | 778 IntRect innerRect = inner->isAXScrollView() ? pixelSnappedIntRect(inner-
>parentObject()->elementRect()) : pixelSnappedIntRect(inner->elementRect()); |
| 779 LayoutRect objectRect = innerRect; | 779 IntRect objectRect = innerRect; |
| 780 IntPoint scrollPosition = scrollableArea->scrollPosition(); | 780 IntPoint scrollPosition = scrollableArea->scrollPosition(); |
| 781 | 781 |
| 782 // Convert the object rect into local coordinates. | 782 // Convert the object rect into local coordinates. |
| 783 objectRect.move(offsetX, offsetY); | 783 objectRect.move(offsetX, offsetY); |
| 784 if (!outer->isAXScrollView()) | 784 if (!outer->isAXScrollView()) |
| 785 objectRect.move(scrollPosition.x(), scrollPosition.y()); | 785 objectRect.move(scrollPosition.x(), scrollPosition.y()); |
| 786 | 786 |
| 787 int desiredX = computeBestScrollOffset( | 787 int desiredX = computeBestScrollOffset( |
| 788 0, | 788 0, |
| 789 objectRect.x(), objectRect.maxX(), | 789 objectRect.x(), objectRect.maxX(), |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 return ToggleButtonRole; | 893 return ToggleButtonRole; |
| 894 if (ariaHasPopup()) | 894 if (ariaHasPopup()) |
| 895 return PopUpButtonRole; | 895 return PopUpButtonRole; |
| 896 // We don't contemplate RadioButtonRole, as it depends on the input | 896 // We don't contemplate RadioButtonRole, as it depends on the input |
| 897 // type. | 897 // type. |
| 898 | 898 |
| 899 return ButtonRole; | 899 return ButtonRole; |
| 900 } | 900 } |
| 901 | 901 |
| 902 } // namespace WebCore | 902 } // namespace WebCore |
| OLD | NEW |