mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Parse @property CSS directives
This is not a complete parse, as it doesn't validate or take into account the parsed syntax. Enough to get us a few more WPT tests though :)
This commit is contained in:
committed by
Sam Atkins
parent
50d64b0fb7
commit
a4c72f50c0
Notes:
github-actions[bot]
2024-10-23 05:56:40 +00:00
Author: https://github.com/a-ungurianu Commit: https://github.com/LadybirdBrowser/ladybird/commit/a4c72f50c0a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1777 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<style>
|
||||
@property badname {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
initial-value: blue;
|
||||
}
|
||||
|
||||
@property --extra-syntax-tokens {
|
||||
syntax: "*" "bad";
|
||||
inherits: false;
|
||||
initial-value: blue;
|
||||
}
|
||||
|
||||
@property --extra-inherits-tokens {
|
||||
syntax: "*";
|
||||
inherits: false "bad";
|
||||
initial-value: blue;
|
||||
}
|
||||
|
||||
@property --missing-syntax {
|
||||
inherits: false;
|
||||
initial-value: blue;
|
||||
}
|
||||
|
||||
@property --missing-inherits {
|
||||
syntax: "*";
|
||||
initial-value: blue;
|
||||
}
|
||||
|
||||
@property --valid {
|
||||
syntax: "*";
|
||||
inherits: false;
|
||||
}
|
||||
</style>
|
||||
<div>This text shouldn't be visible</div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const cssRuleCount = document.styleSheets[0].cssRules.length;
|
||||
|
||||
println(`Number of parsed css rules: ${cssRuleCount} (expected: 1)`);
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user