New issue
Advanced search Search tips

Issue 693941 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 1
Type: Bug



Sign in to add a comment

Monospace text with odd-pixel font-size wrap incorrectly

Project Member Reported by l...@chromium.org, Feb 18 2017

Issue description

Chrome Version: 58.0.3016.0
OS: Windows 10, OS X

What steps will reproduce the problem?
(1) Go to this jsfiddle https://jsfiddle.net/uauemjzm/1/

alternatively, this can repro on Windows by opening the DevTools console and evaluating "[1,2,3,4,5,6,7,8,9]"


What is the expected result?
There are four top-level elements that differ only by font-size.  All of them should take one line each.

What happens instead?
Containers with font-sizes 11 and 13 have the "9]" incorrectly wrap onto a newline, while those with 12 and 14 correctly avoid wrapping.

This causes a particularly bad user experience for reading arrays/objects logged in the DevTools console, as seen in the screenshot.
 
consoleBadWrap.PNG
5.5 KB View Download

Comment 1 by e...@chromium.org, Feb 21 2017

Cc: kojii@chromium.org e...@chromium.org
Status: Available (was: Untriaged)

Comment 2 by e...@chromium.org, Feb 21 2017

Components: -Blink>Layout

Comment 3 by e...@chromium.org, Mar 1 2017

Would you mind looking into this when you get a chance kojii?

Comment 4 by kojii@chromium.org, Mar 1 2017

Labels: OS-Android OS-Chrome OS-Linux OS-Mac OS-Windows
Owner: kojii@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/460361ba8ca8615d1794caa3e6dc517634798b4f

commit 460361ba8ca8615d1794caa3e6dc517634798b4f
Author: kojii <kojii@chromium.org>
Date: Thu Mar 02 08:28:02 2017

Fix LayoutUnit snapping of widths in line breaker

This patch fixes how the line breaker snaps widths at node boundaries.

Before this patch, only uncommitted widths are snapped. This does not
snap widths correctly when:
* All widths are committed.
* There are committed and uncommitted widths.

LayoutBlockFlow::computeInlinePreferredLogicalWidths() snaps the width
of each node. This patch changes the line breaker to do the same
snapping.

BUG= 693941 

Review-Url: https://codereview.chromium.org/2725933002
Cr-Commit-Position: refs/heads/master@{#454211}

[modify] https://crrev.com/460361ba8ca8615d1794caa3e6dc517634798b4f/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/460361ba8ca8615d1794caa3e6dc517634798b4f/third_party/WebKit/LayoutTests/fast/text/fit-content-with-element-boundaries.html
[modify] https://crrev.com/460361ba8ca8615d1794caa3e6dc517634798b4f/third_party/WebKit/Source/core/layout/line/BreakingContextInlineHeaders.h
[modify] https://crrev.com/460361ba8ca8615d1794caa3e6dc517634798b4f/third_party/WebKit/Source/core/layout/line/LineWidth.h

Project Member

Comment 6 by bugdroid1@chromium.org, Mar 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/534f94d80d67e44c633f916543db38fc43fa8074

commit 534f94d80d67e44c633f916543db38fc43fa8074
Author: Rebaseline Bot <blink-rebaseline-bot@chromium.org>
Date: Thu Mar 02 09:57:29 2017

Auto-rebaseline for r454211

Build: https://build.chromium.org/p/chromium.infra.cron/builders/rebaseline-o-matic/builds/620541

https://chromium.googlesource.com/chromium/src/+/460361ba8ca86

BUG= 693941 
TBR=kojii@chromium.org

Review-Url: https://codereview.chromium.org/2728973002 .
Cr-Commit-Position: refs/heads/master@{#454222}

[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/pasting-tabs-expected.png
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/pasting-tabs-expected.txt
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/insert-text-at-tabspan-001-expected.txt
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/insert-text-at-tabspan-003-expected.png
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/insert-text-at-tabspan-003-expected.txt
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/paste-text-at-tabspan-003-expected.txt
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/win/editing/inserting/insert-text-at-tabspan-001-expected.txt
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/win/editing/inserting/insert-text-at-tabspan-003-expected.png
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/win/editing/inserting/insert-text-at-tabspan-003-expected.txt
[modify] https://crrev.com/534f94d80d67e44c633f916543db38fc43fa8074/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/paste-text-at-tabspan-003-expected.txt

Comment 7 by kojii@chromium.org, Mar 2 2017

Status: Fixed (was: Assigned)

Comment 8 by l...@chromium.org, Mar 3 2017

Thanks for the fast response and fix koji!

Comment 9 by l...@chromium.org, Mar 9 2017

Cc: l...@chromium.org
 Issue 682603  has been merged into this issue.

Sign in to add a comment