New issue
Advanced search Search tips

Issue 857166 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[layoutng] NG text width is off by one compared to legacy

Project Member Reported by cbiesin...@chromium.org, Jun 27 2018

Issue description

We may end up wontfixing this, but filing this for reference...

Testcase:
<!DOCTYPE html>
<div style="whitespace: nowrap; float: left; text-rendering: optimizeSpeed;">P c</div>

On my machine, legacy computes the width at 20px, NG computes 19px. This shouldn't be a kerning issue as optimizeSpeed should disable that. Koji has suggested other potential reasons:
"It is possible, legacy shapes each word (split by spaces) and accumulate them, while NG shapes each "run" (split by font or Unicode script.) HarfBuzz uses 16 bits fixed point, while Blink uses float for glyphs and LayoutUnit for boxes."

I don't know how much time we want to spend on figuring this out, but I at least was surprised that we differ even for such a simple testcase.
 

Comment 1 by e...@chromium.org, Jun 27 2018

"font-kerning: none; font-variant-ligatures: none;" is a more reliable way to disable kerning/ligatures.

Some differences in width is expected due to the changes in how we split things in NG. I would argue that NG is more correct.

I'd close this as WontFix.

Oh, using those properties does make us match.

I wonder if we should sprinkle that into some tests...

Comment 3 by e...@chromium.org, Jun 27 2018

Ah, in that case the root cause of the problem you're seeing is likely that the font in question kerns with space characters. In legacy we intentionally ignore that in some cases as a performance optimization while NG respects it.

Status: WontFix (was: Available)
Closing as wontfix. Thanks for pointing out font-variant-ligatures!

Sign in to add a comment