Commit 7dbeb9e5 authored by sataya.m's avatar sataya.m Committed by Commit bot

Draw main frame custom scrollbars in root layer scrolling mode.

Draw main frame custom scrollbars in root layer scrolling mode. On RLS custom
scrollbars are picked from CompositedLayerMapping, Non-RLS  custom scrollbars
are picked from PaintLayerCompositor.

BUG=623853

Review-Url: https://codereview.chromium.org/2198853002
Cr-Commit-Position: refs/heads/master@{#417203}
parent 02f8ca65
layer at (0,0) size 800x600 clip at (0,0) size 788x588 scrollWidth 1008 scrollHeight 1016
LayoutView at (0,0) size 800x600
layer at (0,0) size 788x1016 backgroundClip at (0,0) size 788x588 clip at (0,0) size 788x588
LayoutBlockFlow {HTML} at (0,0) size 788x1016
LayoutBlockFlow {BODY} at (8,8) size 1000x1000
<!DOCTYPE HTML>
<style>
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
-webkit-border-radius: 10px;
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
-webkit-border-radius: 10px;
border-radius: 10px;
background: rgba(255,0,0,0.8);
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
html {
overflow: scroll;
}
body {
width: 1000px;
height: 1000px;
}
</style>
......@@ -2683,14 +2683,19 @@ void FrameView::synchronizedPaint()
if (GraphicsLayer* rootGraphicsLayer = view.compositor()->rootGraphicsLayer()) {
synchronizedPaintRecursively(rootGraphicsLayer);
}
if (GraphicsLayer* layerForHorizontalScrollbar = view.compositor()->layerForHorizontalScrollbar()) {
synchronizedPaintRecursively(layerForHorizontalScrollbar);
}
if (GraphicsLayer* layerForVerticalScrollbar = view.compositor()->layerForVerticalScrollbar()) {
synchronizedPaintRecursively(layerForVerticalScrollbar);
}
if (GraphicsLayer* layerForScrollCorner = view.compositor()->layerForScrollCorner()) {
synchronizedPaintRecursively(layerForScrollCorner);
// TODO(sataya.m):Main frame doesn't create RootFrameViewport in some
// webkit_unit_tests (http://crbug.com/607987).
if (m_viewportScrollableArea) {
if (GraphicsLayer* layerForHorizontalScrollbar = m_viewportScrollableArea->layerForHorizontalScrollbar()) {
synchronizedPaintRecursively(layerForHorizontalScrollbar);
}
if (GraphicsLayer* layerForVerticalScrollbar = m_viewportScrollableArea->layerForVerticalScrollbar()) {
synchronizedPaintRecursively(layerForVerticalScrollbar);
}
if (GraphicsLayer* layerForScrollCorner = m_viewportScrollableArea->layerForScrollCorner()) {
synchronizedPaintRecursively(layerForScrollCorner);
}
}
forAllNonThrottledFrameViews([](FrameView& frameView) {
......
......@@ -302,6 +302,11 @@ GraphicsLayer* RootFrameViewport::layerForVerticalScrollbar() const
return layoutViewport().layerForVerticalScrollbar();
}
GraphicsLayer* RootFrameViewport::layerForScrollCorner() const
{
return layoutViewport().layerForScrollCorner();
}
ScrollResult RootFrameViewport::userScroll(ScrollGranularity granularity, const FloatSize& delta)
{
// TODO(bokan/ymalik): Once smooth scrolling is permanently enabled we
......
......@@ -77,6 +77,7 @@ public:
GraphicsLayer* layerForScrolling() const override;
GraphicsLayer* layerForHorizontalScrollbar() const override;
GraphicsLayer* layerForVerticalScrollbar() const override;
GraphicsLayer* layerForScrollCorner() const override;
ScrollResult userScroll(ScrollGranularity, const FloatSize&) override;
bool scrollAnimatorEnabled() const override;
HostWindow* getHostWindow() const override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment