mirror of
https://github.com/mozilla-firefox/firefox
synced 2026-08-10 11:48:50 +00:00
drawSnapshot only asked CrossProcessPaint for DrawView when no rect was passed. Without DrawView the paint also gets IgnoreViewportScrolling | DocumentRelative, which makes nsLayoutUtils::PaintFrame set the root scroll container as the display list builder's ignored scroll frame. ScrollContainerFrame::BuildDisplayList then only appends the scroll parts on that path when painting to a window, which a snapshot never is. The reftest harness needs an explicit rect, so it lost the root scrollbars, and drew position:fixed content at the scroll offset while the rest of the page was document relative. The default harness path doesn't have either problem because it calls drawWindow with DRAWWINDOW_DRAW_VIEW. Replace the trailing resetScrollPosition boolean on drawSnapshot with a DrawSnapshotOptions dictionary and add drawView to it, which sets the DrawView flag even when a rect is given. Both reftest harnesses opt in. Every other caller keeps the document relative behaviour it has today, which is what thumbnails, Screenshots, DevTools and tabs.captureTab want; those call sites are mechanically converted from the positional boolean to the dictionary. Differential Revision: https://phabricator.services.mozilla.com/D314618