stylo: We scale the font-size too much while inheriting it

RESOLVED FIXED

Status

()

Core
CSS Parsing and Computation
P2
normal
RESOLVED FIXED
6 months ago
5 months ago

People

(Reporter: emilio, Assigned: manishearth)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 months ago
See bug 1361126 comment 5, which makes this apparent.

I lost track of how this is supposed to work, and I'm fed up with a bunch of other stuff, so I hope Manish (who wrote it) or Cameron (who reviewed it) can take over this.

In particular, when we explicitly inherit font-size (which we do too much right now), we have code that looks like:

let kw_inherited_size = context.style().font_size_keyword.map(|(kw, ratio)| {
    SpecifiedValue::Keyword(kw, ratio).to_computed_value(context)
});

That Keyword(..).to_computed_value() scales the font-size if ratio is not one, which looks quite wrong to me when we inherit because of unrelated reasons.
(Assignee)

Comment 1

6 months ago
> That Keyword(..).to_computed_value() scales the font-size if ratio is not one, which looks quite wrong to me when we inherit because of unrelated reasons.

It doesn't, it scales the base size to obtain the font size; it doesn't rescale the inherited size (which is not involved)

The problem here is that we persist the keyword even when we obtained the size due to mathml shenanigans.

Patches incoming.
Assignee: nobody → manishearth
Priority: -- → P2
(Assignee)

Comment 2

5 months ago
https://github.com/servo/servo/pull/16695
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.