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

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

Issue 2569013006: Changed EOverflow to an enum class and renamed its members (Closed)
Patch Set: Rebase Created 4 years 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 } 599 }
600 600
601 bool PaintLayerScrollableArea::userInputScrollable( 601 bool PaintLayerScrollableArea::userInputScrollable(
602 ScrollbarOrientation orientation) const { 602 ScrollbarOrientation orientation) const {
603 if (box().isIntrinsicallyScrollable(orientation)) 603 if (box().isIntrinsicallyScrollable(orientation))
604 return true; 604 return true;
605 605
606 EOverflow overflowStyle = (orientation == HorizontalScrollbar) 606 EOverflow overflowStyle = (orientation == HorizontalScrollbar)
607 ? box().style()->overflowX() 607 ? box().style()->overflowX()
608 : box().style()->overflowY(); 608 : box().style()->overflowY();
609 return (overflowStyle == OverflowScroll || overflowStyle == OverflowAuto || 609 return (overflowStyle == EOverflow::Scroll ||
610 overflowStyle == OverflowOverlay); 610 overflowStyle == EOverflow::Auto ||
611 overflowStyle == EOverflow::Overlay);
611 } 612 }
612 613
613 bool PaintLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const { 614 bool PaintLayerScrollableArea::shouldPlaceVerticalScrollbarOnLeft() const {
614 return box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); 615 return box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft();
615 } 616 }
616 617
617 int PaintLayerScrollableArea::pageStep(ScrollbarOrientation orientation) const { 618 int PaintLayerScrollableArea::pageStep(ScrollbarOrientation orientation) const {
618 int length = (orientation == HorizontalScrollbar) 619 int length = (orientation == HorizontalScrollbar)
619 ? box().pixelSnappedClientWidth() 620 ? box().pixelSnappedClientWidth()
620 : box().pixelSnappedClientHeight(); 621 : box().pixelSnappedClientHeight();
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 updateScrollCornerStyle(); 728 updateScrollCornerStyle();
728 729
729 layer()->updateSelfPaintingLayer(); 730 layer()->updateSelfPaintingLayer();
730 731
731 // Force an update since we know the scrollbars have changed things. 732 // Force an update since we know the scrollbars have changed things.
732 if (box().document().hasAnnotatedRegions()) 733 if (box().document().hasAnnotatedRegions())
733 box().document().setAnnotatedRegionsDirty(true); 734 box().document().setAnnotatedRegionsDirty(true);
734 735
735 // Our proprietary overflow: overlay value doesn't trigger a layout. 736 // Our proprietary overflow: overlay value doesn't trigger a layout.
736 if ((horizontalScrollbarShouldChange && 737 if ((horizontalScrollbarShouldChange &&
737 box().style()->overflowX() != OverflowOverlay) || 738 box().style()->overflowX() != EOverflow::Overlay) ||
738 (verticalScrollbarShouldChange && 739 (verticalScrollbarShouldChange &&
739 box().style()->overflowY() != OverflowOverlay)) { 740 box().style()->overflowY() != EOverflow::Overlay)) {
740 if ((verticalScrollbarShouldChange && box().isHorizontalWritingMode()) || 741 if ((verticalScrollbarShouldChange && box().isHorizontalWritingMode()) ||
741 (horizontalScrollbarShouldChange && 742 (horizontalScrollbarShouldChange &&
742 !box().isHorizontalWritingMode())) { 743 !box().isHorizontalWritingMode())) {
743 box().setPreferredLogicalWidthsDirty(); 744 box().setPreferredLogicalWidthsDirty();
744 } 745 }
745 if (relayoutIsPrevented) { 746 if (relayoutIsPrevented) {
746 // We're not doing re-layout right now, but we still want to 747 // We're not doing re-layout right now, but we still want to
747 // add the scrollbar to the logical width now, to facilitate parent 748 // add the scrollbar to the logical width now, to facilitate parent
748 // layout. 749 // layout.
749 box().updateLogicalWidth(); 750 box().updateLogicalWidth();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 if (box().isLayoutBlock() && 949 if (box().isLayoutBlock() &&
949 (horizontalScrollbarChanged || verticalScrollbarChanged)) { 950 (horizontalScrollbarChanged || verticalScrollbarChanged)) {
950 toLayoutBlock(box()).scrollbarsChanged( 951 toLayoutBlock(box()).scrollbarsChanged(
951 horizontalScrollbarChanged, verticalScrollbarChanged, 952 horizontalScrollbarChanged, verticalScrollbarChanged,
952 LayoutBlock::ScrollbarChangeContext::StyleChange); 953 LayoutBlock::ScrollbarChangeContext::StyleChange);
953 } 954 }
954 955
955 // With overflow: scroll, scrollbars are always visible but may be disabled. 956 // With overflow: scroll, scrollbars are always visible but may be disabled.
956 // When switching to another value, we need to re-enable them (see bug 11985). 957 // When switching to another value, we need to re-enable them (see bug 11985).
957 if (hasHorizontalScrollbar() && oldStyle && 958 if (hasHorizontalScrollbar() && oldStyle &&
958 oldStyle->overflowX() == OverflowScroll && 959 oldStyle->overflowX() == EOverflow::Scroll &&
959 box().style()->overflowX() != OverflowScroll) { 960 box().style()->overflowX() != EOverflow::Scroll) {
960 horizontalScrollbar()->setEnabled(true); 961 horizontalScrollbar()->setEnabled(true);
961 } 962 }
962 963
963 if (hasVerticalScrollbar() && oldStyle && 964 if (hasVerticalScrollbar() && oldStyle &&
964 oldStyle->overflowY() == OverflowScroll && 965 oldStyle->overflowY() == EOverflow::Scroll &&
965 box().style()->overflowY() != OverflowScroll) { 966 box().style()->overflowY() != EOverflow::Scroll) {
966 verticalScrollbar()->setEnabled(true); 967 verticalScrollbar()->setEnabled(true);
967 } 968 }
968 969
969 // FIXME: Need to detect a swap from custom to native scrollbars (and vice 970 // FIXME: Need to detect a swap from custom to native scrollbars (and vice
970 // versa). 971 // versa).
971 if (horizontalScrollbar()) 972 if (horizontalScrollbar())
972 horizontalScrollbar()->styleChanged(); 973 horizontalScrollbar()->styleChanged();
973 if (verticalScrollbar()) 974 if (verticalScrollbar())
974 verticalScrollbar()->styleChanged(); 975 verticalScrollbar()->styleChanged();
975 976
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 2034
2034 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2035 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2035 clampScrollableAreas() { 2036 clampScrollableAreas() {
2036 for (auto& scrollableArea : *s_needsClamp) 2037 for (auto& scrollableArea : *s_needsClamp)
2037 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2038 scrollableArea->clampScrollOffsetAfterOverflowChange();
2038 delete s_needsClamp; 2039 delete s_needsClamp;
2039 s_needsClamp = nullptr; 2040 s_needsClamp = nullptr;
2040 } 2041 }
2041 2042
2042 } // namespace blink 2043 } // 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