1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibHTML: Implement matching for descendant selectors

The CSS engine now correctly matches selectors like "#foo #bar #baz".
This commit is contained in:
Andreas Kling 2019-10-06 15:34:42 +02:00
parent b587eb2f4d
commit 156b35742a
3 changed files with 60 additions and 5 deletions

View file

@ -0,0 +1,32 @@
<html>
<head>
<title>Selector test</title>
<style>
#foo #bar #baz {
background-color: #00ff00;
}
.abc .def div {
background-color: #ffffff;
border-style: solid;
border-width: 1;
border-color: #00ff00;
}
</style>
</head>
<body>
<div id="foo">
<div id="bar">
<div id="baz">
I should have a green background.
</div>
</div>
</div>
<div class="abc">
<div class="def">
<div>hello</div>
<div>hello</div>
<div>hello</div>
</div>
</div>
</body>
</html>

View file

@ -21,6 +21,7 @@ h1 {
<li><a href="lorem.html">lorem ipsum</a></li>
<li><a href="phint.html">presentational hints</a></li>
<li><a href="images.html">images</a></li>
<li><a href="selectors.html">selectors</a></li>
</ul>
</body>
</html>