mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 10:57:34 +09:00
Issue #1826 - Canonicalize nested calc() serialization
This commit is contained in:
parent
adde59de74
commit
8af3f489da
2 changed files with 227 additions and 2 deletions
|
|
@ -87,6 +87,25 @@ function parse2dMatrix(transformValue) {
|
|||
|
||||
div.remove();
|
||||
})();
|
||||
|
||||
(function testNestedCalcSpecifiedSerialization() {
|
||||
const div = appendTestNode();
|
||||
const cases = [
|
||||
["left", "calc(calc(20px) + calc(80px))", "calc(100px)"],
|
||||
["left", "calc(calc(2) * calc(50px))", "calc(100px)"],
|
||||
["left", "calc(calc(150px * 2 / 3))", "calc(100px)"],
|
||||
["left", "calc(50px + calc(40%))", "calc(40% + 50px)"],
|
||||
["border", "calc(calc(10px)) solid pink", "calc(10px) solid pink"],
|
||||
];
|
||||
|
||||
for (const [property, input, expected] of cases) {
|
||||
div.style.setProperty(property, input, "");
|
||||
is(div.style.getPropertyValue(property), expected,
|
||||
`${property} should canonicalize nested calc() serialization`);
|
||||
}
|
||||
|
||||
div.remove();
|
||||
})();
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue