Files
Timothy Nikkel 78f289876b Bug 2058388. Allow passing the DrawView flag to drawSnapshot so root scrollbars are painted, and so reftest's snapshot path matches its default one. r=dom-core-reviewers,webrtc-reviewers,devtools-reviewers,webcompat-reviewers,layout-reviewers,jdescottes,twisniewski,emilio,smaug,pehrsons
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
2026-08-06 10:07:04 +00:00
..