haikuwebkit/ManualTests/nested-fixed-position.html

94 lines
1.4 KiB
HTML
Raw Permalink Normal View History

[Qt][WK2] Nested fixed elements scroll too fast https://bugs.webkit.org/show_bug.cgi?id=83720 Reviewed by Noam Rosenthal. .: * ManualTests/nested-fixed-position.html: Added. Source/WebCore: Before setting the scrollPositionDelta to a fixed layer, check if it has an ancestor which also has fixed position. If it does, do not set scrollPositionDelta. Added a flag to TextureMapperLayer and GraphicsLayerTextureMapper indicating if it is a fixed position layer. * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: (WebCore::GraphicsLayerTextureMapper::setFixedToViewport): (WebCore::GraphicsLayerTextureMapper::fixedToViewport): (GraphicsLayerTextureMapper): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::syncCompositingStateSelf): (WebCore::TextureMapperLayer::isAncestorFixedToViewport): (WebCore): (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded): * platform/graphics/texmap/TextureMapperLayer.h: (TextureMapperLayer): (WebCore::TextureMapperLayer::setFixedToViewport): Source/WebKit2: Set the fixedToViewport flag on the fixed position layers and adjust to the new function name for setting scrollPositionDelta. * UIProcess/WebLayerTreeRenderer.cpp: (WebKit::WebLayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::WebLayerTreeRenderer::setLayerState): Canonical link: https://commits.webkit.org/101278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-12 15:35:13 +00:00
<html><head>
<meta content="text/html; charset=windows-1251" http-equiv="Content-Type">
<style>
.d1{position:fixed;top:50%;right:50%;z-index:2;overflow:hidden;}
.d2{position:fixed;bottom:0;left:0;z-index:2;width:100%;background-color:darkgray;}
.o {background:green;height:40px;width:200px;}
.t { width:2000px; height:198px;background-color: lightgray; border: 1px solid blue;}
body { margin: 0px; }
</style>
<script>
function remove_fixed()
{
document.getElementById("d2").style.position = "static";
}
function add_fixed()
{
document.getElementById("d2").style.position = "fixed";
}
</script>
</head>
<body>
<div class="d2" id="d2">This is the parent div.
<div class="d1" id="d1"><div class="o">This is the nested div.</div></div>
</div>
<div class="t">
000
</div>
<div class="t">
200
</div>
<div class="t">
400<br>
<button onclick="remove_fixed();">remove fixed</button>
</div>
<div class="t">
600<br>
<button onclick="add_fixed();">add fixed</button>
</div>
<div class="t">
800
</div>
<div class="t">
1000
</div>
<div class="t">
1200
</div>
<div class="t">
1400
</div>
<div class="t">
1600
</div>
<div class="t">
1800
</div>
<div class="t">
2000
</div>
<div class="t">
2200
</div>
<div class="t">
2400
</div>
<div class="t">
2600
</div>
<div class="t">
2800
</div>
<div class="t">
3000
</div>
<div class="t">
3200
</div>
<div class="t">
3400
</div>
<div class="t">
3600
</div>
<div class="t">
3800
</div>
<div class="t">
4000
</div>
</body></html>