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

Side by Side Diff: Source/core/layout/LayerScrollableArea.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayerScrollableArea.h ('k') | Source/core/layout/LayerStackingNode.h » ('j') | 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 int LayerScrollableArea::pageStep(ScrollbarOrientation orientation) const 550 int LayerScrollableArea::pageStep(ScrollbarOrientation orientation) const
551 { 551 {
552 int length = (orientation == HorizontalScrollbar) ? 552 int length = (orientation == HorizontalScrollbar) ?
553 box().pixelSnappedClientWidth() : box().pixelSnappedClientHeight(); 553 box().pixelSnappedClientWidth() : box().pixelSnappedClientHeight();
554 int minPageStep = static_cast<float>(length) * ScrollableArea::minFractionTo StepWhenPaging(); 554 int minPageStep = static_cast<float>(length) * ScrollableArea::minFractionTo StepWhenPaging();
555 int pageStep = max(minPageStep, length - ScrollableArea::maxOverlapBetweenPa ges()); 555 int pageStep = max(minPageStep, length - ScrollableArea::maxOverlapBetweenPa ges());
556 556
557 return max(pageStep, 1); 557 return max(pageStep, 1);
558 } 558 }
559 559
560 RenderBox& LayerScrollableArea::box() const 560 LayoutBox& LayerScrollableArea::box() const
561 { 561 {
562 return *m_layer.renderBox(); 562 return *m_layer.layoutBox();
563 } 563 }
564 564
565 Layer* LayerScrollableArea::layer() const 565 Layer* LayerScrollableArea::layer() const
566 { 566 {
567 return &m_layer; 567 return &m_layer;
568 } 568 }
569 569
570 LayoutUnit LayerScrollableArea::scrollWidth() const 570 LayoutUnit LayerScrollableArea::scrollWidth() const
571 { 571 {
572 if (m_scrollDimensionsDirty) 572 if (m_scrollDimensionsDirty)
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 static bool overflowDefinesAutomaticScrollbar(EOverflow overflow) 751 static bool overflowDefinesAutomaticScrollbar(EOverflow overflow)
752 { 752 {
753 return overflow == OAUTO || overflow == OOVERLAY; 753 return overflow == OAUTO || overflow == OOVERLAY;
754 } 754 }
755 755
756 // This function returns true if the given box requires overflow scrollbars (as 756 // This function returns true if the given box requires overflow scrollbars (as
757 // opposed to the 'viewport' scrollbars managed by the LayerCompositor). 757 // opposed to the 'viewport' scrollbars managed by the LayerCompositor).
758 // FIXME: we should use the same scrolling machinery for both the viewport and 758 // FIXME: we should use the same scrolling machinery for both the viewport and
759 // overflow. Currently, we need to avoid producing scrollbars here if they'll be 759 // overflow. Currently, we need to avoid producing scrollbars here if they'll be
760 // handled externally in the RLC. 760 // handled externally in the RLC.
761 static bool canHaveOverflowScrollbars(const RenderBox& box) 761 static bool canHaveOverflowScrollbars(const LayoutBox& box)
762 { 762 {
763 bool rootLayerScrolls = box.document().settings() && box.document().settings ()->rootLayerScrolls(); 763 bool rootLayerScrolls = box.document().settings() && box.document().settings ()->rootLayerScrolls();
764 return (rootLayerScrolls || !box.isRenderView()) && box.document().viewportD efiningElement() != box.node(); 764 return (rootLayerScrolls || !box.isRenderView()) && box.document().viewportD efiningElement() != box.node();
765 } 765 }
766 766
767 void LayerScrollableArea::updateAfterStyleChange(const LayoutStyle* oldStyle) 767 void LayerScrollableArea::updateAfterStyleChange(const LayoutStyle* oldStyle)
768 { 768 {
769 if (!m_scrollDimensionsDirty) 769 if (!m_scrollDimensionsDirty)
770 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow()); 770 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow());
771 771
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 void LayerScrollableArea::setTopmostScrollChild(Layer* scrollChild) 1382 void LayerScrollableArea::setTopmostScrollChild(Layer* scrollChild)
1383 { 1383 {
1384 // We only want to track the topmost scroll child for scrollable areas with 1384 // We only want to track the topmost scroll child for scrollable areas with
1385 // overlay scrollbars. 1385 // overlay scrollbars.
1386 if (!hasOverlayScrollbars()) 1386 if (!hasOverlayScrollbars())
1387 return; 1387 return;
1388 m_nextTopmostScrollChild = scrollChild; 1388 m_nextTopmostScrollChild = scrollChild;
1389 } 1389 }
1390 1390
1391 } // namespace blink 1391 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayerScrollableArea.h ('k') | Source/core/layout/LayerStackingNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698