diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-07-08 19:17:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-08 17:17:48 +0000 |
commit | 77e9e3deba3925e8024719a6c3c54fbd4dddee7a (patch) | |
tree | 3812d8bce7433646b9b92ee493729c3f1b8d5786 /components/layout_2020/table/construct.rs | |
parent | 956b7f62e066f7f01a785a328a05f0f06d70f602 (diff) | |
download | servo-77e9e3deba3925e8024719a6c3c54fbd4dddee7a.tar.gz servo-77e9e3deba3925e8024719a6c3c54fbd4dddee7a.zip |
fonts: Add support for generic font families and font size configuration (#32673)
This adds support for generic font families in Servo and allows for
configuration of them as well as their default font sizes. One
interesting fix here is that now monospace default to 13px, like it does
in other browsers.
In addition to that, this exposes a new interface in Stylo which allows
setting a default style. This is quite useful for fonts, but also for
other kinds of default style settings -- like text zoom.
Fixes #8371.
Fixes #14773.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/layout_2020/table/construct.rs')
-rw-r--r-- | components/layout_2020/table/construct.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/layout_2020/table/construct.rs b/components/layout_2020/table/construct.rs index 8e90cab0e4a..db7d515aa3e 100644 --- a/components/layout_2020/table/construct.rs +++ b/components/layout_2020/table/construct.rs @@ -9,6 +9,7 @@ use std::iter::repeat; use log::warn; use script_layout_interface::wrapper_traits::ThreadSafeLayoutNode; use servo_arc::Arc; +use style::properties::style_structs::Font; use style::properties::ComputedValues; use style::selector_parser::PseudoElement; use style::str::char_is_whitespace; @@ -248,9 +249,11 @@ impl TableBuilder { } pub fn new_for_tests() -> Self { + let testing_style = + ComputedValues::initial_values_with_font_override(Font::initial_values()); Self::new( - ComputedValues::initial_values().to_arc(), - ComputedValues::initial_values().to_arc(), + testing_style.clone(), + testing_style.clone(), BaseFragmentInfo::anonymous(), ) } |