demo · v131
quirks vs no-quirks PiP mode probe
Before v131, the empty DocPiP document was always quirks-mode. CSS box-sizing, table cell layouts, line-height all behaved subtly different. v131 inherits the opener's compat mode so the PiP body and the host body render identically. This page opens a PiP and reports the resolved compatMode + computed sizes side-by-side.
host document
A test box, 200×60 content size + 12px padding + 2px border:
200×60 content
PiP document
Open the PiP window to populate. The same 200×60 + 12px padding + 2px border applies inside.
the api
const win = await documentPictureInPicture.requestWindow({
width: 320, height: 200,
// v131: this copies opener's document mode + sheets
});
// win.document.compatMode now matches opener
console.log(win.document.compatMode); // "CSS1Compat" (no-quirks)