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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2660423004: Rename EOverflow values with k prefix. (Closed)
Patch Set: Rebase Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 } 620 }
621 621
622 bool PaintLayerScrollableArea::userInputScrollable( 622 bool PaintLayerScrollableArea::userInputScrollable(
623 ScrollbarOrientation orientation) const { 623 ScrollbarOrientation orientation) const {
624 if (box().isIntrinsicallyScrollable(orientation)) 624 if (box().isIntrinsicallyScrollable(orientation))
625 return true; 625 return true;
626 626
627 EOverflow overflowStyle = (orientation == HorizontalScrollbar) 627 EOverflow overflowStyle = (orientation == HorizontalScrollbar)
628 ? box().style()->overflowX() 628 ? box().style()->overflowX()
629 : box().style()->overflowY(); 629 : box().style()->overflowY();
630 return (overflowStyle == EOverflow::Scroll || 630 return (overflowStyle == EOverflow::kScroll ||
631 overflowStyle == EOverflow::Auto || 631 overflowStyle == EOverflow::kAuto ||
632 overflowStyle == EOverflow::Overlay); 632 overflowStyle == EOverflow::kOverlay);
633 } 633 }
634 634
635 bool PaintLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const { 635 bool PaintLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const {
636 return box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); 636 return box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft();
637 } 637 }
638 638
639 int PaintLayerScrollableArea::pageStep(ScrollbarOrientation orientation) const { 639 int PaintLayerScrollableArea::pageStep(ScrollbarOrientation orientation) const {
640 int length = (orientation == HorizontalScrollbar) 640 int length = (orientation == HorizontalScrollbar)
641 ? box().pixelSnappedClientWidth() 641 ? box().pixelSnappedClientWidth()
642 : box().pixelSnappedClientHeight(); 642 : box().pixelSnappedClientHeight();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 updateScrollCornerStyle(); 749 updateScrollCornerStyle();
750 750
751 layer()->updateSelfPaintingLayer(); 751 layer()->updateSelfPaintingLayer();
752 752
753 // Force an update since we know the scrollbars have changed things. 753 // Force an update since we know the scrollbars have changed things.
754 if (box().document().hasAnnotatedRegions()) 754 if (box().document().hasAnnotatedRegions())
755 box().document().setAnnotatedRegionsDirty(true); 755 box().document().setAnnotatedRegionsDirty(true);
756 756
757 // Our proprietary overflow: overlay value doesn't trigger a layout. 757 // Our proprietary overflow: overlay value doesn't trigger a layout.
758 if ((horizontalScrollbarShouldChange && 758 if ((horizontalScrollbarShouldChange &&
759 box().style()->overflowX() != EOverflow::Overlay) || 759 box().style()->overflowX() != EOverflow::kOverlay) ||
760 (verticalScrollbarShouldChange && 760 (verticalScrollbarShouldChange &&
761 box().style()->overflowY() != EOverflow::Overlay)) { 761 box().style()->overflowY() != EOverflow::kOverlay)) {
762 if ((verticalScrollbarShouldChange && box().isHorizontalWritingMode()) || 762 if ((verticalScrollbarShouldChange && box().isHorizontalWritingMode()) ||
763 (horizontalScrollbarShouldChange && 763 (horizontalScrollbarShouldChange &&
764 !box().isHorizontalWritingMode())) { 764 !box().isHorizontalWritingMode())) {
765 box().setPreferredLogicalWidthsDirty(); 765 box().setPreferredLogicalWidthsDirty();
766 } 766 }
767 if (relayoutIsPrevented) { 767 if (relayoutIsPrevented) {
768 // We're not doing re-layout right now, but we still want to 768 // We're not doing re-layout right now, but we still want to
769 // add the scrollbar to the logical width now, to facilitate parent 769 // add the scrollbar to the logical width now, to facilitate parent
770 // layout. 770 // layout.
771 box().updateLogicalWidth(); 771 box().updateLogicalWidth();
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 if (box().isLayoutBlock() && 974 if (box().isLayoutBlock() &&
975 (horizontalScrollbarChanged || verticalScrollbarChanged)) { 975 (horizontalScrollbarChanged || verticalScrollbarChanged)) {
976 toLayoutBlock(box()).scrollbarsChanged( 976 toLayoutBlock(box()).scrollbarsChanged(
977 horizontalScrollbarChanged, verticalScrollbarChanged, 977 horizontalScrollbarChanged, verticalScrollbarChanged,
978 LayoutBlock::ScrollbarChangeContext::StyleChange); 978 LayoutBlock::ScrollbarChangeContext::StyleChange);
979 } 979 }
980 980
981 // With overflow: scroll, scrollbars are always visible but may be disabled. 981 // With overflow: scroll, scrollbars are always visible but may be disabled.
982 // When switching to another value, we need to re-enable them (see bug 11985). 982 // When switching to another value, we need to re-enable them (see bug 11985).
983 if (hasHorizontalScrollbar() && oldStyle && 983 if (hasHorizontalScrollbar() && oldStyle &&
984 oldStyle->overflowX() == EOverflow::Scroll && 984 oldStyle->overflowX() == EOverflow::kScroll &&
985 box().style()->overflowX() != EOverflow::Scroll) { 985 box().style()->overflowX() != EOverflow::kScroll) {
986 horizontalScrollbar()->setEnabled(true); 986 horizontalScrollbar()->setEnabled(true);
987 } 987 }
988 988
989 if (hasVerticalScrollbar() && oldStyle && 989 if (hasVerticalScrollbar() && oldStyle &&
990 oldStyle->overflowY() == EOverflow::Scroll && 990 oldStyle->overflowY() == EOverflow::kScroll &&
991 box().style()->overflowY() != EOverflow::Scroll) { 991 box().style()->overflowY() != EOverflow::kScroll) {
992 verticalScrollbar()->setEnabled(true); 992 verticalScrollbar()->setEnabled(true);
993 } 993 }
994 994
995 // FIXME: Need to detect a swap from custom to native scrollbars (and vice 995 // FIXME: Need to detect a swap from custom to native scrollbars (and vice
996 // versa). 996 // versa).
997 if (horizontalScrollbar()) 997 if (horizontalScrollbar())
998 horizontalScrollbar()->styleChanged(); 998 horizontalScrollbar()->styleChanged();
999 if (verticalScrollbar()) 999 if (verticalScrollbar())
1000 verticalScrollbar()->styleChanged(); 1000 verticalScrollbar()->styleChanged();
1001 1001
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 2113
2114 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2114 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2115 clampScrollableAreas() { 2115 clampScrollableAreas() {
2116 for (auto& scrollableArea : *s_needsClamp) 2116 for (auto& scrollableArea : *s_needsClamp)
2117 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2117 scrollableArea->clampScrollOffsetAfterOverflowChange();
2118 delete s_needsClamp; 2118 delete s_needsClamp;
2119 s_needsClamp = nullptr; 2119 s_needsClamp = nullptr;
2120 } 2120 }
2121 2121
2122 } // namespace blink 2122 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/SpatialNavigation.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698