Changeset 195660 in webkit
- Timestamp:
- Jan 27, 2016 2:28:49 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r195659 r195660 1 2016-01-27 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Overlay scrollbars should always use the whole contents 4 https://bugs.webkit.org/show_bug.cgi?id=153352 5 6 Reviewed by Michael Catanzaro. 7 8 In case of having both horizontal and vertical scrollbars, the 9 scrollbars respect the scroll corner. That looks good for legacy 10 scrollbars that show the track, but with the overlay indicators 11 it looks weird that the indicator stops so early before the end of 12 the contents, giving the impression that there's something else to 13 scroll. This happens because the scroll corner is transparent, so 14 it's not obvious that's the scroll corner. It also happens with 15 the text areas having a resizer. Legacy scrollbars take into 16 account the resizer, which is good, but I expect overlay 17 scrollbars to be rendered also over the resizer. The resizer takes 18 precedence so you can still click and drag to resize the text area. 19 In the case of main frame scrollbars we are indeed returning an 20 empty rectangle from ScrollView::scrollCornerRect() when using 21 overlay scrollbars, but when calculating the size of the 22 scrollbars we are using the actual width/height instead of the 23 occupied with/height. For other scrollbars 24 RenderLayer::scrollCornerRect() is not checking whether scrollbars 25 are overlay or not and we are always returning a scroll corner 26 rectangle when scrollbars are present. 27 28 * platform/ScrollView.cpp: 29 (WebCore::ScrollView::updateScrollbars): Use the occupied 30 width/height when calculating the space the one scrollbar 31 should leave for the other. 32 * rendering/RenderLayer.cpp: 33 (WebCore::RenderLayer::scrollCornerRect): Return an empty 34 rectangle when using overlay scrollbars. 35 1 36 2016-01-27 Carlos Garcia Campos <cgarcia@igalia.com> 2 37 -
trunk/Source/WebCore/platform/ScrollView.cpp
r194515 r195660 712 712 IntRect hBarRect(0, 713 713 height() - m_horizontalScrollbar->height(), 714 width() - (m_verticalScrollbar ? m_verticalScrollbar-> width() : 0),714 width() - (m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0), 715 715 m_horizontalScrollbar->height()); 716 716 m_horizontalScrollbar->setFrameRect(hBarRect); … … 734 734 topContentInset(), 735 735 m_verticalScrollbar->width(), 736 height() - topContentInset() - (m_horizontalScrollbar ? m_horizontalScrollbar-> height() : 0));736 height() - topContentInset() - (m_horizontalScrollbar ? m_horizontalScrollbar->occupiedHeight() : 0)); 737 737 m_verticalScrollbar->setFrameRect(vBarRect); 738 738 if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect()) -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r195453 r195660 2822 2822 IntRect RenderLayer::scrollCornerRect() const 2823 2823 { 2824 // We have a scrollbar corner when a scrollbar is visible and not filling the entire length of the box.2824 // We have a scrollbar corner when a non overlay scrollbar is visible and not filling the entire length of the box. 2825 2825 // This happens when: 2826 // (a) A resizer is present and at least one scrollbar is present 2827 // (b) Both scrollbars are present. 2828 bool hasHorizontalBar = horizontalScrollbar(); 2829 bool hasVerticalBar = verticalScrollbar(); 2826 // (a) A resizer is present and at least one non overlay scrollbar is present 2827 // (b) Both non overlay scrollbars are present. 2828 // Overlay scrollbars always fill the entire length of the box so we never have scroll corner in that case. 2829 bool hasHorizontalBar = m_hBar && !m_hBar->isOverlayScrollbar(); 2830 bool hasVerticalBar = m_vBar && !m_vBar->isOverlayScrollbar(); 2830 2831 bool hasResizer = renderer().style().resize() != RESIZE_NONE; 2831 2832 if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar || hasVerticalBar)))
Note: See TracChangeset
for help on using the changeset viewer.