1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:47:46 +00:00

LibWeb: Implement and use FontStyleValue

After working with the code for a while, it makes more sense to put all
the parsing in Parser, instead of some of it living in StyleResolver.
That means our current ValueListStyleValue needs to be replaced with
specific StyleValue types for the properties that are shorthands or
otherwise combine several values together.

Here we implement FontStyleProperty, which represents a `font` CSS
property.

Also adjusted the fonts.html test page so that font-weights are featured
in test cases without things we do not yet support.
This commit is contained in:
Sam Atkins 2021-08-03 11:37:24 +01:00 committed by Andreas Kling
parent 5e1fad2dff
commit 59501f1940
5 changed files with 247 additions and 164 deletions

View file

@ -6,8 +6,10 @@
#monospace { font: 20px monospace; }
#a { font: 12pt/14pt sans-serif; }
#b { font: 80% cursive; }
#b2 { font: bold 80% cursive; }
#c { font: x-large/110% fantasy, serif; }
#d { font: 2em SerenitySans; }
#d2 { font: 400 2em SerenitySans; }
#e { font: bold italic large Helvetica, sans-serif; }
#f { font: normal small-caps 120%/120% monospace; }
#g { font: condensed oblique 12pt "Helvetica Neue", serif; }
@ -18,8 +20,10 @@
<div id="monospace">font: 20px monospace;</div>
<div id="a">font: 12pt/14pt sans-serif;</div>
<div id="b">font: 80% cursive;</div>
<div id="b2">font: bold 80% cursive;</div>
<div id="c">font: x-large/110% fantasy, serif;</div>
<div id="d">font: 2em SerenitySans;</div>
<div id="d2">font: 400 2em SerenitySans;</div>
<div id="e">font: bold italic large Helvetica, sans-serif;</div>
<div id="f">font: normal small-caps 120%/120% monospace;</div>
<div id="g">font: condensed oblique 12pt "Helvetica Neue", serif;</div>