Commit d7653780 authored by vollick@chromium.org's avatar vollick@chromium.org

Reparented overflow controls host layer must account for scrolling.

The math to position the host layer does not account for scrolling, and
this causes incorrect behavior with nested scrollers.

BUG=None

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

git-svn-id: svn://svn.chromium.org/blink/trunk@185149 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 08a3358b
...@@ -400,6 +400,8 @@ crbug.com/334269 [ Mac ] virtual/antialiasedtext/fast/text/international/zerowid ...@@ -400,6 +400,8 @@ crbug.com/334269 [ Mac ] virtual/antialiasedtext/fast/text/international/zerowid
crbug.com/334269 [ Mac ] virtual/textblob/fast/text/international/zerowidthjoiner.html [ ImageOnlyFailure ] crbug.com/334269 [ Mac ] virtual/textblob/fast/text/international/zerowidthjoiner.html [ ImageOnlyFailure ]
crbug.com/290411 [ Mac ] virtual/antialiasedtext/fast/text/sub-pixel/text-scaling-pixel.html [ Skip ] crbug.com/290411 [ Mac ] virtual/antialiasedtext/fast/text/sub-pixel/text-scaling-pixel.html [ Skip ]
Bug(vollick) [ Mac Win Android ] compositing/scrollbars/nested-overlay-scrollbars.html [ NeedsRebaseline ]
crbug.com/393157 [ Mac ] virtual/threaded/printing/print-document-without-documentElement-crash.html [ Pass Crash ] crbug.com/393157 [ Mac ] virtual/threaded/printing/print-document-without-documentElement-crash.html [ Pass Crash ]
# Switching to content shell failures # Switching to content shell failures
......
{
"bounds": [800, 600],
"children": [
{
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"children": [
{
"position": [8, 8],
"bounds": [404, 404],
"drawsContent": true,
"children": [
{
"position": [2, 2],
"bounds": [400, 400],
"children": [
{
"bounds": [400, 704],
"shouldFlattenTransform": false,
"drawsContent": true,
"children": [
{
"shouldFlattenTransform": false,
"children": [
{
"position": [0, 500],
"bounds": [204, 204],
"drawsContent": true,
"children": [
{
"position": [2, 2],
"bounds": [200, 200],
"children": [
{
"bounds": [5000, 9000],
"shouldFlattenTransform": false,
"drawsContent": true,
"children": [
{
"shouldFlattenTransform": false
}
]
}
]
}
]
},
{
"shouldFlattenTransform": false,
"children": [
{
"position": [2, 502],
"bounds": [100, 800],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#808080"
},
{
"position": [2, 2502],
"bounds": [5000, 1000],
"drawsContent": true
}
]
},
{
"position": [2, 502],
"children": [
{
"position": [2, 195],
"bounds": [193, 7],
"drawsContent": true
},
{
"position": [195, 2],
"bounds": [7, 193],
"drawsContent": true
},
{
"position": [195, 195],
"bounds": [7, 7],
"drawsContent": true
}
]
}
]
}
]
}
]
},
{
"children": [
{
"position": [395, 2],
"bounds": [7, 400],
"drawsContent": true
}
]
}
]
}
]
}
]
}
<!DOCTYPE HTML>
<style>
#outer {
position: absolute;
z-index: 0;
width: 400px;
height: 400px;
border: 2px solid black;
overflow: scroll;
}
#inner {
top: 500px;
width: 200px;
height: 200px;
border: 2px solid black;
overflow-y: scroll;
position: absolute;
}
#scrolled {
width: 2000px;
height: 9000px;
color: papayawhip;
}
#grey {
position: absolute;
background: grey;
width: 100px;
height: 800px;
}
#spacer {
width: 5000px;
height: 1000px;
position: absolute;
top: 2000px;
}
</style>
<script>
if (window.internals) {
window.internals.settings.setOverlayScrollbarsEnabled(true);
window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
}
if (window.testRunner)
window.testRunner.dumpAsTextWithPixelResults();
onload = function() {
document.getElementById("outer").scrollTop = 600;
if (window.internals && window.testRunner)
window.testRunner.setCustomTextOutput(window.internals.layerTreeAsText(document));
};
</script>
<div id="outer">
<div id="inner">
<div id="scrolled">
<div id="grey"></div>
</div>
<div id="spacer"></div>
</div>
...@@ -801,6 +801,8 @@ void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(const Rende ...@@ -801,6 +801,8 @@ void CompositedLayerMapping::updateOverflowControlsHostLayerGeometry(const Rende
m_owningLayer.renderer()->mapLocalToContainer(compositingStackingContext->renderer(), transformState, ApplyContainerFlip); m_owningLayer.renderer()->mapLocalToContainer(compositingStackingContext->renderer(), transformState, ApplyContainerFlip);
transformState.flatten(); transformState.flatten();
LayoutPoint offsetFromStackingContainer = LayoutPoint(transformState.lastPlanarPoint()); LayoutPoint offsetFromStackingContainer = LayoutPoint(transformState.lastPlanarPoint());
if (RenderLayerScrollableArea* scrollableArea = compositingStackingContext->scrollableArea())
offsetFromStackingContainer.move(LayoutSize(scrollableArea->adjustedScrollOffset()));
m_overflowControlsHostLayer->setPosition(FloatPoint(offsetFromStackingContainer)); m_overflowControlsHostLayer->setPosition(FloatPoint(offsetFromStackingContainer));
} }
} else { } else {
......
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