New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 779921 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 2
Type: Bug



Sign in to add a comment

Negative text-indent and anonymous block container makes text stick out to right margin

Reported by kwk...@vivliostyle.com, Oct 31 2017

Issue description

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

Steps to reproduce the problem:
1. Open the attached test case

What is the expected behavior?
No text should stick out to right margin of div.container.

What went wrong?
The first line of an anonymous block container following an empty div stick out to right margin of div.container.
It seems that the negative text-indent specified on div.container is taken into consider when calculating width of the first line of the anonymous block container but not applied to the actual layout.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 62.0.3202.75  Channel: stable
OS Version: OS X 10.12.6
Flash Version: 

Safari and Firefox do not have the same problem.
I am not sure, though, that the text-indent should be applied to the anonymous block container or not according to CSS spec.
 
text-indent-bug.html
993 bytes View Download
chrome.png
46.5 KB View Download
firefox.png
32.6 KB View Download
Labels: Needs-Triage-M62

Comment 2 by hdodda@chromium.org, Oct 31 2017

Cc: hdodda@chromium.org
Labels: M-64 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows 10 , Ubuntu 14.04 and Mac os 10.12.6 using chrome M62 #62.0.3202.75 and M64 #64.0.3254.0.

This issue is seen from M50 and is a Non-Regression issue.

Marking it as untraiged for further inputs on this.

Thanks!

Comment 3 by e...@chromium.org, Oct 31 2017

Owner: kojii@chromium.org
Status: Assigned (was: Untriaged)
Would you mind taking a look at this one Koji?
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 1 2017

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

commit 4a970a7eeb584e1e32bd75e478ba0936e439fd63
Author: Koji Ishii <kojii@chromium.org>
Date: Wed Nov 01 16:50:21 2017

Fix line breaking with text-indent in an anonymous block

This patch fixes line breaking of a block that meets all following
conditions:
1. Has the 'text-indent' property set.
2. Is in an anonymous block.
3. Is not the first child of its parent element.

The spec[1] defines not to apply 'text-indent' in this case.
LayoutBlockFlow honors this definition, but LineBreaker did not.

In this patch, LayoutBlockFlow, LineBreaker, and NGLineBreaker
shares the logic.

[1] https://drafts.csswg.org/css-text-3/#text-indent-property

Bug:  779921 
Change-Id: Iae81a7a96c1be1b787eb53b4b4a2001b8a68c526
Reviewed-on: https://chromium-review.googlesource.com/748821
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513155}
[add] https://crrev.com/4a970a7eeb584e1e32bd75e478ba0936e439fd63/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-indent/text-indent-anonymous.html
[modify] https://crrev.com/4a970a7eeb584e1e32bd75e478ba0936e439fd63/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h
[modify] https://crrev.com/4a970a7eeb584e1e32bd75e478ba0936e439fd63/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
[modify] https://crrev.com/4a970a7eeb584e1e32bd75e478ba0936e439fd63/third_party/WebKit/Source/core/layout/api/LineLayoutBlockFlow.h
[modify] https://crrev.com/4a970a7eeb584e1e32bd75e478ba0936e439fd63/third_party/WebKit/Source/core/layout/line/LineBreaker.cpp
[modify] https://crrev.com/4a970a7eeb584e1e32bd75e478ba0936e439fd63/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc

Comment 5 by kojii@chromium.org, Jan 24 2018

Status: Fixed (was: Assigned)

Comment 6 by kojii@chromium.org, Jan 24 2018

Labels: OS-Android OS-Chrome OS-Fuchsia

Sign in to add a comment