Automatic update from web-platform-tests WebKit export of https://bugs.webkit.org/show_bug.cgi?id=315219 (#60103) -- wpt-commits: 6fe8c32a32987ab131eb26137a42f26908093b5d wpt-pr: 60103
34 lines
953 B
HTML
34 lines
953 B
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
|
|
<title>attr() name is case-sensitive on non-HTML elements in HTML documents</title>
|
|
|
|
<link rel="help" href="https://drafts.csswg.org/css-values-5/#typedef-attr-name">
|
|
<link rel="match" href="svg-attr-case-sensitivity-ref.html"/>
|
|
|
|
<style>
|
|
.exact rect {
|
|
fill: attr(myAttr type(<color>), red);
|
|
}
|
|
.lower rect {
|
|
fill: attr(myattr type(<color>), green);
|
|
}
|
|
</style>
|
|
|
|
<p>Test passes if there are two green squares and no red.</p>
|
|
|
|
<svg class="exact" width="100" height="100">
|
|
<rect width="100" height="100"/>
|
|
</svg>
|
|
|
|
<svg class="lower" width="100" height="100">
|
|
<rect width="100" height="100"/>
|
|
</svg>
|
|
|
|
<script>
|
|
// setAttribute preserves case on SVG elements (unlike the HTML parser, which
|
|
// ASCII-lowercases attribute names during tokenization).
|
|
for (const rect of document.querySelectorAll(".exact rect, .lower rect"))
|
|
rect.setAttribute("myAttr", rect.closest(".exact") ? "green" : "red");
|
|
</script>
|