From 82f3228dd20659d7060df6bb10f92deca7df61a9 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 21 Jul 2021 15:39:40 +0100 Subject: [PATCH] LibWeb: Resolve CSS font property from value list The font property now resolves into its various parts: - font-family - font-weight - font-size - font-style - line-height The font-variant and font-stretch parts are left unparsed since LibWeb doesn't know how to render those. Added `fonts.html` as a test for various forms of `font` declarations, based on the examples in the spec. --- Base/res/html/misc/fonts.html | 28 +++ Base/res/html/misc/welcome.html | 1 + .../Libraries/LibWeb/CSS/Identifiers.json | 11 + .../Libraries/LibWeb/CSS/StyleResolver.cpp | 213 +++++++++++++++++- 4 files changed, 251 insertions(+), 2 deletions(-) create mode 100644 Base/res/html/misc/fonts.html diff --git a/Base/res/html/misc/fonts.html b/Base/res/html/misc/fonts.html new file mode 100644 index 0000000000..1218ef8996 --- /dev/null +++ b/Base/res/html/misc/fonts.html @@ -0,0 +1,28 @@ + + + + CSS test + + + +
font: 20px monospace;
+
font: 12pt/14pt sans-serif;
+
font: 80% cursive;
+
font: x-large/110% fantasy, serif;
+
font: 2em SerenitySans;
+
font: bold italic large Helvetica, sans-serif;
+
font: normal small-caps 120%/120% monospace;
+
font: condensed oblique 12pt "Helvetica Neue", serif;
+
font: condensed oblique 25deg 12pt "Helvetica Neue", serif;
+ + diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html index e13f9b9f84..2cb2a2f11c 100644 --- a/Base/res/html/misc/welcome.html +++ b/Base/res/html/misc/welcome.html @@ -48,6 +48,7 @@