Depends on D182450
Details
Existing WPT tests (with corrections in earlier patches here).
Try run: https://treeherder.mozilla.org/jobs?repo=try&revision=828c4284f5963297c7dd00e0fe570ec2ca89b9b0
Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Build Status
Buildable 565214 Build 662835: arc lint + arc unit
Event Timeline
Ticking request changes until the question in the previous patch is addressed. Also some questions, I don't understand why we need this type defined three types.
| servo/components/style/values/computed/font.rs | ||
|---|---|---|
| 766 | I don't understand, why can't this be type FontSizeAdjust = GenericFontSizeAdjust<NonNegativeNumber>;? Then you don't need manual ToAnimatedValue etc. | |
| servo/components/style/values/specified/font.rs | ||
| 720 | nit: Turbofish is not needed here, NonNegative<f32> | |
| 733 | Can you use clone_font_size().used_size (since presumably that's what you want)? But that makes me think this is not right. "font-size-adjust" is one of the early properties and thus gets cascaded early, _before_ doing the min-font-size etc adjustments. Is that what you really want? Should we look at the parent's font size? Is it sound to look at our own given font-size-adjust can affect font metrics? | |
| 754 | Same, why can't this be GenericFontSizeAdjust<FontSizeAdjustFactor>? | |
| servo/components/style/values/computed/font.rs | ||
|---|---|---|
| 766 | I don't remember the exact details, but I had trouble getting it to build... something was getting confused about types.... but having gone back over it, this time things seem to be working OK, so I think we could indeed revert to that. | |
| servo/components/style/values/specified/font.rs | ||
| 733 | Yeah, I think this is a problem. While this implementation passes the (limited) current tests, it's not actually right; it ends up resolving from-font based on the parent element's font, which is wrong. What we want is the ex-height (or whatever metric is chosen) ratio from what's going to be the current element's font. What I'm currently thinking is that we could handle this in cascade.rs, as part of fixup_font_stuff. I'll see if I can make that work. | |
| 754 | As above, at some point along the way I was running into compilation failures that I couldn't figure out at the time, but now it seems OK. | |
| servo/components/style/values/specified/font.rs | ||
|---|---|---|
| 733 | An example of this is https://codepen.io/jfkthame/pen/NWEMaaG, which shows incorrect behavior with the old version of the patch (the result of font-size-adjust from-font depends on the font of the parent, instead of resolving based on the metrics of the element's own font). With the revised version, this works as expected. (FWIW, it fails in current Safari Tech Preview; I'll add a WPT version of the test to show this.) | |
This is fine generally (but worth waiting for the spec issue to be resolved probably?)
| servo/components/style/properties/cascade.rs | ||
|---|---|---|
| 1292 | maybe resolve_font_size_adjust_from_font_if_needed? | |
| servo/components/style/values/computed/font.rs | ||
| 762 | Oh, ok, so you're preserving the FromFont in the computed value, but fixing up during the cascade. That's... a bit weird, but seems ok I think. | |
| servo/components/style/values/specified/font.rs | ||
| 706 | Why is this needed? Could you leave a comment? | |
| 723 | I think you don't need the _cloned now. | |
| servo/components/style/values/specified/font.rs | ||
|---|---|---|
| 723 | Ah yeah, you just need to use ident.clone() only in the error path. | |
Agreed -- as it happens Chris has just chimed in there, and confirmed the expected behavior, so we're good. But this can wait till post-soft-freeze anyhow.
| servo/components/style/properties/cascade.rs | ||
|---|---|---|
| 1234 | You could move this afterwards right before using it, correct? No big deal either way. | |
| 1270 | I guess you could've used None to fallback to ascent, and Some for other stuff, but seems fine. | |
| servo/components/style/values/specified/font.rs | ||
| 709 | Maybe point to the draft? | |