forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Allow font-family names to start with
-
We achieve this by making properties that accept a custom-ident value skip the "someone else's vendor prefix" check for values that start with a `-` character. This fixes an issue where e.g `font:family: Arial, -apple-system` would be rejected by the parser completely. We now treat `-apple-system` like an identifier in such cases. Also add `valid-types` metadata for the `font-family` property so this actually works. :^)
- Loading branch information
1 parent
c1da8d7
commit d955876
Showing
4 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/css/font-family-with-dash-prefix.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
serif, -apple-system |
9 changes: 9 additions & 0 deletions
9
Tests/LibWeb/Text/input/css/font-family-with-dash-prefix.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script src="../include.js"></script> | ||
<script> | ||
test(() => { | ||
const e = document.createElement("div"); | ||
e.style.fontFamily = 'sans-serif'; | ||
e.style.fontFamily = 'serif, -apple-system'; | ||
println(e.style.fontFamily); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters