Skip to content

Commit

Permalink
Support invalidation of attr()
Browse files Browse the repository at this point in the history
This CL does not include attr() invalidation on pseudo elements, to be
done separately.

Bug: 40320391
Change-Id: I5d0e98d61541f9ea9186684eeb2a4637b47fde46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5672119
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Commit-Queue: Munira Tursunova <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1323798}
  • Loading branch information
tursunova authored and chromium-wpt-export-bot committed Jul 5, 2024
1 parent 6560385 commit 4e3b5de
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions css/css-values/attr-invalidation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!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 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>

0 comments on commit 4e3b5de

Please sign in to comment.