style: Make the Gecko font-size calc() code do what it means to do.

It makes no sense to pass a custom base size of zero in presence of rem, ex, or
ch units.

Bug: 1431031
Reviewed-by: Manishearth
MozReview-Commit-ID: 7ZZwRzQKREX
This commit is contained in:
Emilio Cobos Álvarez 2018-01-17 17:20:20 +01:00
parent aee0d694cc
commit 212b2f56c7
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 61 additions and 29 deletions

View file

@ -2505,9 +2505,12 @@ fn static_assert() {
/// Set font size, taking into account scriptminsize and scriptlevel
/// Returns Some(size) if we have to recompute the script unconstrained size
pub fn apply_font_size(&mut self, v: FontSize,
parent: &Self,
device: &Device) -> Option<NonNegativeLength> {
pub fn apply_font_size(
&mut self,
v: FontSize,
parent: &Self,
device: &Device,
) -> Option<NonNegativeLength> {
let (adjusted_size, adjusted_unconstrained_size) =
self.calculate_script_level_size(parent, device);
// In this case, we have been unaffected by scriptminsize, ignore it