Files
Munira Tursunova 0ac1e55b19 Bug 1931368 [wpt PR 49173] - Change attr type syntax with recent spec changes, a=testonly
Automatic update from web-platform-tests
Change attr type syntax with recent spec changes

Recent spec resolution [0] introduced the following changes to attr
type syntax:
1. Add type() wrapper around <syntax>
2. Introduce string keyword for explicitly indicating string parsing
3. Add dimension units to attach to a <number>

[0] https://github.com/w3c/csswg-drafts/issues/11035#issuecomment-2474348198

Bug: 369858674, 40320391
Change-Id: I04356918cceaf8445fcdfd896bf3567b2cce792f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6020597
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Commit-Queue: Munira Tursunova <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1383003}

--

wpt-commits: 51ac948eb3f2859dab874d2103c9e14cf4cfd5b5
wpt-pr: 49173
2024-11-16 05:40:11 +00:00

27 lines
803 B
HTML

<!DOCTYPE html>
<title>CSS Values and Units Test: attr() invalidation</title>
<meta name="assert" content="Test attr() invalidation">
<link rel="help" href="https://drafts.csswg.org/css-values/#attr-notation">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
div {
width: attr(data-foo type(<length>));
}
</style>
<html>
<body>
<div id="div" data-foo="10px"></div>
</body>
</html>
<script>
setup({ single_test: true });
let elem = document.getElementById("div");
let old_width = window.getComputedStyle(elem).getPropertyValue("width");
elem.setAttribute("data-foo", "30px");
let new_width = window.getComputedStyle(elem).getPropertyValue("width");
assert_not_equals(new_width, old_width);
done();
</script>