style: Remove font-size calc() hack to propagate keyword information.

It does not make any sense with min() / max() / clamp. So just forget the
keyword info when calc() is used. This also removes a bit of complex / hacky
code.

Differential Revision: https://phabricator.services.mozilla.com/D60663
This commit is contained in:
Emilio Cobos Álvarez 2020-01-22 23:46:24 +00:00
parent 83daa7484d
commit e7e6e62ed3
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
3 changed files with 8 additions and 51 deletions

View file

@ -71,10 +71,6 @@ pub enum FontBaseSize {
CurrentStyle,
/// Use the inherited font-size.
InheritedStyle,
/// Use the inherited font-size, but strip em units.
///
/// FIXME(emilio): This is very complex, and should go away.
InheritedStyleButStripEmUnits,
}
impl FontBaseSize {
@ -82,7 +78,7 @@ impl FontBaseSize {
pub fn resolve(&self, context: &Context) -> computed::Length {
match *self {
FontBaseSize::CurrentStyle => context.style().get_font().clone_font_size().size(),
FontBaseSize::InheritedStyleButStripEmUnits | FontBaseSize::InheritedStyle => {
FontBaseSize::InheritedStyle => {
context.style().get_parent_font().clone_font_size().size()
},
}
@ -144,11 +140,7 @@ impl FontRelativeLength {
}
}
if base_size == FontBaseSize::InheritedStyleButStripEmUnits {
(Zero::zero(), length)
} else {
(reference_font_size, length)
}
(reference_font_size, length)
},
FontRelativeLength::Ex(length) => {
if context.for_non_inherited_property.is_some() {