Chromium Code Reviews| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 746 } | 746 } |
| 747 | 747 |
| 748 bool RenderBox::autoscrollInProgress() const | 748 bool RenderBox::autoscrollInProgress() const |
| 749 { | 749 { |
| 750 return frame() && frame()->page() && frame()->page()->autoscrollInProgress(t his); | 750 return frame() && frame()->page() && frame()->page()->autoscrollInProgress(t his); |
| 751 } | 751 } |
| 752 | 752 |
| 753 // There are two kinds of renderer that can autoscroll. | 753 // There are two kinds of renderer that can autoscroll. |
| 754 bool RenderBox::canAutoscroll() const | 754 bool RenderBox::canAutoscroll() const |
| 755 { | 755 { |
| 756 if (node() && node()->isDocumentNode()) | |
| 757 return view()->frameView()->isScrollable(); | |
| 758 | |
| 756 // Check for a box that can be scrolled in its own right. | 759 // Check for a box that can be scrolled in its own right. |
| 757 if (canBeScrolledAndHasScrollableArea()) | 760 if (canBeScrolledAndHasScrollableArea()) |
| 758 return true; | 761 return true; |
| 759 | 762 |
| 760 // Check for a box that represents the top level of a web page. | 763 return false; |
|
Julien - ping for review
2013/09/04 20:50:36
How about just
return canBeScrolledAndHasScrollab
| |
| 761 if (node() != &document()) | |
| 762 return false; | |
| 763 Frame* frame = this->frame(); | |
| 764 if (!frame) | |
| 765 return false; | |
| 766 Page* page = frame->page(); | |
| 767 return page && page->mainFrame() == frame && frame->view()->isScrollable(); | |
| 768 } | 764 } |
| 769 | 765 |
| 770 // If specified point is in border belt, returned offset denotes direction of | 766 // If specified point is in border belt, returned offset denotes direction of |
| 771 // scrolling. | 767 // scrolling. |
| 772 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con st | 768 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con st |
| 773 { | 769 { |
| 774 if (!frame()) | 770 if (!frame()) |
| 775 return IntSize(); | 771 return IntSize(); |
| 776 | 772 |
| 777 FrameView* frameView = frame()->view(); | 773 FrameView* frameView = frame()->view(); |
| (...skipping 3932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4710 } | 4706 } |
| 4711 | 4707 |
| 4712 if (didSplitParentAnonymousBoxes) | 4708 if (didSplitParentAnonymousBoxes) |
| 4713 markBoxForRelayoutAfterSplit(this); | 4709 markBoxForRelayoutAfterSplit(this); |
| 4714 | 4710 |
| 4715 ASSERT(beforeChild->parent() == this); | 4711 ASSERT(beforeChild->parent() == this); |
| 4716 return beforeChild; | 4712 return beforeChild; |
| 4717 } | 4713 } |
| 4718 | 4714 |
| 4719 } // namespace WebCore | 4715 } // namespace WebCore |
| OLD | NEW |