Bläddra i källkod

LibWeb: Stop aggressively quantizing font-weight values

Before this change, we were quantizing to either 400, 700 or 900.
This caused us to treat 100/200/300 weighted fonts as if they were
interchangeable.
Andreas Kling 2 år sedan
förälder
incheckning
82ddc813d5
1 ändrade filer med 1 tillägg och 6 borttagningar
  1. 1 6
      Userland/Libraries/LibWeb/CSS/StyleValue.cpp

+ 1 - 6
Userland/Libraries/LibWeb/CSS/StyleValue.cpp

@@ -389,12 +389,7 @@ int StyleValue::to_font_weight() const
         }
         }
     }
     }
     if (has_integer()) {
     if (has_integer()) {
-        int font_weight_integer = to_integer();
-        if (font_weight_integer <= Gfx::FontWeight::Regular)
-            return Gfx::FontWeight::Regular;
-        if (font_weight_integer <= Gfx::FontWeight::Bold)
-            return Gfx::FontWeight::Bold;
-        return Gfx::FontWeight::Black;
+        return to_integer();
     }
     }
     if (is_calculated()) {
     if (is_calculated()) {
         auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();
         auto maybe_weight = const_cast<CalculatedStyleValue&>(as_calculated()).resolve_integer();