Automatic update from web-platform-tests [css-mixins] Split tests into subdirectories for functions and mixins No changes to the test files other than updating relative paths. WEB_FEATURES.yml files were updated to match all files in respective subdirectories. Bug: 406935599 Change-Id: I864e1ad0bb36a5945fd9945365933b3697d3f764 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8061706 Reviewed-by: Alison Maher <almaher@microsoft.com> Commit-Queue: Kevin Babbitt <kbabbitt@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1659001} -- wpt-commits: 5f6046734ece0649fa6f3ad2915ea23ba4d3674a wpt-pr: 61166
424 lines
7.6 KiB
HTML
424 lines
7.6 KiB
HTML
<!DOCTYPE html>
|
|
<title>Custom Functions: Conditionals within @function</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-mixins-1/#conditional-rules">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="../resources/utils.js"></script>
|
|
|
|
<style>
|
|
#container {
|
|
container-type: size;
|
|
width: 100px;
|
|
height: 50px;
|
|
}
|
|
</style>
|
|
<div id=container>
|
|
<div id=target></div>
|
|
<div>
|
|
<div id=main></div>
|
|
|
|
<!-- To pass, a test must produce matching computed values for --actual and
|
|
--expected on #target. -->
|
|
|
|
<template data-name="Basic @supports">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL;
|
|
@supports (width: 100px) {
|
|
result: PASS;
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Basic @supports (false)">
|
|
<style>
|
|
@function --f() {
|
|
result: PASS;
|
|
@supports (not (width: 100px)) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Nested @supports">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL;
|
|
@supports (not (width: red)) {
|
|
@supports (height: 100px) {
|
|
result: PASS;
|
|
}
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Nested @supports (false)">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL-outer;
|
|
@supports (not (width: red)) {
|
|
result: PASS;
|
|
@supports (height: red) {
|
|
result: FAIL-inner;
|
|
}
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Inconsequential conditional">
|
|
<style>
|
|
@function --f() {
|
|
@supports (width: 100px) {
|
|
result: FAIL;
|
|
}
|
|
result: PASS;
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@supports with locals">
|
|
<style>
|
|
@function --f(--x) {
|
|
--y: 2;
|
|
--z: 3;
|
|
@supports (width: 100px) {
|
|
--y: 20;
|
|
}
|
|
result: var(--x) var(--y) var(--z);
|
|
}
|
|
#target {
|
|
--actual: --f(1);
|
|
--expected: 1 20 3;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<!-- @media -->
|
|
|
|
<template data-name="Basic @media">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL;
|
|
@media (width > 0px) {
|
|
result: PASS;
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Basic @media (false)">
|
|
<style>
|
|
@function --f() {
|
|
result: PASS;
|
|
@media (not (width)) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Nested @media">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL;
|
|
@media (width > 0px) {
|
|
@media (not (height: 99999999px)) {
|
|
result: PASS;
|
|
}
|
|
@media (width: 99999999px) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Nested @media (false)">
|
|
<style>
|
|
@function --f() {
|
|
result: PASS;
|
|
@media (not (width > 0px)) {
|
|
@media (not (height: 99999999px)) {
|
|
result: FAIL;
|
|
}
|
|
@media (width: 99999999px) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Locals within @media">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@media (width > 0px) {
|
|
--x: PASS;
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@supports within @media">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@media (width > 0px) {
|
|
@supports (color: green) {
|
|
--x: PASS;
|
|
}
|
|
@supports (not (color: green)) {
|
|
--x: FAIL;
|
|
}
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@media within @supports">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@supports (color: green) {
|
|
@media (width > 0px) {
|
|
--x: PASS;
|
|
}
|
|
@media (width = 99999999999px) {
|
|
--x: FAIL;
|
|
}
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
|
|
<!-- @container -->
|
|
|
|
<template data-name="Basic @container">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL;
|
|
@container (width = 100px) {
|
|
result: PASS;
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Basic @container (false)">
|
|
<style>
|
|
@function --f() {
|
|
result: PASS;
|
|
@container (width = 110px) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Nested @container">
|
|
<style>
|
|
@function --f() {
|
|
result: FAIL;
|
|
@container (width = 100px) {
|
|
@container (not (height = 75px)) {
|
|
result: PASS;
|
|
}
|
|
@container (height: 75px) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Nested @container (false)">
|
|
<style>
|
|
@function --f() {
|
|
result: PASS;
|
|
@container (width = 200px) {
|
|
@container (not (height = 75px)) {
|
|
result: FAIL;
|
|
}
|
|
@container (width: 75px) {
|
|
result: FAIL;
|
|
}
|
|
}
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="Locals within @container">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@container (width = 100px) {
|
|
--x: PASS;
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@supports within @container">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@container (width = 100px) {
|
|
@supports (color: green) {
|
|
--x: PASS;
|
|
}
|
|
@supports (not (color: green)) {
|
|
--x: FAIL;
|
|
}
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@container within @supports">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@supports (color: green) {
|
|
@container (width = 100px) {
|
|
--x: PASS;
|
|
}
|
|
@container (width = 75px) {
|
|
--x: FAIL;
|
|
}
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@container, @media, @supports">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@container (width = 100px) {
|
|
@media (width > 0px) {
|
|
@supports (color: red) {
|
|
--x: PASS;
|
|
}
|
|
}
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<template data-name="@supports, @media, @container">
|
|
<style>
|
|
@function --f() {
|
|
--x: FAIL;
|
|
@supports (color: red) {
|
|
@media (width > 0px) {
|
|
@container (width = 100px) {
|
|
--x: PASS;
|
|
}
|
|
}
|
|
}
|
|
result: var(--x);
|
|
}
|
|
#target {
|
|
--actual: --f();
|
|
--expected: PASS;
|
|
}
|
|
</style>
|
|
</template>
|
|
|
|
<script>
|
|
test_all_templates();
|
|
</script>
|