Created attachment 307789 [details] testcase Steps to Reproduce: 1. Open attached test page in Safari on iOS 10.3+. 2. Rotate. Expected: all three borders should line up Actual: the borders (green and blue) that are derived from the bounding client rect of the fixed-position element inside onresize/onorientationchange don't line up with the fixed-position element's border.
<rdar://problem/31765167>
We need a way to test rotation.
I don't think testing this is blocked on "a way to test rotation", I'm pretty sure this is just a resize bug. And we have ways to test that.
This regressed in https://trac.webkit.org/changeset/209409/webkit.
(And ToT is OK with Visual Viewports disabled)
It turns out (after hours of debugging) that the problem here is simple: WebPage::dynamicViewportSizeUpdate was not updated to set the layoutViewportOverrideRect instead of the customFixedPositionLayoutRect like WebPage::updateVisibleContentRects was. I have tested after making this change and things are better; I'll make some tests and post a patch.
Created attachment 308144 [details] Patch
Comment on attachment 308144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=308144&action=review > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:-2992 > - frameView.setCustomFixedPositionLayoutRect(fixedPositionLayoutRect); We may want to try to clean this up and share more code between dynamicViewportSizeUpdate and updateVisibleContentRects, but that is a much bigger change that I don't want to make at the moment.
Comment on attachment 308144 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=308144&action=review > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:2994 > + frameView.setLayoutViewportOverrideRect(LayoutRect(fixedPositionLayoutRect)); This is wrong, because fixedPositionLayoutRect comes from frameView.viewportConstrainedObjectsRect(), which is for the old-style fixed behavior, not the visual viewport behavior. We need to get this rect from _page->computeCustomFixedPositionRect().
Created attachment 309262 [details] Patch for EWS
Created attachment 309316 [details] Patch
Created attachment 309323 [details] Patch
Comment on attachment 309323 [details] Patch Clearing flags on attachment: 309323 Committed r216352: <http://trac.webkit.org/changeset/216352>
All reviewed patches have been landed. Closing bug.