Skip to content

Commit e6434e4

Browse files
agorischekCopilot
andauthored
Temporary: device scale 2
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 2258ea4 commit e6434e4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎diag/diag.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ for(const f of fams)for(const size of [12,13,14,16])for(const [name,css] of Obje
2727
out.push({f,size,name,lh:getComputedStyle(el).lineHeight,lines,h:el.getBoundingClientRect().height});el.remove()}
2828
document.title='done';window.__out=out})()
2929
</script></body></html>`
30-
for (const [name, type] of [['webkit', webkit], ['chromium', chromium]]) {
30+
for (const [name, type, scale] of [['webkit', webkit, 2], ['webkit', webkit, 1], ['chromium', chromium, 2]]) {
3131
const browser = await type.launch()
32-
const p = await browser.newPage()
32+
const p = await (await browser.newContext({deviceScaleFactor: scale})).newPage()
3333
await p.setContent(page)
3434
await p.waitForFunction(() => document.title === 'done')
3535
const out = await p.evaluate(() => window.__out)
36-
console.log(`== ${name} ${process.platform} supports lbc: ${await p.evaluate(() => CSS.supports('-webkit-line-box-contain', 'block'))}`)
36+
console.log(`== ${name} dpr=${scale} ${process.platform} supports lbc: ${await p.evaluate(() => CSS.supports('-webkit-line-box-contain', 'block'))}`)
3737
for (const o of out) console.log(`${o.f} ${o.size}px lh=${o.lh} ${o.name.padEnd(22)} lines=${o.lines} h=${o.h.toFixed(5)}`)
3838
await browser.close()
3939
}

0 commit comments

Comments
 (0)