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

Side by Side Diff: Source/platform/scroll/ScrollView.cpp

Issue 527263002: Clean-up hit-testing of scrollbars (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix scrollbar-ticks-hittest test Created 6 years, 3 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/platform/scroll/ScrollView.h ('k') | Source/web/PopupListBox.cpp » ('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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 if (m_horizontalScrollbar) 675 if (m_horizontalScrollbar)
676 m_horizontalScrollbar->invalidate(); 676 m_horizontalScrollbar->invalidate();
677 if (m_verticalScrollbar) 677 if (m_verticalScrollbar)
678 m_verticalScrollbar->invalidate(); 678 m_verticalScrollbar->invalidate();
679 679
680 // Invalidate the scroll corner too on unsuppress. 680 // Invalidate the scroll corner too on unsuppress.
681 invalidateRect(scrollCornerRect()); 681 invalidateRect(scrollCornerRect());
682 } 682 }
683 } 683 }
684 684
685 Scrollbar* ScrollView::scrollbarAtPoint(const IntPoint& windowPoint) 685 Scrollbar* ScrollView::scrollbarAtWindowPoint(const IntPoint& windowPoint)
686 { 686 {
687 IntPoint viewPoint = convertFromContainingWindow(windowPoint); 687 IntPoint viewPoint = convertFromContainingWindow(windowPoint);
688 return scrollbarAtViewPoint(viewPoint);
689 }
690
691 Scrollbar* ScrollView::scrollbarAtViewPoint(const IntPoint& viewPoint)
692 {
688 if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTe sting() && m_horizontalScrollbar->frameRect().contains(viewPoint)) 693 if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTe sting() && m_horizontalScrollbar->frameRect().contains(viewPoint))
689 return m_horizontalScrollbar.get(); 694 return m_horizontalScrollbar.get();
690 if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTestin g() && m_verticalScrollbar->frameRect().contains(viewPoint)) 695 if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTestin g() && m_verticalScrollbar->frameRect().contains(viewPoint))
691 return m_verticalScrollbar.get(); 696 return m_verticalScrollbar.get();
692 return 0; 697 return 0;
693 } 698 }
694 699
695 void ScrollView::setFrameRect(const IntRect& newRect) 700 void ScrollView::setFrameRect(const IntRect& newRect)
696 { 701 {
697 IntRect oldRect = frameRect(); 702 IntRect oldRect = frameRect();
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 return; 1117 return;
1113 1118
1114 ScrollableArea::setScrollOrigin(origin); 1119 ScrollableArea::setScrollOrigin(origin);
1115 1120
1116 // Update if the scroll origin changes, since our position will be different if the content size did not change. 1121 // Update if the scroll origin changes, since our position will be different if the content size did not change.
1117 if (updatePositionAtAll && updatePositionSynchronously) 1122 if (updatePositionAtAll && updatePositionSynchronously)
1118 updateScrollbars(scrollOffset()); 1123 updateScrollbars(scrollOffset());
1119 } 1124 }
1120 1125
1121 } // namespace blink 1126 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | Source/web/PopupListBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698