OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 // scrolling. | 771 // scrolling. |
772 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con st | 772 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con st |
773 { | 773 { |
774 if (!frame()) | 774 if (!frame()) |
775 return IntSize(); | 775 return IntSize(); |
776 | 776 |
777 FrameView* frameView = frame()->view(); | 777 FrameView* frameView = frame()->view(); |
778 if (!frameView) | 778 if (!frameView) |
779 return IntSize(); | 779 return IntSize(); |
780 | 780 |
781 IntSize offset; | 781 IntPoint point = windowPoint; |
yosin_UTC9
2013/09/10 02:09:38
nit: can we introduce new variable windowAutoscrol
| |
782 IntPoint point = frameView->windowToContents(windowPoint); | 782 IntRect box((absoluteBoundingBoxRect())); |
783 IntRect box(absoluteBoundingBoxRect()); | 783 box.move(view()->frameView()->scrollOffset()); |
784 if (isRenderView()) | 784 box = view()->frameView()->contentsToWindow(box); |
yosin_UTC9
2013/09/10 02:09:38
nit: can we introduce new variable windowBox to de
| |
785 box.moveBy(frameView->windowToContents(IntPoint())); | |
786 | 785 |
787 if (point.x() < box.x() + autoscrollBeltSize) | 786 if (point.x() < box.x() + autoscrollBeltSize) |
788 point.move(-autoscrollBeltSize, 0); | 787 point.move(-autoscrollBeltSize, 0); |
789 else if (point.x() > box.maxX() - autoscrollBeltSize) | 788 else if (point.x() > box.maxX() - autoscrollBeltSize) |
790 point.move(autoscrollBeltSize, 0); | 789 point.move(autoscrollBeltSize, 0); |
791 | 790 |
792 if (point.y() < box.y() + autoscrollBeltSize) | 791 if (point.y() < box.y() + autoscrollBeltSize) |
793 point.move(0, -autoscrollBeltSize); | 792 point.move(0, -autoscrollBeltSize); |
794 else if (point.y() > box.maxY() - autoscrollBeltSize) | 793 else if (point.y() > box.maxY() - autoscrollBeltSize) |
795 point.move(0, autoscrollBeltSize); | 794 point.move(0, autoscrollBeltSize); |
796 return frameView->contentsToWindow(point) - windowPoint; | 795 |
796 return point - windowPoint; | |
797 } | 797 } |
798 | 798 |
799 RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer) | 799 RenderBox* RenderBox::findAutoscrollable(RenderObject* renderer) |
800 { | 800 { |
801 while (renderer && !(renderer->isBox() && toRenderBox(renderer)->canAutoscro ll())) { | 801 while (renderer && !(renderer->isBox() && toRenderBox(renderer)->canAutoscro ll())) { |
802 if (!renderer->parent() && renderer->node() == &renderer->document() && renderer->document().ownerElement()) | 802 if (!renderer->parent() && renderer->node() == &renderer->document() && renderer->document().ownerElement()) |
803 renderer = renderer->document().ownerElement()->renderer(); | 803 renderer = renderer->document().ownerElement()->renderer(); |
804 else | 804 else |
805 renderer = renderer->parent(); | 805 renderer = renderer->parent(); |
806 } | 806 } |
(...skipping 3903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4710 } | 4710 } |
4711 | 4711 |
4712 if (didSplitParentAnonymousBoxes) | 4712 if (didSplitParentAnonymousBoxes) |
4713 markBoxForRelayoutAfterSplit(this); | 4713 markBoxForRelayoutAfterSplit(this); |
4714 | 4714 |
4715 ASSERT(beforeChild->parent() == this); | 4715 ASSERT(beforeChild->parent() == this); |
4716 return beforeChild; | 4716 return beforeChild; |
4717 } | 4717 } |
4718 | 4718 |
4719 } // namespace WebCore | 4719 } // namespace WebCore |
OLD | NEW |