Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1389)

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 23450017: Scrolling allowed when overflow:hidden (seen on Acid2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Scrolling allowed when overflow:hidden (seen on Acid2) Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/events/resources/big-page-with-overflow-hidden-and-anchor-scroll.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 return canBeScrolledAndHasScrollableArea();
758 return true;
759
760 // Check for a box that represents the top level of a web page.
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 } 761 }
769 762
770 // If specified point is in border belt, returned offset denotes direction of 763 // If specified point is in border belt, returned offset denotes direction of
771 // scrolling. 764 // scrolling.
772 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con st 765 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) con st
773 { 766 {
774 if (!frame()) 767 if (!frame())
775 return IntSize(); 768 return IntSize();
776 769
777 FrameView* frameView = frame()->view(); 770 FrameView* frameView = frame()->view();
(...skipping 3932 matching lines...) Expand 10 before | Expand all | Expand 10 after
4710 } 4703 }
4711 4704
4712 if (didSplitParentAnonymousBoxes) 4705 if (didSplitParentAnonymousBoxes)
4713 markBoxForRelayoutAfterSplit(this); 4706 markBoxForRelayoutAfterSplit(this);
4714 4707
4715 ASSERT(beforeChild->parent() == this); 4708 ASSERT(beforeChild->parent() == this);
4716 return beforeChild; 4709 return beforeChild;
4717 } 4710 }
4718 4711
4719 } // namespace WebCore 4712 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/resources/big-page-with-overflow-hidden-and-anchor-scroll.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698