mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Base: Expand test page for CSS attribute selectors
Now that we support more types of attribute selectors in the parser, we need a way to test them. :^)
This commit is contained in:
parent
6034fc0ee6
commit
242c342fad
Notes:
sideshowbarker
2024-07-18 07:42:35 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/242c342fadb Pull-request: https://github.com/SerenityOS/serenity/pull/9073 Reviewed-by: https://github.com/TobyAsE Reviewed-by: https://github.com/alimpfard
1 changed files with 28 additions and 13 deletions
|
@ -1,24 +1,39 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>CSS attribute selector test</title>
|
||||
<style type="text/css">
|
||||
[hello=friends] {
|
||||
background-color: #f0f;
|
||||
color: white;
|
||||
div {
|
||||
background-color: red;
|
||||
}
|
||||
div[id="foo"] {
|
||||
background-color: blue;
|
||||
color: #fff;
|
||||
}
|
||||
div[cool] {
|
||||
background-color: green;
|
||||
color: #ffffff;
|
||||
div[exists],
|
||||
div[exactMatch=" foobarbaz "],
|
||||
div[containsWord~=go],
|
||||
div[containsString*=barb],
|
||||
div[startsWithSegment|=foo],
|
||||
div[startsWithString^=foobar-b],
|
||||
div[endsWithString$=ar-baz] {
|
||||
background-color: lime;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div hello=friends>This div is hello, friends!</div>
|
||||
<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>
|
||||
<h1>These should be green:</h1>
|
||||
<div exists>HasAttribute</div>
|
||||
<div exactMatch=" foobarbaz ">ExactMatch</div>
|
||||
<div containsWord="words go here">ContainsWord</div>
|
||||
<div containsString="foobarbaz">ContainsString</div>
|
||||
<div startsWithSegment="foo-bar-baz">StartsWithSegment</div>
|
||||
<div startsWithString="foobar-baz">StartsWithString</div>
|
||||
<div endsWithString="foobar-baz">EndsWithString</div>
|
||||
|
||||
<h1>These should be red:</h1>
|
||||
<div doesntexist>HasAttribute</div>
|
||||
<div exactMatch="foobarbaz">ExactMatch</div>
|
||||
<div containsWord="words exist here">ContainsWord</div>
|
||||
<div containsString="foobar baz">ContainsString</div>
|
||||
<div startsWithSegment="fool-bar-baz">StartsWithSegment</div>
|
||||
<div startsWithString="fooba-r-baz">StartsWithString</div>
|
||||
<div endsWithString="fooba-r-baz">EndsWithString</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue