ladybird/Tests/LibWeb/Text/input/css/page-page-orientation.html
Sam Atkins 3a235e9050 LibWeb/CSS: Parse @page bleed, marks, page-orientation descriptors
These don't have WPT tests so I've added some myself.
2025-05-15 09:53:29 +01:00

30 lines
836 B
HTML

<!DOCTYPE html>
<style>
@page {}
</style>
<script src="../include.js"></script>
<script>
test(() => {
let page = document.styleSheets[0].cssRules[0];
const testCases = [
"upright",
"rotate-left",
"rotate-right",
// Invalid
"auto",
"none",
"rotate-left rotate-right",
"90deg"
];
for (let testCase of testCases) {
page.style.removeProperty("page-orientation");
page.style.pageOrientation = testCase;
let parsed = page.style.pageOrientation;
if (parsed.length)
println(`"page-orientation: ${testCase}": parsed as "${parsed}"`);
else
println(`"page-orientation: ${testCase}": INVALID`);
}
});
</script>