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
51 lines
1.4 KiB
HTML
51 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
|
<title>Custom Functions: ShadowDOM (cache pitfall)</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-mixins-1/#using-custom-functions">
|
|
<link rel="help" href="https://drafts.csswg.org/css-shadow-1/#css-tree-scoped-reference">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="../resources/utils.js"></script>
|
|
|
|
<style>
|
|
@function --a() { result: 42px; }
|
|
</style>
|
|
|
|
<!-- Should reach --a() defined inside Shadow. -->
|
|
<div id=host1>
|
|
<template shadowrootmode=open>
|
|
<style>
|
|
@function --a() {
|
|
result: 10px;
|
|
}
|
|
div {
|
|
width: --a();
|
|
}
|
|
</style>
|
|
<div id=target></div>
|
|
</template>
|
|
</div>
|
|
|
|
<!--
|
|
Should reach --a() defined at document level. Except for tree-scopes,
|
|
the matched rules look identical for #host1 and #host2; we must not
|
|
hit a cache and cause the same result for both.
|
|
-->
|
|
<div id=host2>
|
|
<template shadowrootmode=open>
|
|
<style>
|
|
div {
|
|
width: --a();
|
|
}
|
|
</style>
|
|
<div id=target></div>
|
|
</template>
|
|
</div>
|
|
|
|
<script>
|
|
test(() => {
|
|
let cs1 = getComputedStyle(host1.shadowRoot.querySelector('#target'));
|
|
let cs2 = getComputedStyle(host2.shadowRoot.querySelector('#target'));
|
|
assert_equals(cs1.width, '10px');
|
|
assert_equals(cs2.width, '42px');
|
|
}, 'Tree scope is respected for otherwise identical styles');
|
|
</script> |