1
0
Fork 0
firefox/testing/web-platform/tests/resize-observer/devicepixel2-ref.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

21 lines
760 B
HTML

<!doctype html>
<body>
<script type="module">
import createPatternDataURL from './create-pattern-data-url.js';
const { patternSize, dataURL } = createPatternDataURL();
document.body.style.backgroundImage = `url("${dataURL}")`;
function setBackgroundPatternTo1DevicePixel() {
const oneDevicePixel = 1 / devicePixelRatio;
const patternPixels = oneDevicePixel * patternSize;
document.body.style.backgroundSize = `${patternPixels}px ${patternPixels}px`;
}
setBackgroundPatternTo1DevicePixel();
// If we're viewed interactively and the user activates
// full-page-zoom, changes the page zoom level, or resizes
// the window, update the rendering to account for that:
window.addEventListener('resize', setBackgroundPatternTo1DevicePixel);
</script>
</body>