LibWeb: Ensure |= value selector handles multiple segments correctly

Previously, the `|=` would not compare strings containing `-`
characters correctly because it would only compare the element
attribute up to the first `-` character.
This commit is contained in:
Tim Ledbetter 2025-04-27 12:53:58 +01:00 committed by Sam Atkins
commit 74c803c87b
Notes: github-actions[bot] 2025-04-28 10:30:50 +00:00
5 changed files with 148 additions and 4 deletions

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference</title>
<style>
.green {
background-color: green;
color: white;
}
</style>
<body>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<p class="green">This line should be green <em>and this should be green too</em></p>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green<p>This line should NOT be green</p></div>
<p>This line should NOT be green <em>and this should not be green either</em></p>
</body>

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference</title>
<style>
.green {
background-color: green;
color: white;
}
</style>
<body>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<div class="green">This line should be green</div>
<p class="green">This line should be green <em>and this should be green too</em></p>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green</div>
<div>This line should NOT be green<p>This line should NOT be green</p></div>
<p>This line should NOT be green <em>and this should not be green either</em></p>
</body>