Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: snapshot
- Manifest: layout/reftests/meta-viewport/reftest.list
<!DOCTYPE html>
<html class="reftest-wait">
<style>
html {
height: 100%;
width: 100%;
}
body {
height: 2000px;
width: 200%;
margin: 0px;
padding: 0px;
}
div {
width: 20px;
height: 100%;
top: 0px;
background-color: green;
}
</style>
<div style="right: 0px; position: fixed;"></div>
<div style="right: 25px; position: absolute;"></div>
<script>
async function go() {
let win = SpecialPowers.wrap(window);
let origVal = await SpecialPowers.spawnChrome([win.browsingContext.id],
id => {
// We enable 'forceDesktopViewport' (which is otherwise off-by-default)
// and we test our rendering under that condition. It's important that we
// are followed by reftest "desktop-mode-cleanup.html" which will revert
// this change for us, so that forceDesktopViewport doesn't remain on for
// subsequent tests.
let ctx = BrowsingContext.get(id);
let origVal = ctx.forceDesktopViewport;
ctx.forceDesktopViewport = true;
return origVal;
});
if (origVal) {
// UNEXPECTED: if we get here, then forceDesktopViewport was somehow
// true already (when it should be at its default 'false')! Either we've
// got the wrong assumption about the default value, or some earlier test
// enabled it and forgot to clean up after themselves.
//
// NOTE: We could signal a test-failure in this circumstance,
// by e.g. setting the background to red...
// document.body.style.background = "red";
// ...but that also makes this test trivially fail in 'test-verify' runs
// So for now, we handle this unexpected condition silently/gracefully.
// I'm leaving this (no-op) if-check in the test in case it's useful
// for debugging/logging at some point, though.
}
document.documentElement.classList.remove('reftest-wait');
}
go();
</script>
</html>