Files
sousa-gecko/testing/web-platform/tests/css/css-mixins/functions/function-container-self.html
T
Kevin Babbitt 5b6106a6ae Bug 2053663 [wpt PR 61166] - [css-mixins] Split tests into subdirectories for functions and mixins, a=testonly
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
2026-07-12 11:57:58 +00:00

44 lines
922 B
HTML

<!DOCTYPE html>
<title>Custom Functions: @container can not query self</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>
<style>
#container, #target {
container-type: size;
}
#container {
width: 100px;
height: 100px;
}
#target {
width: 50px;
height: 50px;
}
@function --f() {
result: A;
@container (width = 100px) {
result: B;
}
@container (width = 50px) {
result: C;
}
}
#target {
--actual: --f();
}
</style>
<div id=container>
<div id=target>
</div>
</div>
<script>
test(() => {
// Even though #target is a CQ container, the @container rules should
// not evaluate against that element.
assert_equals(getComputedStyle(target).getPropertyValue('--actual'), 'B');
});
</script>