haikuwebkit/ManualTests/fixed-position.html

93 lines
1.5 KiB
HTML
Raw Permalink Normal View History

Initial support for fixed position elements in Qt WebKit2 https://bugs.webkit.org/show_bug.cgi?id=81786 Reviewed by Noam Rosenthal. .: * ManualTests/fixed-position.html: Added. Source/WebCore: When the setting acceleratedCompositingForFixedPositionEnabled is true, we update the position of fixed layers, and send updates to the UI process as we scroll. Before painting, TextureMapperLayer receives a delta of the scroll positions between the UI and the web processes, and adjusts its transform position accordingly. * page/FrameView.cpp: (WebCore::FrameView::setFixedVisibleContentRect): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::setScrollPositionDelta): (WebCore): * platform/graphics/texmap/TextureMapperLayer.h: (TextureMapperLayer): Source/WebKit2: Turn on the flag acceleratedCompositingForFixedPositionEnabled when using fixed layout. As we scroll, we keep track of the delta in scroll position between the UI and web processes, and adjust the position of all the fixed layers by that delta. When WebLayerTreeRenderer receives a new scroll position from the web process, it keeps it as pending, and commit the new scroll position in flushLayerChanges. This patch does not address scrolling overshoot and it does not fix the wrong positioning that occurs when we zoom. These issues will be addressed in future patches. * Shared/WebLayerTreeInfo.h: * UIProcess/API/qt/qquickwebpage.cpp: (QQuickWebPagePrivate::updateSize): * UIProcess/LayerTreeHostProxy.cpp: (WebKit::LayerTreeHostProxy::setContentsSize): (WebKit): (WebKit::LayerTreeHostProxy::renderNextFrame): (WebKit::LayerTreeHostProxy::didChangeScrollPosition): * UIProcess/LayerTreeHostProxy.h: (LayerTreeHostProxy): * UIProcess/LayerTreeHostProxy.messages.in: * UIProcess/WebLayerTreeRenderer.cpp: (WebKit::boundedScrollPosition): (WebKit): (WebKit::WebLayerTreeRenderer::paintToCurrentGLContext): (WebKit::WebLayerTreeRenderer::setContentsSize): (WebKit::WebLayerTreeRenderer::adjustPositionForFixedLayers): (WebKit::WebLayerTreeRenderer::didChangeScrollPosition): (WebKit::WebLayerTreeRenderer::syncLayerParameters): (WebKit::WebLayerTreeRenderer::deleteLayer): (WebKit::WebLayerTreeRenderer::flushLayerChanges): * UIProcess/WebLayerTreeRenderer.h: (WebLayerTreeRenderer): * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp: (WebCore::WebGraphicsLayer::WebGraphicsLayer): (WebCore::WebGraphicsLayer::syncCompositingState): (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly): * WebProcess/WebCoreSupport/WebGraphicsLayer.h: (WebGraphicsLayerClient): (WebCore::WebGraphicsLayer::fixedToViewport): (WebCore::WebGraphicsLayer::setFixedToViewport): (WebGraphicsLayer): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setResizesToContentsUsingLayoutSize): * WebProcess/WebPage/qt/LayerTreeHostQt.cpp: (WebKit::LayerTreeHostQt::LayerTreeHostQt): (WebKit::LayerTreeHostQt::didSyncCompositingStateForLayer): (WebKit::updateOffsetFromViewportForSelf): (WebKit): (WebKit::updateOffsetFromViewportForLayer): (WebKit::LayerTreeHostQt::syncFixedLayers): (WebKit::LayerTreeHostQt::setVisibleContentsRect): * WebProcess/WebPage/qt/LayerTreeHostQt.h: (LayerTreeHostQt): Canonical link: https://commits.webkit.org/101090@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-04-10 23:40:51 +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:5em;left:50;z-index:2;overflow:hidden;}
.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("d1").style.position = "static";
}
function change_fixed()
{
document.getElementById("d2").style.bottom = "10em";
}
</script>
</head>
<body class="Gradient">
<div class="d1" id="d1"><div class="o">This is a test</div></div>
<div class="d2" id="d2"><div class="o">This is a test</div></div>
<div class="t" onclick="remove_fixed();">
000
</div>
<div class="t">
200<br>
<button onclick="remove_fixed();">remove fixed</button>
</div>
<div class="t">
400<br>
<button onclick="change_fixed();">change fixed</button>
</div>
<div class="t">
600
</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>