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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1754033002: ScrollableArea::pixelStep should return DIP not viewport (physical pixels) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 return std::max(pageStep, 1); 607 return std::max(pageStep, 1);
608 } 608 }
609 609
610 int ScrollableArea::documentStep(ScrollbarOrientation orientation) const 610 int ScrollableArea::documentStep(ScrollbarOrientation orientation) const
611 { 611 {
612 return scrollSize(orientation); 612 return scrollSize(orientation);
613 } 613 }
614 614
615 float ScrollableArea::pixelStep(ScrollbarOrientation) const 615 float ScrollableArea::pixelStep(ScrollbarOrientation) const
616 { 616 {
617 if (HostWindow* window = hostWindow())
618 return window->windowToViewportScalar(1);
619 return 1; 617 return 1;
620 } 618 }
621 619
622 IntSize ScrollableArea::excludeScrollbars(const IntSize& size) const 620 IntSize ScrollableArea::excludeScrollbars(const IntSize& size) const
623 { 621 {
624 int verticalScrollbarWidth = 0; 622 int verticalScrollbarWidth = 0;
625 int horizontalScrollbarHeight = 0; 623 int horizontalScrollbarHeight = 0;
626 624
627 if (Scrollbar* verticalBar = verticalScrollbar()) 625 if (Scrollbar* verticalBar = verticalScrollbar())
628 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; 626 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0;
629 if (Scrollbar* horizontalBar = horizontalScrollbar()) 627 if (Scrollbar* horizontalBar = horizontalScrollbar())
630 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; 628 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0;
631 629
632 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), 630 return IntSize(std::max(0, size.width() - verticalScrollbarWidth),
633 std::max(0, size.height() - horizontalScrollbarHeight)); 631 std::max(0, size.height() - horizontalScrollbarHeight));
634 } 632 }
635 633
636 DEFINE_TRACE(ScrollableArea) 634 DEFINE_TRACE(ScrollableArea)
637 { 635 {
638 visitor->trace(m_scrollAnimator); 636 visitor->trace(m_scrollAnimator);
639 visitor->trace(m_programmaticScrollAnimator); 637 visitor->trace(m_programmaticScrollAnimator);
640 } 638 }
641 639
642 } // namespace blink 640 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200withzoom/fast/hidpi/static/mousewheel-scroll-amount-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698