On a page with a fixed positioned element in WKWebView renders the element on the wrong place. This occurs when the element is shown after a user interaction. The element is positioned lower then it should be. This only happens on iOS 10.3 (Safari 10.1). The bug was tested on iPhone 5s and iPhone 7. Link to the github repository https://github.com/WartClaes/ios10.3-bug/tree/master with a simple test case. Link to the demo page http://trbo.be/ios/ # Steps to reproduce 1. On initial load, scroll down so the button is in the middle of the screen 2. Click the button 3. The fixed header is now shown somewhere on the page, but not in it’s intended position 4. If you want to select the text “header”, you can notice that the actual element is still on top where it should be, it is just painted in the wrong place
<rdar://problems/31374008>
Is there any more information about this one?
Seems similar to bug 171413: both use nested position fixed. It's pretty odd that you're making <body> position:fixed with a negative top here.
Created attachment 308781 [details] Simple testcase
This only happens with UI-side compositing, and reproduces on Mac too in that configuration. What's happening is this: The <header> initially is the only fixed element. Its GraphicsLayer gets a position of 0,10. When you scroll, the scrolling tree calls GraphicsLayerCA::syncPosition() which sets various new positions to make fixed position work. However, these positions don't get into PlatformCALayerRemote (they don't need to). When the body becomes fixed, <header> is now parented in another fixed element, so we stop tracking it in the scrolling tree. When we do layout for this change, <header>'s GraphicsLayer gets a setPosition({0, 10}) which is pushed to PlatformCALayerRemote during the flush, but PlatformCALayerRemote doesn't see this as a change (it still has {0,10}) so this change doesn't make it to the UI process, and the UI layer remains with its old scroll-influenced offset.
This also only happens if you have margin:0 on the body.
Created attachment 308857 [details] Patch
Comment on attachment 308857 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=308857&action=review > Source/WebKit2/ChangeLog:9 > + Layers for position:fixed elements are have their positions reconciled after scrolls are have their?
*** Bug 171413 has been marked as a duplicate of this bug. ***
https://trac.webkit.org/r216104
thanks Simon and Tim!