Skip to content

Commit 88b5cd5

Browse files
committed
Add failing test case
1 parent 9eecd6b commit 88b5cd5

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/php/test-amp-style-sanitizer.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,44 @@ public function get_link_and_style_test_data() {
860860
],
861861
[],
862862
],
863+
'complex_css_values' => [
864+
'
865+
<html>
866+
<head>
867+
<style>
868+
body {
869+
background: green;
870+
width: calc((100vw - 100px) / 2);
871+
height: 100px;
872+
}
873+
</style>
874+
<style>
875+
:where(body) {
876+
width: min(var(--container-max-width), 100% - calc(var(--container-padding) * 2));
877+
margin-inline: auto;
878+
}
879+
</style>
880+
<style>
881+
body {
882+
--wp--preset--font-size--huge: 42px;
883+
--wp--preset--font-size--small: clamp(.875rem,.875rem + ((1vw - .48rem)*0.24),1rem);
884+
--wp--preset--font-size--medium: clamp(1rem,1rem + ((1vw - .48rem)*0.24),1.125rem);
885+
--wp--preset--font-size--large: clamp(1.5rem,1.5rem + ((1vw - .48rem)*0.24),1.625rem);
886+
--wp--preset--font-size--normal: 16px;
887+
}
888+
</style>
889+
</head>
890+
<body>
891+
</body>
892+
</html>
893+
',
894+
[
895+
'body{background:green;width:calc(( 100vw - 100px ) / 2);height:100px}',
896+
':where(body){width:min(var(--container-max-width), 100% - calc(var(--container-padding) * 2));margin-inline:auto}',
897+
'body{--wp--preset--font-size--normal:16px;--wp--preset--font-size--small:clamp(.875rem,.875rem + ((1vw - .48rem)*0.24),1rem);--wp--preset--font-size--medium:clamp(1rem,1rem + ((1vw - .48rem)*0.24),1.125rem);--wp--preset--font-size--large:clamp(1.5rem,1.5rem + ((1vw - .48rem)*0.24),1.625rem);--wp--preset--font-size--normal:16px}',
898+
],
899+
[],
900+
],
863901
];
864902
}
865903

0 commit comments

Comments
 (0)