Title: [195660] trunk/Source/WebCore
- Revision
- 195660
- Author
- [email protected]
- Date
- 2016-01-27 02:28:49 -0800 (Wed, 27 Jan 2016)
Log Message
Overlay scrollbars should always use the whole contents
https://bugs.webkit.org/show_bug.cgi?id=153352
Reviewed by Michael Catanzaro.
In case of having both horizontal and vertical scrollbars, the
scrollbars respect the scroll corner. That looks good for legacy
scrollbars that show the track, but with the overlay indicators
it looks weird that the indicator stops so early before the end of
the contents, giving the impression that there's something else to
scroll. This happens because the scroll corner is transparent, so
it's not obvious that's the scroll corner. It also happens with
the text areas having a resizer. Legacy scrollbars take into
account the resizer, which is good, but I expect overlay
scrollbars to be rendered also over the resizer. The resizer takes
precedence so you can still click and drag to resize the text area.
In the case of main frame scrollbars we are indeed returning an
empty rectangle from ScrollView::scrollCornerRect() when using
overlay scrollbars, but when calculating the size of the
scrollbars we are using the actual width/height instead of the
occupied with/height. For other scrollbars
RenderLayer::scrollCornerRect() is not checking whether scrollbars
are overlay or not and we are always returning a scroll corner
rectangle when scrollbars are present.
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars): Use the occupied
width/height when calculating the space the one scrollbar
should leave for the other.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollCornerRect): Return an empty
rectangle when using overlay scrollbars.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (195659 => 195660)
--- trunk/Source/WebCore/ChangeLog 2016-01-27 10:24:57 UTC (rev 195659)
+++ trunk/Source/WebCore/ChangeLog 2016-01-27 10:28:49 UTC (rev 195660)
@@ -1,5 +1,40 @@
2016-01-27 Carlos Garcia Campos <[email protected]>
+ Overlay scrollbars should always use the whole contents
+ https://bugs.webkit.org/show_bug.cgi?id=153352
+
+ Reviewed by Michael Catanzaro.
+
+ In case of having both horizontal and vertical scrollbars, the
+ scrollbars respect the scroll corner. That looks good for legacy
+ scrollbars that show the track, but with the overlay indicators
+ it looks weird that the indicator stops so early before the end of
+ the contents, giving the impression that there's something else to
+ scroll. This happens because the scroll corner is transparent, so
+ it's not obvious that's the scroll corner. It also happens with
+ the text areas having a resizer. Legacy scrollbars take into
+ account the resizer, which is good, but I expect overlay
+ scrollbars to be rendered also over the resizer. The resizer takes
+ precedence so you can still click and drag to resize the text area.
+ In the case of main frame scrollbars we are indeed returning an
+ empty rectangle from ScrollView::scrollCornerRect() when using
+ overlay scrollbars, but when calculating the size of the
+ scrollbars we are using the actual width/height instead of the
+ occupied with/height. For other scrollbars
+ RenderLayer::scrollCornerRect() is not checking whether scrollbars
+ are overlay or not and we are always returning a scroll corner
+ rectangle when scrollbars are present.
+
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::updateScrollbars): Use the occupied
+ width/height when calculating the space the one scrollbar
+ should leave for the other.
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollCornerRect): Return an empty
+ rectangle when using overlay scrollbars.
+
+2016-01-27 Carlos Garcia Campos <[email protected]>
+
ScrollAnimator is not notified when mouse entered, moved or exited a RenderListBox
https://bugs.webkit.org/show_bug.cgi?id=153398
Modified: trunk/Source/WebCore/platform/ScrollView.cpp (195659 => 195660)
--- trunk/Source/WebCore/platform/ScrollView.cpp 2016-01-27 10:24:57 UTC (rev 195659)
+++ trunk/Source/WebCore/platform/ScrollView.cpp 2016-01-27 10:28:49 UTC (rev 195660)
@@ -711,7 +711,7 @@
IntRect oldRect(m_horizontalScrollbar->frameRect());
IntRect hBarRect(0,
height() - m_horizontalScrollbar->height(),
- width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
+ width() - (m_verticalScrollbar ? m_verticalScrollbar->occupiedWidth() : 0),
m_horizontalScrollbar->height());
m_horizontalScrollbar->setFrameRect(hBarRect);
if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->frameRect())
@@ -733,7 +733,7 @@
IntRect vBarRect(width() - m_verticalScrollbar->width(),
topContentInset(),
m_verticalScrollbar->width(),
- height() - topContentInset() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
+ height() - topContentInset() - (m_horizontalScrollbar ? m_horizontalScrollbar->occupiedHeight() : 0));
m_verticalScrollbar->setFrameRect(vBarRect);
if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect())
m_verticalScrollbar->invalidate();
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (195659 => 195660)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2016-01-27 10:24:57 UTC (rev 195659)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2016-01-27 10:28:49 UTC (rev 195660)
@@ -2821,12 +2821,13 @@
IntRect RenderLayer::scrollCornerRect() const
{
- // We have a scrollbar corner when a scrollbar is visible and not filling the entire length of the box.
+ // We have a scrollbar corner when a non overlay scrollbar is visible and not filling the entire length of the box.
// This happens when:
- // (a) A resizer is present and at least one scrollbar is present
- // (b) Both scrollbars are present.
- bool hasHorizontalBar = horizontalScrollbar();
- bool hasVerticalBar = verticalScrollbar();
+ // (a) A resizer is present and at least one non overlay scrollbar is present
+ // (b) Both non overlay scrollbars are present.
+ // Overlay scrollbars always fill the entire length of the box so we never have scroll corner in that case.
+ bool hasHorizontalBar = m_hBar && !m_hBar->isOverlayScrollbar();
+ bool hasVerticalBar = m_vBar && !m_vBar->isOverlayScrollbar();
bool hasResizer = renderer().style().resize() != RESIZE_NONE;
if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar || hasVerticalBar)))
return snappedIntRect(cornerRect(this, renderBox()->borderBoxRect()));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes