New issue
Advanced search Search tips

Issue 844791 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Different whitespace in HTML causes different text rendering

Reported by chrissa...@gmail.com, May 18 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

Steps to reproduce the problem:
1. Load attached test case, or see online version at http://test.chrislewis.codes/space-tab-rift/
2. Observe different "T" renderings depending on what white space precedes the T in HTML

What is the expected behavior?
Every T after a space should be wide, due to a contextual alternate OpenType feature in the font.

What went wrong?
T's that occur after multiple whitespace characters in the HTML do not do the glyph substitution, even though all the whitespace is collapsed into a space by usual HTML rendering.

Did this work before? N/A 

Does this work in other browsers? No
 Similar problem happens in Safari. Firefox works correctly.

Chrome version: 66.0.3359.139  Channel: stable
OS Version: OS X 10.13.4
Flash Version:
 
space-tab-rift.zip
8.0 KB Download
space-tab.png
149 KB View Download
Labels: Needs-Triage-M66
Cc: susan.boorgula@chromium.org
Labels: M-68 Triaged-ET FoundIn-68 Target-68 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
chrissam42@ Thanks for the issue.

Able to reproduce the issue on Mac OS 10.13.3, Windows 10 and Ubuntu 14.04 on the latest Canary 68.0.3436.0 and Stable 66.0.3359.181 by the steps mentioned in the original comment.
Attached is the screen shot for reference.

This is a Non-Regression issue as this behaviour is observed from M60 Chrome builds. 
Hence marking this as Untriaged for further updates from Dev.

Thanks..
844791.png
240 KB View Download

Comment 3 by drott@chromium.org, May 21 2018

Cc: kojii@chromium.org e...@chromium.org
Status: Available (was: Untriaged)
kojii@, eae@, any ideas, why the whitespace collapsing does not make it down to shaping or is somehow incompatible with our detection for whether we can use the word cache?

Comment 4 by kojii@chromium.org, May 21 2018

Labels: -Pri-2 Pri-3
This font must have a ligature for " "+"T", and the current layout engine does not support ligature with spaces very well. When the preceding space was collapsed, we probably do not give the last preserved space as the context to the shaper.

LayoutNG fixes this problem.
It's not a ligature, it's a contextual alternate (OpenType `calt` feature). So the T is the only glyph that is actually substituted, and the space is just detected as being there but isn't replaced itself.
FWIW, a Safari developer told me the problem comes from the way the line is broken into inline boxes. One of the things they break on is multiple whitespace, collapsed spaces don't belong to any of the inline boxes.

Comment 7 by kojii@chromium.org, May 21 2018

> It's not a ligature, it's a contextual alternate

Sorry for my inaccurate comment, I should have said contextual shaping features. Like issue 796943, our current engine does not support shaping across collapsed spaces. This is to be supported in issue 636993.

Sign in to add a comment