mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
style: Make viewport-relative units zoomable via "zoom text only"
They're not font relative, so it we probably want them to be zoomed. Differential Revision: https://phabricator.services.mozilla.com/D148796
This commit is contained in:
parent
82d7f2154d
commit
5de65d9f2c
4 changed files with 47 additions and 25 deletions
|
@ -790,6 +790,19 @@ impl NoCalcLength {
|
|||
}
|
||||
}
|
||||
|
||||
/// Whether text-only zoom should be applied to this length.
|
||||
///
|
||||
/// Generally, font-dependent/relative units don't get text-only-zoomed,
|
||||
/// because the font they're relative to should be zoomed already.
|
||||
pub fn should_zoom_text(&self) -> bool {
|
||||
match *self {
|
||||
Self::Absolute(..) |
|
||||
Self::ViewportPercentage(..) => true,
|
||||
Self::ServoCharacterWidth(..) |
|
||||
Self::FontRelative(..) => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse a given absolute or relative dimension.
|
||||
pub fn parse_dimension(
|
||||
context: &ParserContext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue