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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 ASSERT_NOT_REACHED(); | 713 ASSERT_NOT_REACHED(); |
714 | 714 |
715 // This shouldn't happen. | 715 // This shouldn't happen. |
716 return currentScrollOffset; | 716 return currentScrollOffset; |
717 } | 717 } |
718 | 718 |
719 void AXObject::scrollToMakeVisibleWithSubFocus(const IntRect& subfocus) const | 719 void AXObject::scrollToMakeVisibleWithSubFocus(const IntRect& subfocus) const |
720 { | 720 { |
721 // Search up the parent chain until we find the first one that's scrollable. | 721 // Search up the parent chain until we find the first one that's scrollable. |
722 AXObject* scrollParent = parentObject(); | 722 AXObject* scrollParent = parentObject(); |
723 ScrollableArea* scrollableArea; | 723 ScrollableArea* scrollableArea = 0; |
724 for (scrollableArea = 0; | 724 while (scrollParent) { |
725 scrollParent && !(scrollableArea = scrollParent->getScrollableAreaIfScro
llable()); | 725 scrollableArea = scrollParent->getScrollableAreaIfScrollable(); |
726 scrollParent = scrollParent->parentObject()) { } | 726 if (scrollableArea) |
| 727 break; |
| 728 scrollParent = scrollParent->parentObject(); |
| 729 } |
727 if (!scrollableArea) | 730 if (!scrollableArea) |
728 return; | 731 return; |
729 | 732 |
730 IntRect objectRect = pixelSnappedIntRect(elementRect()); | 733 IntRect objectRect = pixelSnappedIntRect(elementRect()); |
731 IntPoint scrollPosition = scrollableArea->scrollPosition(); | 734 IntPoint scrollPosition = scrollableArea->scrollPosition(); |
732 IntRect scrollVisibleRect = scrollableArea->visibleContentRect(); | 735 IntRect scrollVisibleRect = scrollableArea->visibleContentRect(); |
733 | 736 |
734 int desiredX = computeBestScrollOffset( | 737 int desiredX = computeBestScrollOffset( |
735 scrollPosition.x(), | 738 scrollPosition.x(), |
736 objectRect.x() + subfocus.x(), objectRect.x() + subfocus.maxX(), | 739 objectRect.x() + subfocus.x(), objectRect.x() + subfocus.maxX(), |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 return ToggleButtonRole; | 893 return ToggleButtonRole; |
891 if (ariaHasPopup()) | 894 if (ariaHasPopup()) |
892 return PopUpButtonRole; | 895 return PopUpButtonRole; |
893 // We don't contemplate RadioButtonRole, as it depends on the input | 896 // We don't contemplate RadioButtonRole, as it depends on the input |
894 // type. | 897 // type. |
895 | 898 |
896 return ButtonRole; | 899 return ButtonRole; |
897 } | 900 } |
898 | 901 |
899 } // namespace WebCore | 902 } // namespace WebCore |
OLD | NEW |