mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +01:00
layout: Resolve word_spacing ahead of time.
It's not possible anymore, in the presence of min() / max(), to split a <length-percentage> value into a <length> and a <percentage> component. Tweak word_spacing to do what Gecko does (resolving it in advance).
This commit is contained in:
parent
e227715aee
commit
f03026b869
8 changed files with 45 additions and 24 deletions
|
@ -434,9 +434,7 @@ impl Shaper {
|
|||
// We elect to only space the two required code points.
|
||||
if character == ' ' || character == '\u{a0}' {
|
||||
// https://drafts.csswg.org/css-text-3/#word-spacing-property
|
||||
let (length, percent) = options.word_spacing;
|
||||
advance =
|
||||
(advance + length) + Au::new((advance.0 as f32 * percent.into_inner()) as i32);
|
||||
advance += options.word_spacing;
|
||||
}
|
||||
|
||||
advance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue