| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 viewRect.move(-scrollOffset()); | 594 viewRect.move(-scrollOffset()); |
| 595 return convertToRootView(viewRect); | 595 return convertToRootView(viewRect); |
| 596 } | 596 } |
| 597 | 597 |
| 598 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const | 598 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const |
| 599 { | 599 { |
| 600 IntPoint viewPoint = convertFromContainingWindow(windowPoint); | 600 IntPoint viewPoint = convertFromContainingWindow(windowPoint); |
| 601 return viewPoint + scrollOffset(); | 601 return viewPoint + scrollOffset(); |
| 602 } | 602 } |
| 603 | 603 |
| 604 FloatPoint ScrollView::windowToContents(const FloatPoint& windowPoint) const |
| 605 { |
| 606 FloatPoint viewPoint = convertFromContainingWindow(windowPoint); |
| 607 return viewPoint + scrollOffset(); |
| 608 } |
| 609 |
| 604 IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const | 610 IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const |
| 605 { | 611 { |
| 606 IntPoint viewPoint = contentsPoint - scrollOffset(); | 612 IntPoint viewPoint = contentsPoint - scrollOffset(); |
| 607 return convertToContainingWindow(viewPoint); | 613 return convertToContainingWindow(viewPoint); |
| 608 } | 614 } |
| 609 | 615 |
| 610 IntRect ScrollView::windowToContents(const IntRect& windowRect) const | 616 IntRect ScrollView::windowToContents(const IntRect& windowRect) const |
| 611 { | 617 { |
| 612 IntRect viewRect = convertFromContainingWindow(windowRect); | 618 IntRect viewRect = convertFromContainingWindow(windowRect); |
| 613 viewRect.move(scrollOffset()); | 619 viewRect.move(scrollOffset()); |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 return; | 1120 return; |
| 1115 | 1121 |
| 1116 ScrollableArea::setScrollOrigin(origin); | 1122 ScrollableArea::setScrollOrigin(origin); |
| 1117 | 1123 |
| 1118 // Update if the scroll origin changes, since our position will be different
if the content size did not change. | 1124 // Update if the scroll origin changes, since our position will be different
if the content size did not change. |
| 1119 if (updatePositionAtAll && updatePositionSynchronously) | 1125 if (updatePositionAtAll && updatePositionSynchronously) |
| 1120 updateScrollbars(scrollOffset()); | 1126 updateScrollbars(scrollOffset()); |
| 1121 } | 1127 } |
| 1122 | 1128 |
| 1123 } // namespace WebCore | 1129 } // namespace WebCore |
| OLD | NEW |