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

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

Issue 1921553008: Fix scroll origin, overflow rects, and coordinate flipping for flexbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add docs to Source/core/layout/README.md Created 4 years, 7 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 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@gmail.com> 9 * Christian Biesinger <cbiesinger@gmail.com>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 int PaintLayerScrollableArea::pixelSnappedScrollHeight() const 585 int PaintLayerScrollableArea::pixelSnappedScrollHeight() const
586 { 586 {
587 return snapSizeToPixel(scrollHeight(), box().clientTop() + box().location(). y()); 587 return snapSizeToPixel(scrollHeight(), box().clientTop() + box().location(). y());
588 } 588 }
589 589
590 void PaintLayerScrollableArea::computeScrollDimensions() 590 void PaintLayerScrollableArea::computeScrollDimensions()
591 { 591 {
592 m_overflowRect = box().layoutOverflowRect(); 592 m_overflowRect = box().layoutOverflowRect();
593 box().flipForWritingMode(m_overflowRect); 593 box().flipForWritingMode(m_overflowRect);
594 594
595 int scrollableLeftOverflow = m_overflowRect.x() - box().borderLeft() - (box( ).shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? box().verticalScrollbarWid th() : 0); 595 LayoutPoint scrollableOverflow = m_overflowRect.location() - LayoutSize(box( ).borderLeft(), box().borderTop());
596 int scrollableTopOverflow = m_overflowRect.y() - box().borderTop(); 596 setScrollOrigin(flooredIntPoint(-scrollableOverflow) + box().originAdjustmen tForScrollbars());
597 setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow));
598 } 597 }
599 598
600 void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPositio n, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior, ScrollType scrollT ype) 599 void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPositio n, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior, ScrollType scrollT ype)
601 { 600 {
602 cancelProgrammaticScrollAnimation(); 601 cancelProgrammaticScrollAnimation();
603 602
604 DoublePoint newScrollPosition = clamp == ScrollOffsetClamped ? clampScrollPo sition(scrollPosition) : scrollPosition; 603 DoublePoint newScrollPosition = clamp == ScrollOffsetClamped ? clampScrollPo sition(scrollPosition) : scrollPosition;
605 if (newScrollPosition != scrollPositionDouble()) 604 if (newScrollPosition != scrollPositionDouble())
606 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollB ehavior); 605 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollB ehavior);
607 } 606 }
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 } 1608 }
1610 1609
1611 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1610 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1612 { 1611 {
1613 visitor->trace(m_scrollableArea); 1612 visitor->trace(m_scrollableArea);
1614 visitor->trace(m_hBar); 1613 visitor->trace(m_hBar);
1615 visitor->trace(m_vBar); 1614 visitor->trace(m_vBar);
1616 } 1615 }
1617 1616
1618 } // namespace blink 1617 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698