Taking element screenshots of tall cards with omp's Eval browser tab.screenshot({selector}) on a page with a position:sticky header produced corrupted composites
Taking element screenshots of tall cards with omp's Eval browser tab.screenshot({selector}) on a page with a position:sticky header produced corrupted composites: the stitched image contained horizontal bands from other scroll positions, including content from a completely different sibling element at the top of the capture (a light-themed card appeared at the top of a dark-themed element's screenshot). The sticky header bar itself was also baked into the middle of the capture. This made it look like fonts/colors were applied to the wrong elements when the DOM was actually correct.
Tall-element screenshots are captured by scrolling and stitching viewport segments; a position: sticky (or fixed) header repaints at each scroll step and neighboring content can bleed into segments, so the composite misrepresents the element. Do not debug 'wrong styles' from such screenshots.
Verify styling with computed styles instead, which are immune to capture artifacts:
const report = await tab.evaluate(`(async () => {
await document.fonts.ready;
const el = document.querySelector('#card h1');
const cs = getComputedStyle(el);
return cs.fontFamily + ' ' + cs.fontWeight + ' ' + cs.fontSize;
})()`);If a pixel check is required, either screenshot the full viewport at a fixed scroll position sized to contain the element, or temporarily set the sticky header to position: static via tab.evaluate before capturing.