mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-28 05:07:35 +00:00
LibWeb: Serialize more @font-face
descriptors
Adapt the existing `font-face-src-local-serialization.html` test into a more general test for these.
This commit is contained in:
parent
e43f3e4808
commit
c497e5f850
Notes:
github-actions[bot]
2024-10-02 15:37:27 +00:00
Author: https://github.com/AtkinsSJ
Commit: c497e5f850
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1599
5 changed files with 105 additions and 19 deletions
30
Tests/LibWeb/Text/input/css/font-face-serialization.html
Normal file
30
Tests/LibWeb/Text/input/css/font-face-serialization.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let testCases = [
|
||||
// src
|
||||
// - local()
|
||||
"@font-face { font-family: 'a1'; src: local('xyz'); }",
|
||||
|
||||
// font-feature-settings is sorted by tag
|
||||
"@font-face { font-family: 'b1'; font-feature-settings: 'bbbb' 0, 'aaaa', 'zzzz' 1, 'yyyy' 3; }",
|
||||
// font-feature-settings deduplicates tags, keeping the last value
|
||||
"@font-face { font-family: 'b2'; font-feature-settings: 'aaaa', 'aaaa' 0, 'aaaa' 3; }",
|
||||
|
||||
// font-width
|
||||
"@font-face { font-family: 'c1'; font-width: extra-condensed; }",
|
||||
"@font-face { font-family: 'c2'; font-width: 50%; }",
|
||||
// - font-stretch is a legacy alias for font-width
|
||||
"@font-face { font-family: 'c3'; font-stretch: extra-condensed; }",
|
||||
"@font-face { font-family: 'c4'; font-stretch: 50%; }",
|
||||
];
|
||||
for (let testCase of testCases) {
|
||||
let style = document.createElement("style");
|
||||
style.innerText = testCase;
|
||||
document.head.appendChild(style);
|
||||
let sheet = style.sheet;
|
||||
println(sheet.cssRules[0].cssText);
|
||||
style.remove();
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue