Commit 35ffbe75 authored by vollick@chromium.org's avatar vollick@chromium.org

Do not create scrollbars if the subtree is invisible.

BUG=514595

Review URL: https://codereview.chromium.org/1297323002

git-svn-id: svn://svn.chromium.org/blink/trunk@200866 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 436a732b
<!DOCTYPE HTML>
<style>
#scroller {
width: 100px;
height: 100px;
overflow: scroll;
visibility: hidden;
}
#scrolled {
width: 10px;
height: 10px;
position: relative;
background: blue;
visibility: hidden;
top: 300px;
}
</style>
<div id="scroller">
<div id="scrolled"></div>
</div>
<!DOCTYPE HTML>
<style>
@-webkit-keyframes boring {
0% { transform: translateZ(0px); }
100% { transform: translateZ(0px); }
}
#scroller {
width: 100px;
height: 100px;
overflow: scroll;
animation: boring 5s infinite;
visibility: hidden;
}
#scrolled {
width: 10px;
height: 10px;
position: relative;
background: blue;
visibility: hidden;
top: 300px;
}
</style>
<div id="scroller">
<div id="scrolled"></div>
</div>
......@@ -1290,6 +1290,12 @@ bool CompositedDeprecatedPaintLayerMapping::toggleScrollbarLayerIfNeeded(OwnPtr<
bool CompositedDeprecatedPaintLayerMapping::updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer, bool needsAncestorClip)
{
// If the subtree is invisible, we don't actually need scrollbar layers.
bool invisible = m_owningLayer.subtreeIsInvisible();
needsHorizontalScrollbarLayer &= !invisible;
needsVerticalScrollbarLayer &= !invisible;
needsScrollCornerLayer &= !invisible;
bool horizontalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForHorizontalScrollbar, needsHorizontalScrollbarLayer, CompositingReasonLayerForHorizontalScrollbar);
bool verticalScrollbarLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForVerticalScrollbar, needsVerticalScrollbarLayer, CompositingReasonLayerForVerticalScrollbar);
bool scrollCornerLayerChanged = toggleScrollbarLayerIfNeeded(m_layerForScrollCorner, needsScrollCornerLayer, CompositingReasonLayerForScrollCorner);
......
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