mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
Tests: Import some calc() serialization tests from WPT
This commit is contained in:
committed by
Andreas Kling
parent
043e96946f
commit
7b13ccabd4
Notes:
github-actions[bot]
2025-02-27 20:43:59 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/7b13ccabd4c Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3719
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Values and Units: calc() serialization.</title>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-values/#calc-serialize">
|
||||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1731">
|
||||
<script src="../../resources/testharness.js"></script>
|
||||
<script src="../../resources/testharnessreport.js"></script>
|
||||
<div id="content"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
// specified -> expected
|
||||
var values = {
|
||||
"calc(10px + 1vmin + 10%)": "calc(10% + 10px + 1vmin)",
|
||||
"calc(10px + 1vmin)": "calc(10px + 1vmin)",
|
||||
"calc(10px + 1em)": "calc(1em + 10px)",
|
||||
"calc(1vmin - 10px)": "calc(-10px + 1vmin)",
|
||||
"calc(-10px + 1em)": "calc(1em - 10px)",
|
||||
"calc(-10px)": "calc(-10px)",
|
||||
};
|
||||
|
||||
var content = document.getElementById("content");
|
||||
|
||||
for (var prop in values) {
|
||||
content.style.width = '';
|
||||
content.style.width = prop;
|
||||
assert_equals(content.style.width, values[prop], "Serialization of " + prop);
|
||||
}
|
||||
}, "calc() serialization")
|
||||
</script>
|
||||
Reference in New Issue
Block a user