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
47 lines
1.1 KiB
HTML
47 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<title>Custom Functions: Evaluating a <dashed-function> in standard properties</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-mixins-1/#substitute-a-dashed-function">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<style>
|
|
@function --ten-px() {
|
|
result: 10px;
|
|
}
|
|
|
|
@function --ten-px-typed() returns <length> {
|
|
result: 10px;
|
|
}
|
|
|
|
@function --green() {
|
|
result: green;
|
|
}
|
|
|
|
#target {
|
|
width: --ten-px();
|
|
height: --ten-px-typed();
|
|
color: --green();
|
|
padding: --ten-px();
|
|
}
|
|
</style>
|
|
|
|
<div id=target></div>
|
|
|
|
<script>
|
|
test(() => {
|
|
assert_equals(getComputedStyle(target).width, '10px');
|
|
}, '<dashed-function> in longhand');
|
|
|
|
test(() => {
|
|
assert_equals(getComputedStyle(target).height, '10px');
|
|
}, '<dashed-function> with typed result in longhand');
|
|
|
|
test(() => {
|
|
assert_equals(getComputedStyle(target).color, 'rgb(0, 128, 0)');
|
|
}, '<dashed-function> with in inherited longhand');
|
|
|
|
test(() => {
|
|
assert_equals(getComputedStyle(target).padding, '10px');
|
|
}, '<dashed-function> with typed result in shorthand');
|
|
</script>
|