mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
LibHTML: Implement some attribute selector support
This patch adds a[foo] and a[foo=bar] attribute selectors. Note that an attribute selector is an optional part of a selector component, and not a component on its own.
This commit is contained in:
parent
54a6ae9201
commit
8946e50986
6 changed files with 115 additions and 8 deletions
19
Base/home/anon/www/attrselectors.html
Normal file
19
Base/home/anon/www/attrselectors.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>CSS attribute selector test</title>
|
||||
<style type="text/css">
|
||||
div[id="foo"] {
|
||||
background-color: blue;
|
||||
color: #fff;
|
||||
}
|
||||
div[cool] {
|
||||
background-color: green;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="foo">This div has id="foo" and is bloo!</div>
|
||||
<div cool="">This div has a "cool" attribute and a cool green color.</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue