Spaces/newlines before/after atomic inlines can offset text-align: center/right |
|||||||||
Issue descriptionIn this fiddle: https://jsfiddle.net/4d5nmjs4/2/ The sides of the blue and red boxes should line up, but on Chrome the top blue row is offset. The only difference between the blue and red boxes is a single newline.
,
Mar 16 2017
This is a line layout issue, adding some people who do more of that stuff.
,
Mar 16 2017
Thanks!
,
Mar 18 2017
,
Mar 21 2017
Can repro with two consecutive spaces. So we probably measure collapsed spaces when we apply text-align.
,
Mar 21 2017
Thanks Koji!
,
Mar 27 2017
The problem appears to be that in updateLogicalWidthForAlignment the totalLogicalWidth has the width of an extra space yet, as the extra space is in the middle, there is no trailingSpaceRun. Yet another reason that I'm happy that we're moving towards doing white-space collapsing as a separate stage in NG. As for fixing this bug we'd either need to ensure that the totalLogicalWidth passed into updateLogicalWidthForAlignment is the width *without* the extra space, or pass in a width of the extra spaces and subtract it.
,
Mar 27 2017
,
Mar 29 2017
We seem to be measuring spaces both before and after replaced elements: http://output.jsbin.com/yoluviy * Reproduces on Safari. Edge/Gecko are fine. * "-webkit-line-break: after-white-space" can workaround the problem.
,
Mar 29 2017
,
Mar 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1bdce8bacd54f2f8397939561e42822916c4fcb7 commit 1bdce8bacd54f2f8397939561e42822916c4fcb7 Author: kojii <kojii@chromium.org> Date: Fri Mar 31 03:52:48 2017 Fix text-align: center/right when line wraps at atomic inline and spaces LayoutBlockFlow::updateLogicalWidthForAlignment() requires trailingSpaceRun to compute center/right alignment when line wraps at atomic inline and spaces, but InlineBidiResolver computes trailingSpaceRun only when UAX#9 L1 is needed. This patch fixes to compute trailingSpaceRun also when text-align needs it. The used value of text-align is saved in LineInfo to use later since it is now computed earlier, and computing it is more than reading from ComputedStyle. Also turns soft-hyphen-4.html to a ref test. BUG= 660178 Review-Url: https://codereview.chromium.org/2786753002 Cr-Commit-Position: refs/heads/master@{#461018} [modify] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/LayoutTests/TestExpectations [add] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/LayoutTests/fast/css/text-align-img-expected.html [add] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/LayoutTests/fast/css/text-align-img.html [add] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-4-expected.html [delete] https://crrev.com/f73bd477a4ec4815ddae1e9878fc283f1ec5c98f/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-4-expected.txt [delete] https://crrev.com/f73bd477a4ec4815ddae1e9878fc283f1ec5c98f/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-4-expected.png [delete] https://crrev.com/f73bd477a4ec4815ddae1e9878fc283f1ec5c98f/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-4-expected.png [delete] https://crrev.com/f73bd477a4ec4815ddae1e9878fc283f1ec5c98f/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-4-expected.png [modify] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h [modify] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp [modify] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/Source/core/layout/line/InlineIterator.h [modify] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/Source/core/layout/line/LineInfo.h [modify] https://crrev.com/1bdce8bacd54f2f8397939561e42822916c4fcb7/third_party/WebKit/Source/platform/text/BidiResolver.h
,
Mar 31 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7602f48856384abd726f94c0da089b517acc9017 commit 7602f48856384abd726f94c0da089b517acc9017 Author: Rebaseline Bot <blink-rebaseline-bot@chromium.org> Date: Fri Mar 31 05:26:15 2017 Auto-rebaseline for r461018 Build: https://build.chromium.org/p/chromium.infra.cron/builders/rebaseline-o-matic/builds/648583 https://chromium.googlesource.com/chromium/src/+/1bdce8bacd54f BUG= 660178 TBR=kojii@chromium.org Review-Url: https://codereview.chromium.org/2785973005 . Cr-Commit-Position: refs/heads/master@{#461049} [modify] https://crrev.com/7602f48856384abd726f94c0da089b517acc9017/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/7602f48856384abd726f94c0da089b517acc9017/third_party/WebKit/LayoutTests/platform/mac/fast/borders/rtl-border-05-expected.png [modify] https://crrev.com/7602f48856384abd726f94c0da089b517acc9017/third_party/WebKit/LayoutTests/platform/mac/fast/borders/rtl-border-05-expected.txt
,
Mar 31 2017
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by danakj@chromium.org
, Mar 16 2017